[ Home Page ] [ Eiffel Archive ] [ Eiffel Applications ]

Arc de Triomphe clipart (2486 bytes)

The Virtual (and Partial) Train Set

Written by Andrew Jelavic.

vtrain.zip (222,339 bytes) - source code

This program implements a simple train set. The user is presented with two screens - one showing the train operating and the other showing the track construction. The user builds the track and can see it used in the other window.

It is written in Eiffel, of course, and uses Object Tools' Grape GUI. It uses polling and event driven functions.


The program starts with two windows - the Train Window and the Track Window. In this state the track exists as a single point (to be extended) on the track window and the train sits on the point in the train window.

Building the track

The user extends the track by selecting a point to extend to in the Track Window and clicking on that point with the left mouse button. The track is automatically drawn in both windows.

Completing the track circuit

The track circuit can be closed (ie. Both ends touching) by clicking with the right mouse button in the Track Window. The completed section of track will then be drawn in both windows.

[ Home Page ] [ Eiffel Archive ] [ Eiffel Applications ]