This paper describes the implementation of an algorithm that creates maps of an unknown environment for a robot. The algorithm is tested using a model of the Pioneer 2DX mobile robot found in the Player/Stage simulator, and a virtual environment that reflects a real place in the Autonomous University of Yucatan. The tests run simulations of the mobile robot traveling through the virtual environment. A joystick is used to manually control the robot, and a laser sensor is used for the detection of obstacles and walls. Maps obtained using the algorithms are able to represent the environment with the required precision for the robot to navigate.