```################################
#  Don't Stand So Close To Me  #
#  BASIC 10-line Contest 2022  #
# email: coutgames64@gmail.com #
################################```

====

To survive standing in a 10x10 room with an infected person moving around the room.

Game Instructions

=================

When the game begins, you see an empty 10x10 room and will be prompted to enter the X and Y coordinates where you wish to stand.

After entering the two digits from 0 to 9, you will be displayed on the screen as the letter "I".

However, someone else is also in the room that is infected who will be randomly stand somewhere in the room, which will be displayed as a green "O".

The infection will spread one grid-cell surrounding the infected person, and will also turn green.

If you stand where the person is or in one of the green grid-cell you will become infected and the game is over.

If you are outside the distance of the infection, you score 1 point and play continue with in a new room with different infected co-ordinates.

Control

=======

Keyboard by entering digits 0 to 9.

Game Requirements

==================

- Commodore 64 using BASIC 2.0

or

- VICE or CCS64 Emulator

BASIC Code

==========

```0 B=53280:pokeB,0:pokeB+1,0:print"{clear}{white}DON'T STAND SO CLOSE TO ME -- COUT 2022":S=0
1 C\$="{sh asterisk*5}":B\$="{space*5}":print"{cm a}"C\$C\$"{cm s}":forI=1to10:print"{sh -}"B\$B\$"{sh -}":next:K=40
2 print"{cm z}"C\$C\$"{cm x}":D=0:print"GUESS (X,Y) SCORE:"S:gosub8:X=A:gosub8:Y=A:gosub9
3 print"I":gosub9:X=W:gosub9:Y=W:gosub9:E=1105+Y+X*K:IFPEEK(E)=32THENPRINT"O"
4 R=48:N=32:forB=-1to1:forC=-1to1:G=E+B+C*K:F=peek(G):ifF=9thenD=1
5 U=54273:Q=23:M=33:X=-1:Y=-1:ifF<33THENpokeG+54272,5:ifF=32THENpokeG,102
6 nextC,B:ifD=1THENX=11:Y=-1:GOSUB9:print"{red}{reverse on}YOU GOT INFECTED! SCORE:"S"{white}":END
7 S=S+1:pokeU+Q,21:pokeU+4,9:pokeU+5,0:pokeU,R:pokeU+3,N:pokeU+3,M:GOSUB9:GOTO1
8 Z=rnd(-TI):A\$="":getA\$:ifA\$=""orA\$<"0"orA\$>"9"then8
9 A=val(A\$):W=int(rnd(1)*9):poke781,X+2:poke782,Y+1:poke783,0:sys65520:return```

Commented Code (with fixes for multiple IF statements on one line work)

==============

```000B=53280:REM VARIABLE USED FOR BORDER/BACKGROUND COLOUR
001pokeB,0:REM SET BORDER TO BLACK
002pokeB+1,0:REM SET BACKGROUND TO BLACK
003print"{clear}{white}DON'T STAND SO CLOSE TO ME -- COUT 2022":REM DISPLAY TITLE
004S=0:REM VARIABLE FOR SCORE
100C\$="{sh asterisk*5}":REM STRING TO DISPLAY TOP AND BOTTOM GRID * 2
101B\$="{space*5}":REM STRING TO DISPLAY AND CLEAR THE GRID * 2
102print"{cm a}"C\$C\$"{cm s}":REM DISPLAY TOP OF GRID WITH CORNERS
103forI=1to10:REM LOOP THROUGH 10 ROWS
104print"{sh -}"B\$B\$"{sh -}":REM DISPLAY EDGES AND SPACES FOR GRID
105next:REM END OF LOOP THROUGH 10 ROWS
106K=40:REM VARIABLE TO POSITION LETTERS ON SCREEN
200print"{cm z}"C\$C\$"{cm x}":REM DISPLAY BOTTOM OF GRID WITH CORNERS
201D=0:REM VARRIABLE FOR DEATH
202print"GUESS (X,Y) SCORE:"S:REM DISPLAY PROMPT AND SCORE
203gosub800:REM GETS VALUE FROM USER (AND TO SEED RANDOM GENERATOR)
204X=A:REM STORES VALUE FROM USER IN PLAYER X (X CO-ORDINATE)
205gosub800:REM GETS VALUE FROM USER (AND TO SEED RANDOM GENERATOR)
206Y=A:REM STORES VALUE FROM USER IN PLAYER Y (Y CO-ORDINATE)
207gosub900:REM POSITION CURSOR BY CALLING SYS STATEMENT
300print"I":REM DISPLAY USER TO SCREEN
301gosub900:REM GET RANDOM NUMBER FOR INFECTED X (X CO-ORDINATE)
302X=W:REM STORES VALUE OF RANDOM NUMBER IN VARIABLE X (X CO-ORDINATE)
303gosub900:REM GET RANDOM NUMBER FOR INFECTED Y (Y CO-ORDINATE)
304Y=W:REM STORES VALUE OF RANDOM NUMBER IN VARIABLE Y (X CO-ORDINATE)
305gosub900:REM POSITION CURSOR BY CALLING SYS STATEMENT
306E=1105+Y+X*K:REM CALCULATES POSITION OF THE INFECTED PERSON
307IFPEEK(E)=32THENPRINT"O":REM DISPLAYS INFECTED PERSON O IF BLANK
400R=48:REM VARIABLE USED FOR SOUND BING IN LINE 700
401N=32:REM VARIABLE USED FOR SOUND BING IN LINE 700
402forB=-1to1:REM LOOP THROUGH COLUMNS FOR INFECTED AREA
403forC=-1to1:REM LOOP THROUGH ROWS FOR INFECTED AREA
404G=E+B+C*K:REM DETERMINE SCREEN POSITION
405F=peek(G):REM GET CHARACTER CODE FROM SCREEN
406ifF=9thenD=1:REM IF THE LETTER I, THEN GET DEATH VARIABLE TO 1
500U=54273:REM VARIABLE USED FOR SOUND BING IN LINE 700
501Q=23:REM VARIABLE USED FOR SOUND BING IN LINE 700
502M=33:REM VARIABLE USED FOR SOUND BING IN LINE 700
503X=-1:REM RESET X-POSITION FOR CURSOR BY CALLING SYS STATEMENT
504Y=-1:REM RESET Y-POSITION FOR CURSOR BY CALLING SYS STATEMENT
505ifF<33THENpokeG+54272,5:GOTO507:REM IF CHARACTER NOT A BORDER, TURN GREEN
506GOTO600:REM #ADDED FIX TO MULTIPLE IF STATEMENTS OF ONE LINE#
507ifF=32THENpokeG,102:REM IF CHARACTER BLANK (NOT I), MAKE IT HASH CHARACTER
600nextC,B:REM END LOOP THROUGH ROWS COLUMNS FOR INFECTED AREA
601ifD=1THENX=11:Y=-1:GOTO603:REM IF DEAD, SET CURSOR POSITION TO BELOW GRID
602GOTO700:REM #ADDED FIX TO MULTIPLE IF STATEMENTS OF ONE LINE#
603GOSUB900:REM POSITION CURSOR BY CALLING SYS STATEMENT
604print"{red}{reverse on}YOU GOT INFECTED! SCORE:"S"{white}":REM DISPAY END
605END:REM STOPS GAME
700S=S+1:REM ADDS ONE TO THE SCORE
701pokeU+Q,21:REM SETUP OF SID CHIP TO MAKE SOUND
702pokeU+4,9:REM SETUP OF SID CHIP TO MAKE SOUND
703pokeU+5,0:REM SETUP OF SID CHIP TO MAKE SOUND
704pokeU,R:REM SETUP OF SID CHIP TO MAKE SOUND
705pokeU+3,N:REM SETUP OF SID CHIP TO MAKE SOUND
706pokeU+3,M:REM SETUP OF SID CHIP TO MAKE SOUND
707GOSUB900:REM POSITION CURSOR BY CALLING SYS STATEMENT
708GOTO100:REM GO BACK AND DISPLAY A NEW GRID
800Z=rnd(-TI):REM USED TO SEED THE RANDOM INFECTED PERSON
801A\$="":REM CLEARS THE VARIABLE USED FOR USER INPUT
802getA\$:REM GETS VARIABLE FOR INPUT
803ifA\$=""orA\$<"0"orA\$>"9"then800:REM IF NO KEY PRESSED OR NOT 0-9 THEN WAIT
900A=val(A\$):REM CONVERTS STRING INPUT FROM USER INTO A VARIABLE
901W=int(rnd(1)*9):REM GETS RANDOM NUMBER FOR INFECTED FROM 0-9
902poke781,X+2:REM POKES CURSOR POSITION FOR X
903poke782,Y+1:REM POKES CURSOR POSITION FOR Y
904poke783,0:REM POKES CURSOR POSITION
905sys65520:REM CALLS SYS ROUTINE TO POSITION CURSOR
906return:REM RETURNS TO CALLING ROUTINE```
 Status Released Author BASIC 10Liner Genre Action Tags 8-Bit, basic, basic10liner, Commodore 64

dssctm.prg 597 bytes
dssctm.txt 6 kB

## Install instructions

Using VICE emulator

===================