I have searched a lot for the implementation and I found these below.
They are very helpful, but I think there are still some defects in these solutions.
Defect 1. All of the create-body 's scripts in these solutions used a delay time to keep a fixed gap between bodies.
What if the snake’s speed is various, which leads to different gaps between body parts?
Defect 2. How could I insert a body to the snake or swap a body with another and makes the snake apply the change automatically?
( all of these solutions are simply appending a body to the tail, which will also cause same problem in defect 1 if the snake speed has changed).
How could I make up for deficiencies?