This folder contains a few sample programs.
Simple programs
- helloworld.sim is the famous "Hello, World" program.
- testsimulation.sim demonstrates simple use of class Simulation.
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
- jensensdevice.sim demonstrates the famous Jensen's device using 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.