More tasks for the hook

Combining a program similar to the above with the random number routine (p. 161) can be the basis for a game of chance. One version is being played in the photo on p. 353.

The playing area is a square of card marked out in, say, 5 rows and 5 columns of squares. The hook picks up the load from a fixed location and deposits it on one of the squares. Players win or lose according to the rules of the game, decided upon beforehand. Add excitement to the game by programming the Gantry to 'change its mind' a few times before eventally setting down the load.

Using a version of the scan routine (pp. 349-350), program the hook to sweep the area systematically for objects and place them in a neat row at the back of the working area.

Was this article helpful?

0 0

Post a comment