I'm not really sure what you want, but have a look at this program. Each segment's location is stored in an array. On each movement, the old tail segment is erased and a new head segment is drawn, creating the illusion of movement.