Horse race

The following program performs a race with 6 horses. It was developed by pupils from a school in Hungary, under supervision of Peter Hanak. It could be extended with a mechanism to accept bets. The program makes use of the cursor function to organize the layout of the screen. It uses choose128 to produce (quasi-)random numbers.


\begin{elan}
program :
start horses ;
REP
choose horse ;
move horse
U...
... ( ''The winner is horse number:'' ) ;
put ( ix ) ;
line ( 2 ) .
\end{elan}