Double acting steam engine.

steamengineanim.gif (721457 bytes)
Same principle of operation as on locomotive.