What the program does

What the sample program does

The sample program performs a number of comparatively simple operations, with sequencing, timing and a response to events that depends on past history. This is typical of the functions required in machine controls. The functions were also selected because they are immediately recognizable.

STOP!

Before you scroll down to the explanation, why don’t you try and work out what the program does. Look at each of the languages, and see which one most clearly expresses what is happening.

To make this test as fair as possible, we set ourselves the rule that each version would have only a single comment for each of the 3 tasks. Hence, there are no line by line comments in any of the programs. That’s not how we suggest you work normally, but it ensures a level playing field for the comparison.

You will notice the SPLat program has clickable links to explanations of most instructions. (It is our show, after all!). You may chose to defer clicking on those until you have tried solving the puzzle for yourself. If you are already familiar with the other languages, it might be fairer to SPLat if you do look up any instructions that are not totally obvious straight away.

OK, you can scroll down to the program description now.

… (Just like those joke emails 🙂

The program performs 3 functions concurrently:

  1. Monitor two inputs. Capture the first one to come on and flash the corresponding output for 1 second. Wait until both inputs are off before re-arming. We call this function “Sale of the Century” after the buzzer mechanism used on the game show.
  2. A push on/push off light switch. The first input pulse (push of the button) turns the output on. The second pulse turns it off again.
  3. A short pulse on an input turns an output on. A long pulse turns it off. This is an example of a single push button providing on and off control.
Window Close[X]