Swarm robotics has been focused in order to express more advanced performance using lower performance devices. Swarming behaviors of multiple robots are need for working in industries or in places where a human cannot enter. In the natural world, some creatures which have simple biological function can acquire higher intelligence by swarming. Therefore, biomimetic method is effective in order to establish an efficient swarming system. In the swarming robotic system, because cost of the system increases in proportion to number of a robot, devices of robots are required to be simple. Furthermore, an implemented algorithm into robots should be designed considering a simplification of the individual robot with keeping correctness of the model of the robots. In this paper, a simple algorithm for swarming and following behaviors is proposed assuming that robots had only three sensors to detect distance information. The algorithm consists of nine patterns according to information of three PSD sensors. In the proposed algorithm, each robot's movement is determined based on the inputs of three distance sensors. Then, a virtual simulator for multiple mobile robotics is developed to evaluate the performance of the algorithm, in which the movement of a virtual robot is modeled based on an actual three-wheeled mobile robot. It is assumed in the simulator that the robot moves only to six directions and rotates counterclockwise or clockwise on the position; the robots do not communicate with each other; shape and kinematics of the robot are simplified in the two-dimensional plane. Several simulations using the proposed algorithm are conducted to evaluate the performance for the swarming and following behaviors. Results of the simulations show that the proposed algorithm can provide swarming and following behaviors.