BOGGLED (16K ZX81)
by D Harris, Great Barr, Birmingham
from Your Computer (September 1984), Pages 155-156

Boggled is based on a popular table game and although exciting to play, a few problems become apparent after playing the game a few times.

One of the players has to shake the box containing the dice, remove the lid without looking at the dice in position and lastly start the timer. I then decided to program the game on my ZX-81 which would solve all these problems and also enable more than four people to take part with these added benefits:

* No shaking of dice - no noise.
* All players have equal advantage in seeing the playing grid one way up. Normally four players would sit around a table and the board will appear different in each position. This results in some players finding some words and maybe higher scoring words, easier.
* The screen goes blank to end the game when the timer is finished. This stops the players writing on after the time if the timer has been missed finishing. Here is a breakdown of the program and what it does:

Lines   30 to  190   Minimum three-letter word game on a four by four grid.
Lines  380 to  636   Letters as displayed on the grid.
Lines  700 to  732   Timer.
Lines  734 to  744   Attracts players' attention that the game is about to start.
Lines  750 to  860   Timer countdown.
Lines  870 to  890   Blank out screen to end game.
Lines  892 to  910   Re-display grid with scoring details.
Lines  920 to 1140   Introduction.
Lines 1150 to 3120   Instructions and rules.
Lines 3125 to 3150   Choice of grid size.
Lines 4000 to 4180   Minimum four letter word game on a five by five grid.

This program chooses a random letter from one "die" and then randomly places that letter on the grid. This is achieved by putting all the letters into one string and using the string slicing to remove one die at a time. The machine-code routine at the beginning of the program is used to find an empty position on the grid in which to print the letter.

I would like to give credit to Alan Potter of Glasgow for this routine. It is much quicker than the

    LET P=PEEK(PEEK 16398+256*PEEK 16399)

Basic line and reduces the time waiting for the grid to be set up.