Combat

See all articles from The Plotter v2 n3
Author(s): Jack Armstrong
Publication: The Plotter
Pub Details: The Plotter v2 n3 (Volume 2, Issue 3)
Date: March 1984
Pages: 4

Our ZX/TS program this month comes again from JACK ARMSTRONG and is a short little game.

  10 REM "COMBAT"
20 LET SCORE=0
30 FOR J=1 TO 20
35 GOSUB 1000
40 PRINT AT 0,0;"ENTER A NUMBER FROM 1 TO 10";AT 1,8;"GO NUMBER ";J
50 INPUT A
60 IF A<1 OR A>10 THEN GOTO 50
70 PRINT AT 10,0;"YOUR NUMBER IS ";A;AT 12,6;"SCORE IS ";SCORE
80 FOR G=1 TO 4
90 LET B=INT (RND*10)+1
100 PRINT AT 3,3;B;" "
110 IF B=A THEN GOTO 130
120 NEXT G
130 IF A=B THEN LET SCORE=SCORE+1
140 IF A=B THEN PRINT AT 14,6;"WELL DONE"
150 IF A<>B THEN PRINT AT 14,8;"BAD LUCK"
160 PRINT AT 12,6;"SCORE IS ";SCORE
170 IF SCORE=5 THEN GOTO 260
180 FOR T=1 TO 20
190 NEXT T
200 CLS
210 NEXT J
220 PRINT "THE GAME IS OVER AND YOU ONLY"
230 PRINT "SCORED ";SCORE
240 PRINT "YOUR RATING IS ";SCORE/.05;" PERCENT"
250 GOTO 290
260 PRINT "YOU DID IT"
270 SCROLL
280 PRINT "YOU WIN"
290 SCROLL
300 PRINT "ANOTHER TRY? PRESS ""RUN"" ""ENTER"""
310 STOP
1000 LET A$=" \..\..\..\..\::\::\::                             \':\::\::                        \::\::\::\::\::\::\::\::\::\::\::                    \::\::\::\::\::\::\::\::\::\::\::\::\::                    \::\::\::\::\::\::\::\::\::\::\::\::                     \':\:'\|.\|.\|.\|.\|.\':\:'  "
1010 LET B$=" \::\::\:: \::\::\:: \::\:. \.:\:: \::\::\:: \.:\::\:. \::\::\:: \:: \:: \:: \:: \::\ '\::\' \:: \:: \:: \:: \:: \:: \:: \:: \:: \:: \:: \:: \::\::\:: \::\::\:: \:: \:: \:: \:: \:: \:: \:: \:: \:: \:: \:: \:: \::\::\:: \::\::\:: \:: \:: \::\::\:: \:: \:: \:: \::"
1020 PRINT AT 4,2;B$
1030 RETURN
2000 SAVE "COMBAT"
3000 GOTO 10

Transcription note: This is the same graphics as Combat! in The Plotter v9 n10, which differs in a few cells of A$ and in the spacing of B$. The faint E of LET in line 1010 is restored.

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.