Sample programs

This folder contains a few sample programs.

Simple programs

Simulation

These programs demonstrate use of class Simulation:

  • fittingroom.sim shows a fitting room in a shop and a queue of customers wanting to use it.
  • liftdemo.sim models a building with a lift and several people using the lift.
  • sortbysimulation.sim shows that you can even sort an array using class Simulation.

Language features

These programs demonstrate various language features:

Name parameters

Recursion

  • tqueens.sim is an extremely compact solution to the well-known problem of placing 8 queens on a chess board.
  • eightqueens.sim is a different program for the 8 queens problem. This version is more verbose than the previous one, but it is more advanced in that it will exclude solutions that are mirrors or rotations of other solutions.

Separate compilation

  • dates.sim contains a class Date with useful procedures for handling dates; it is intended for separate compilation. datestest.sim is a test program using that class.
Published Sep. 27, 2025 3:41 PM - Last modified Sep. 25, 2026 2:17 PM