LEGO MINDSTORMS Robot Inventor
This robot slithers around like a snake, and it can also follow a line like a train following a track. My cats are normally unimpressed by my LEGO robots, but they found this one disturbing...
On carpet or any surface, you can drive the Snake Train by remote control, or try the autonomous program that wiggles around in a wavy oval pattern. On a smooth surface you can lay down a line with tape for it to follow using the line following program. See the program image descriptions for details.
I left the design of the engine and the cars plain and simple, so have fun adding to or modifying them!
The Snake Train Oval program uses the hub's gyro sensor, so see this note to make sure it is calibrated first.