Combat

Developer(s): Jack Armstrong
Date: 1984
Type: Program
Platform(s): ZX81, TS 1000
Tags: Game

A number-guessing duel for the ZX81 or TS1000 under a block-graphic COMBAT! title and tank. Enter a number from 1 to 10 for each of 20 goes; the computer then draws up to four random numbers, and if one matches yours you score. Five hits wins; otherwise the game ends after 20 goes with a rating in percent (20 for each hit).

The input is slow, so give the counter time to act after each number. The download is the 1991 printing, which adds line 1025 to print the tank; the 1984 printing never prints it (The Plotter’s April 1984 “Oops” asked readers to add a line that does). It needs more than 2K of RAM.

Published in The Plotter March 1984 (Combat), with a correction in April 1984 (Oops), and printed again in October 1991 (Combat!).

Image Gallery

Source Code

  10 REM "COMBAT" BY JACK ARMSTRONG
  15 REM MARCH 1983 "THE PLOTTER"
  18 REM ENTER 20 NUMBERS BETWEEN 1 AND 10
  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 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$
1025 PRINT AT 12,9;A$
1030 RETURN

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