Hardware World Issue 5 Contents Helpline

mind games



Philip Joy looks into his postbag and finds a wide variety of competition entries, new forms of chess and anagram games.

Good response to Nim contest

P MARSON, from Mansfield, Nottinghamshire has what look like two good programs, HexaPawn and QuadraPawn. He has included 10 pages of details about them but I have not had time to read them.

It makes a change, though, to see that amount of documentation; most people supply very few details. He asks a question about how much memory a program takes but I feel that it would be more useful for him to know how much memory is left, as he will then know how much free space he has, taking account of variables as well.

1   LET X=VAL "50"
2   PRINT "NIM";TAB 1;"MAX.NO.O
    F MATCHES YOU MAY TAKE =3"
3   PAUSE 120
4   CLS
10  PRINT AT 0,0;"YOUR GO"
15  PRINT AT 11,5;"NO. OF MATCHE
    S LEFT=";X;" "
20  INPUT A
25  IF A>3 R A<1 THEN GO TO 20
30  LET X=X-A
35  PRINT AT 11,5;"NO. OF MATCHE
    S LEFT=";X;" "
40  IF X=0 THEN PRINT AT 0,0;"YO
    U WIN";Q
45  PRINT AT 0,0;"  MY GO"
50  LET D=X
55  GO SUB 100
60  IF D=X THEN LET X=X-INT(RND
    * 3)-1
65  PAUSE 120
70  IF X=0 THEN PRINT AT 0,0;"I
    WIN  ";Q
75  GO TO 10
100 FOR H=0 TO 12
105 IF X-1=4*H THEN LET X=X-1
110 IF X-2=4*H THEN LET X=X-2
115 IF X-3=4*H THEN LET X=X-3
120 NEXT H
125 RETURN

He will also know how much his program is taking up, variables and all, by taking away that figure from his memory size. I know of a USR routine in the ROM which will give the amount of free memory. The instructions look like this:

Print USRx.

What I want to know is x, its decimal value; the first person whose letter I open will be sent a copy of my adventure program. Please mark the letter USR competition.

I was delighted to receive a number of versions of both one- and three-pile Nim. I have decided to give copies of my adventure game to J Leaver, London; M Woodruff, Lancs; H Duncan, Cambs; J Williamson, West Lothian; I Stracey, Cambs. If they will send me a SAE with at least a C20, I will copy the adventure on to it for them.

If you send a tape to me and would like it returned, please enclose a SAE.

Some of the versions of Nim fit into 1K and one is listed, while others use machine code or show very high skill. So people have won a copy of my adventure for different reasons. The version listed is a winner, from Hugo Duncan, of Cambs; it fits into 1K of memory.

Duncan says that the number of matches may be changed by changing line 1 and line 100. He says that if it is changed to a multiple of four, the ZX-81 is unbeatable.

Returning to chess, I thank Mr Egdoll of Glasgow for sending some more matches. I will be including those games but they take a long time to check and comment on ready for publishing.

I received a letter from the Electric Pencil Co of North Humberside about chess programs in general. I was asked to compare Chess I-ZX chess - to the Sargon chess program and Chess II to the TRS-80/VG Sargon 2.5 program. I have a Video Genie computer and a copy of the Sargon 2.5 program and I can say that if Chess II plays as well, it must be very powerful.

Two programs were received this month which are different from what has been included so far. They are Anagram and Crossword but were received too late for review this month. At first glance it looks as if they are good.



Hardware World Issue 5 Contents Helpline

Sinclair User
August 1982