EasyManuals Logo

Sinclair ZX INTERFACE 1 User Manual

Sinclair ZX INTERFACE 1
64 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #43 background imageLoading...
Page #43 background image
The net game
There is a copy of this game on the demonstration cartridge supplied with
the Microdrive. Its file name is “net game”. The program gives a good
example of how the net can be used. Parts of it might usefully be included
in programs of your own.
The game
To play this game. you and your opponent must each think of a number
between 1 and 100. The winner of the game is the one who guesses his
opponent’s number first. At each guess you make, your computer will tell
you how close you are getting.
The program
The subroutine at line 500 decides who is user 1 and who is user 2. This is
so that, when you exchange guesses, one of you uses the subroutine at
line 1100, and the other uses the subroutine at line 1200; and thus user 1
sends first and user 2 receives first.
Your computer decides who is user 1 by sending your opponent’s computer
the message “1”. and then listening. If it receives back a “1”. this means that
your opponent’s computer was switched on after yours. Your computer
therefore rends a “2” to your opponent’s computer, and makes itself user 1.
(If, on the other hand, your computer receives back a “2”. this means that
your opponent’s computer was already switched on and listening when your
computer sent the “1”. Your computer will therefore make itself user 2.)
If both computers start at the same time they will collide and it will be
necessary to BREAK and start again.
The body of the program is involved with exchanging names, inputting the
secret number (which is not sent) and then comparing guesses. First, guesses
are sent, and then the replies.
Lines 190 onwards detect a win, signal it appropriately, and then offer
another game.
41

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Sinclair ZX INTERFACE 1 and is the answer not in the manual?

Sinclair ZX INTERFACE 1 Specifications

General IconGeneral
BrandSinclair
ModelZX INTERFACE 1
CategoryComputer Hardware
LanguageEnglish