The shape-shifting robot AMOEBA-I is the rescue-researching robot that can adapt complex environment with different configurations. The robot with line configuration can pass through the narrow space and has the better ability of obstacles. In order to improve the environment adaptability of the robot in line configuration, the turning algorithm is proposed based on the turning-shape algorithm. The turning-shape has been defined and the process of transformation between L shape and other shapes are analyzed. By establishing the mathematical model and researching the kinematics and dynamics, we can compute the driving force and infer the force of the motors needed. Finally, the effective and previous algorithms have been proved by experiment and simulation.