We propose a SPAM (simultaneous planning and mapping) technique for a manipulator-type robot working in an uncertain environment via a novel Best Next Move algorithm. Demands for a smart decision to move a manipulator such as humanoid arms in uncertain or crowded environments call for a simultaneous planning and mapping technique. In the present work, we focus more on rapid map generation rather than global path search to reduce ignorance level of a given environment. The motivation is that the global path quality will be improved as the ignorance level of the unknown environment decreases. The 3D sensor introduced in the previous work has been improved for better mapping capability and the real-time rehearsal idea is used for -space cloud point generation. Captured cloud points by 3D sensors, then, create an instantaneous -space map whereby the Best Next Move algorithm directs the local motion of the manipulator. The direction of the Best Next Move utilizes the gradient of the density distribution of the -nearest-neighborhood sets in -space. It has a tendency of traveling along the direction by which the point clouds spread in space, thus rendering faster mapping of -space obstacles possible. The proposed algorithm is compared with a sensor-based algorithm such as sensor-based RRT for performance comparison. Performance measures, such as mapping efficiency, search time, and total number of -space point clouds, are reported as well. Possible applications include semiautonomous telerobotics planning and humanoid arm path planning.