BATTLESHIPS

-----------

by Jeff Hamilton

from ZX Computing, April/May 1983



Command your own fleet with this program by Jeff Hamilton of Gillingham.





This program has been written to allow users to challenge their Spectrum

computer to the age old classroom game of Battleships.



When you have the game RUNning, you will be asked to INPUT the direction of

your ships and the starting square. The Spectrum will automatically set your

ships on the grid. Once, a battleship (four squares), two cruisers (three

squares) and three destroyers (two squares) have been set up, the Spectrum

decides who should begin the game.



The Spectrum's moves are calculated in lines 1000 to 1080; a random square is

chosen to fire at unless the Spectrum has just scored a hit on your fleet. If

it has just achieved damage to one of your ships, it will continue to fire at

the surrounding squares until it has sunk the vessel.



In the navy



Once the Spectrum has selected a square to fire at, it is up to the user to

respond with either a 'M' for a miss or an 'H' for a direct hit. There is no

routine in the program to counteract the user lying to the computer, but

there is no reason why a simple routine could not be written to stop any

"innocent" cheating.



When it is the user's turn, simply INPUT the co-ordinates, for example, 'F7'

for the grid reference F7, and the result will be displayed on the screen as

a miss or as a hit with accompanying BEEP. It might be an idea to make a

mental note as to which squares you have already fired at, as the computer

will not tell you if you have already had a go at a certain grid reference.

