Expand collection to twenty programs
This commit is contained in:
parent
6d99012279
commit
06c16f80f0
23 changed files with 361 additions and 2 deletions
12
README.md
12
README.md
|
|
@ -1,6 +1,6 @@
|
||||||
# C64 BASIC Collection
|
# C64 BASIC Collection
|
||||||
|
|
||||||
Ten small, polished programs for the Commodore 64, written entirely in stock
|
Twenty small, polished programs for the Commodore 64, written entirely in stock
|
||||||
Commodore BASIC V2. The collection mixes arcade action, puzzles, simulations,
|
Commodore BASIC V2. The collection mixes arcade action, puzzles, simulations,
|
||||||
creative tools, sound, and visual effects. No cartridge, BASIC extension, or
|
creative tools, sound, and visual effects. No cartridge, BASIC extension, or
|
||||||
machine-language payload is required.
|
machine-language payload is required.
|
||||||
|
|
@ -19,6 +19,16 @@ machine-language payload is required.
|
||||||
| [Pixel Painter](pixel-painter/pixel-painter.bas) | Creative | Cursor keys, Space, `C`, `Q` | Draw character-cell pictures on the screen. | [Run program](http://localhost:8134/program/pixel-painter) |
|
| [Pixel Painter](pixel-painter/pixel-painter.bas) | Creative | Cursor keys, Space, `C`, `Q` | Draw character-cell pictures on the screen. | [Run program](http://localhost:8134/program/pixel-painter) |
|
||||||
| [Stock Trader](stock-trader/stock-trader.bas) | Simulation | `B`, `S`, `W`, `Q` | Trade a volatile stock over twenty market days. | [Run program](http://localhost:8134/program/stock-trader) |
|
| [Stock Trader](stock-trader/stock-trader.bas) | Simulation | `B`, `S`, `W`, `Q` | Trade a volatile stock over twenty market days. | [Run program](http://localhost:8134/program/stock-trader) |
|
||||||
| [Starfield](starfield/starfield.bas) | Demo | `1`, `2`, `3`, `Q` | Watch and control a layered animated starfield. | [Run program](http://localhost:8134/program/starfield) |
|
| [Starfield](starfield/starfield.bas) | Demo | `1`, `2`, `3`, `Q` | Watch and control a layered animated starfield. | [Run program](http://localhost:8134/program/starfield) |
|
||||||
|
| [Snake Trail](snake-trail/snake-trail.bas) | Arcade | `W`, `A`, `S`, `D`, `Q` | Guide a growing snake through a field of food and danger. | [Run program](http://localhost:8134/program/snake-trail) |
|
||||||
|
| [Dice Poker](dice-poker/dice-poker.bas) | Dice | `1`-`5`, Return, `Q` | Keep your best dice and chase a winning poker combination. | [Run program](http://localhost:8134/program/dice-poker) |
|
||||||
|
| [Word Scramble](word-scramble/word-scramble.bas) | Word | `A`-`Z`, Return, `Q` | Unscramble five computer-themed words from helpful clues. | [Run program](http://localhost:8134/program/word-scramble) |
|
||||||
|
| [Nim Challenge](nim-challenge/nim-challenge.bas) | Strategy | `1`, `2`, `3`, `0` | Outthink the computer in the classic game of twenty-one sticks. | [Run program](http://localhost:8134/program/nim-challenge) |
|
||||||
|
| [Reaction Timer](reaction-timer/reaction-timer.bas) | Reflex | Any key, `Q` | Test your reactions across five unpredictable timed rounds. | [Run program](http://localhost:8134/program/reaction-timer) |
|
||||||
|
| [Morse Trainer](morse-trainer/morse-trainer.bas) | Educational | `A`-`Z`, Return, `Q` | Learn Morse letters by reading and hearing their signals. | [Run program](http://localhost:8134/program/morse-trainer) |
|
||||||
|
| [Kaleidoscope](kaleidoscope/kaleidoscope.bas) | Demo | Space, `C`, `Q` | Grow colorful symmetrical patterns across the character screen. | [Run program](http://localhost:8134/program/kaleidoscope) |
|
||||||
|
| [World Quiz](world-quiz/world-quiz.bas) | Trivia | `1`, `2`, `3`, `Q` | Take a seven-stop tour of world geography and landmarks. | [Run program](http://localhost:8134/program/world-quiz) |
|
||||||
|
| [Life Lab](life-lab/life-lab.bas) | Simulation | Space, `R`, `Q` | Observe generations of Conway's cellular automaton evolve. | [Run program](http://localhost:8134/program/life-lab) |
|
||||||
|
| [Cipher Wheel](cipher-wheel/cipher-wheel.bas) | Utility | `E`, `D`, `N`, `Q` | Encode and decode secret messages with a Caesar shift. | [Run program](http://localhost:8134/program/cipher-wheel) |
|
||||||
|
|
||||||
## Running the programs
|
## Running the programs
|
||||||
|
|
||||||
|
|
|
||||||
23
cipher-wheel/cipher-wheel.bas
Normal file
23
cipher-wheel/cipher-wheel.bas
Normal file
|
|
@ -0,0 +1,23 @@
|
||||||
|
10 PRINT CHR$(147):PRINT " CIPHER WHEEL":PRINT
|
||||||
|
20 PRINT "ENCODE OR DECODE A SECRET MESSAGE"
|
||||||
|
30 PRINT "WITH A CLASSIC CAESAR SHIFT.":PRINT
|
||||||
|
40 PRINT "PRESS ANY KEY"
|
||||||
|
50 GET A$:IF A$="" THEN 50
|
||||||
|
60 PRINT CHR$(147):PRINT "E=ENCODE D=DECODE Q=QUIT"
|
||||||
|
70 GET M$:IF M$="" THEN 70
|
||||||
|
80 IF M$="Q" THEN 230
|
||||||
|
90 IF M$<>"E" AND M$<>"D" THEN 70
|
||||||
|
100 INPUT "SHIFT (1-25)";S:IF S<1 OR S>25 THEN 100
|
||||||
|
110 IF M$="D" THEN S=-S
|
||||||
|
120 INPUT "MESSAGE";A$:B$=""
|
||||||
|
130 FOR I=1 TO LEN(A$):C=ASC(MID$(A$,I,1))
|
||||||
|
140 IF C<65 OR C>90 THEN B$=B$+CHR$(C):GOTO 170
|
||||||
|
150 C=C+S:IF C>90 THEN C=C-26
|
||||||
|
160 IF C<65 THEN C=C+26
|
||||||
|
165 B$=B$+CHR$(C)
|
||||||
|
170 NEXT:PRINT:PRINT "RESULT:":PRINT B$:PRINT
|
||||||
|
180 PRINT "N=NEW MESSAGE R=RESTART Q=QUIT"
|
||||||
|
190 GET A$:IF A$="N" THEN 120
|
||||||
|
200 IF A$="R" THEN RUN
|
||||||
|
210 IF A$<>"Q" THEN 190
|
||||||
|
230 PRINT CHR$(147):END
|
||||||
BIN
cipher-wheel/cipher-wheel.prg
Normal file
BIN
cipher-wheel/cipher-wheel.prg
Normal file
Binary file not shown.
35
dice-poker/dice-poker.bas
Normal file
35
dice-poker/dice-poker.bas
Normal file
|
|
@ -0,0 +1,35 @@
|
||||||
|
10 PRINT CHR$(147):PRINT " DICE POKER":PRINT
|
||||||
|
20 PRINT "ROLL FIVE DICE. KEEP ANY DICE TWICE."
|
||||||
|
30 PRINT "ENTER POSITIONS TO KEEP, LIKE 135.":PRINT
|
||||||
|
40 PRINT "PRESS ANY KEY"
|
||||||
|
50 GET A$:IF A$="" THEN 50
|
||||||
|
60 R=RND(-TI):DIM D(5),C(6):K$=""
|
||||||
|
70 FOR T=1 TO 3:FOR I=1 TO 5:H=0
|
||||||
|
75 FOR J=1 TO LEN(K$):IF VAL(MID$(K$,J,1))=I THEN H=1
|
||||||
|
80 NEXT:IF T=1 OR H=0 THEN D(I)=INT(RND(1)*6)+1
|
||||||
|
90 NEXT I:PRINT CHR$(147):PRINT "ROLL";T;"OF 3":PRINT
|
||||||
|
100 FOR I=1 TO 5:PRINT " [";D(I);"]";:NEXT:PRINT:PRINT
|
||||||
|
110 IF T=3 THEN 150
|
||||||
|
120 PRINT "KEEP WHICH POSITIONS? (Q QUITS)";:INPUT K$
|
||||||
|
130 IF K$="Q" THEN 270
|
||||||
|
140 NEXT
|
||||||
|
150 FOR I=1 TO 6:C(I)=0:NEXT:SM=0
|
||||||
|
160 FOR I=1 TO 5:C(D(I))=C(D(I))+1:SM=SM+D(I):NEXT
|
||||||
|
170 P=0:TR=0:F=0:FOR I=1 TO 6
|
||||||
|
180 IF C(I)=2 THEN P=P+1
|
||||||
|
190 IF C(I)=3 THEN TR=1
|
||||||
|
200 IF C(I)=4 THEN F=1
|
||||||
|
210 IF C(I)=5 THEN F=2
|
||||||
|
220 NEXT:SC=SM:N$="HIGH DICE"
|
||||||
|
230 IF P=1 THEN SC=SM+10:N$="ONE PAIR"
|
||||||
|
235 IF P=2 THEN SC=SM+25:N$="TWO PAIRS"
|
||||||
|
240 IF TR THEN SC=SM+30:N$="THREE OF A KIND"
|
||||||
|
245 IF TR AND P THEN SC=40:N$="FULL HOUSE"
|
||||||
|
250 IF F=1 THEN SC=60:N$="FOUR OF A KIND"
|
||||||
|
255 IF F=2 THEN SC=75:N$="FIVE OF A KIND"
|
||||||
|
257 ST=C(1)*C(2)*C(3)*C(4)*C(5)+C(2)*C(3)*C(4)*C(5)*C(6)
|
||||||
|
260 IF ST THEN SC=50:N$="STRAIGHT"
|
||||||
|
265 PRINT N$:PRINT "SCORE";SC:PRINT:PRINT "R=PLAY AGAIN Q=QUIT"
|
||||||
|
270 GET A$:IF A$="R" THEN RUN
|
||||||
|
280 IF A$<>"Q" THEN 270
|
||||||
|
290 PRINT CHR$(147):END
|
||||||
BIN
dice-poker/dice-poker.prg
Normal file
BIN
dice-poker/dice-poker.prg
Normal file
Binary file not shown.
19
kaleidoscope/kaleidoscope.bas
Normal file
19
kaleidoscope/kaleidoscope.bas
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
10 PRINT CHR$(147):POKE 53280,6:POKE 53281,0
|
||||||
|
20 PRINT " KALEIDOSCOPE":PRINT
|
||||||
|
30 PRINT "WATCH A SYMMETRICAL PATTERN GROW."
|
||||||
|
40 PRINT "SPACE=NEW C=COLOR Q=QUIT":PRINT
|
||||||
|
50 PRINT "PRESS ANY KEY"
|
||||||
|
60 GET A$:IF A$="" THEN 60
|
||||||
|
70 R=RND(-TI):C=1:PRINT CHR$(147)
|
||||||
|
80 FOR I=1 TO 80:X=INT(RND(1)*19)+1:Y=INT(RND(1)*11)+1
|
||||||
|
90 V=INT(RND(1)*4)+1:IF V=1 THEN Z=42
|
||||||
|
100 IF V=2 THEN Z=43
|
||||||
|
110 IF V=3 THEN Z=81
|
||||||
|
120 IF V=4 THEN Z=90
|
||||||
|
130 GOSUB 220:X=39-X:GOSUB 220:Y=23-Y:GOSUB 220:X=39-X:GOSUB 220
|
||||||
|
140 GET A$:IF A$="Q" THEN 260
|
||||||
|
150 IF A$="C" THEN C=C+1:IF C>15 THEN C=1
|
||||||
|
160 IF A$=" " THEN PRINT CHR$(147):I=80
|
||||||
|
170 NEXT:GOTO 80
|
||||||
|
220 P=1024+Y*40+X:POKE P,Z:POKE 55296+Y*40+X,C:RETURN
|
||||||
|
260 POKE 53280,14:POKE 53281,6:PRINT CHR$(147):END
|
||||||
BIN
kaleidoscope/kaleidoscope.prg
Normal file
BIN
kaleidoscope/kaleidoscope.prg
Normal file
Binary file not shown.
28
life-lab/life-lab.bas
Normal file
28
life-lab/life-lab.bas
Normal file
|
|
@ -0,0 +1,28 @@
|
||||||
|
10 PRINT CHR$(147):POKE 53280,0:POKE 53281,0
|
||||||
|
20 PRINT " LIFE LAB":PRINT
|
||||||
|
30 PRINT "WATCH CELLS LIVE, DIVIDE, AND DIE."
|
||||||
|
40 PRINT "SPACE=PAUSE R=RESEED Q=QUIT":PRINT
|
||||||
|
50 PRINT "PRESS ANY KEY"
|
||||||
|
60 GET K$:IF K$="" THEN 60
|
||||||
|
70 R=RND(-TI):DIM A(39,19),B(39,19)
|
||||||
|
80 FOR Y=0 TO 19:FOR X=0 TO 39:A(X,Y)=-(RND(1)>.72):NEXT X,Y
|
||||||
|
90 G=0
|
||||||
|
100 PRINT CHR$(147):FOR Y=0 TO 19:FOR X=0 TO 39:P=1064+Y*40+X:POKE P,32
|
||||||
|
110 IF A(X,Y) THEN POKE P,81:POKE 55336+Y*40+X,13
|
||||||
|
130 NEXT X,Y:PRINT CHR$(19);"GENERATION";G;" SPACE PAUSES"
|
||||||
|
140 GET K$:IF K$="Q" THEN 280
|
||||||
|
150 IF K$="R" THEN 80
|
||||||
|
160 IF K$=" " THEN GOSUB 250
|
||||||
|
170 FOR Y=0 TO 19:FOR X=0 TO 39:N=0
|
||||||
|
180 FOR DY=-1 TO 1:FOR DX=-1 TO 1
|
||||||
|
190 IF DX=0 AND DY=0 THEN 210
|
||||||
|
200 XX=X+DX:YY=Y+DY:IF XX>=0 AND XX<=39 AND YY>=0 AND YY<=19 THEN N=N+A(XX,YY)
|
||||||
|
210 NEXT DX,DY:B(X,Y)=0
|
||||||
|
220 IF N=3 OR A(X,Y) AND N=2 THEN B(X,Y)=1
|
||||||
|
230 NEXT X,Y:FOR Y=0 TO 19:FOR X=0 TO 39:A(X,Y)=B(X,Y):NEXT X,Y
|
||||||
|
240 G=G+1:GOTO 100
|
||||||
|
250 PRINT:PRINT "PAUSED - SPACE CONTINUES, Q QUITS"
|
||||||
|
260 GET K$:IF K$="Q" THEN 280
|
||||||
|
270 IF K$<>" " THEN 260
|
||||||
|
275 RETURN
|
||||||
|
280 POKE 53280,14:POKE 53281,6:PRINT CHR$(147):END
|
||||||
BIN
life-lab/life-lab.prg
Normal file
BIN
life-lab/life-lab.prg
Normal file
Binary file not shown.
25
morse-trainer/morse-trainer.bas
Normal file
25
morse-trainer/morse-trainer.bas
Normal file
|
|
@ -0,0 +1,25 @@
|
||||||
|
10 PRINT CHR$(147):PRINT " MORSE TRAINER":PRINT
|
||||||
|
20 PRINT "LISTEN AND READ THE MORSE CODE."
|
||||||
|
30 PRINT "GUESS TEN LETTERS. Q=QUIT.":PRINT
|
||||||
|
40 PRINT "PRESS ANY KEY"
|
||||||
|
50 GET A$:IF A$="" THEN 50
|
||||||
|
60 R=RND(-TI):DIM L$(12),M$(12)
|
||||||
|
70 FOR I=1 TO 12:READ L$(I),M$(I):NEXT:S=54272
|
||||||
|
80 FOR I=0 TO 24:POKE S+I,0:NEXT:POKE S+5,9:POKE S+6,240:POKE S+24,12
|
||||||
|
90 SC=0:FOR T=1 TO 10:N=INT(RND(1)*12)+1
|
||||||
|
100 PRINT CHR$(147):PRINT "SIGNAL";T;"OF 10":PRINT:PRINT " ";M$(N):PRINT
|
||||||
|
110 FOR I=1 TO LEN(M$(N)):C$=MID$(M$(N),I,1):D=45
|
||||||
|
120 IF C$="-" THEN D=135
|
||||||
|
130 POKE S,52:POKE S+1,17:POKE S+4,33:FOR W=1 TO D:NEXT
|
||||||
|
140 POKE S+4,32:FOR W=1 TO 45:NEXT:NEXT
|
||||||
|
150 INPUT "LETTER";A$:IF A$="Q" THEN 250
|
||||||
|
160 IF A$=L$(N) THEN PRINT "CORRECT!":SC=SC+1:GOTO 180
|
||||||
|
170 PRINT "IT WAS ";L$(N)
|
||||||
|
180 FOR W=1 TO 600:NEXT:NEXT
|
||||||
|
190 PRINT CHR$(147):PRINT "MORSE SCORE";SC;"OUT OF 10":PRINT
|
||||||
|
200 PRINT "R=TRAIN AGAIN Q=QUIT"
|
||||||
|
210 GET A$:IF A$="R" THEN RUN
|
||||||
|
220 IF A$<>"Q" THEN 210
|
||||||
|
250 FOR I=0 TO 24:POKE S+I,0:NEXT:PRINT CHR$(147):END
|
||||||
|
300 DATA A,.-,B,-...,C,-.-.,D,-..,E,.,F,..-.
|
||||||
|
310 DATA G,--.,H,....,I,..,J,.---,K,-.-,L,.-..
|
||||||
BIN
morse-trainer/morse-trainer.prg
Normal file
BIN
morse-trainer/morse-trainer.prg
Normal file
Binary file not shown.
20
nim-challenge/nim-challenge.bas
Normal file
20
nim-challenge/nim-challenge.bas
Normal file
|
|
@ -0,0 +1,20 @@
|
||||||
|
10 PRINT CHR$(147):PRINT " NIM CHALLENGE":PRINT
|
||||||
|
20 PRINT "THERE ARE 21 STICKS. TAKE 1, 2, OR 3."
|
||||||
|
30 PRINT "WHOEVER TAKES THE LAST STICK WINS.":PRINT
|
||||||
|
40 PRINT "PRESS ANY KEY"
|
||||||
|
50 GET A$:IF A$="" THEN 50
|
||||||
|
60 R=RND(-TI):N=21:PRINT CHR$(147)
|
||||||
|
70 PRINT "STICKS LEFT:";N:PRINT
|
||||||
|
80 FOR I=1 TO N:PRINT "|";:NEXT:PRINT:PRINT
|
||||||
|
90 INPUT "TAKE 1-3 (0 QUITS)";P
|
||||||
|
100 IF P=0 THEN 230
|
||||||
|
110 IF P<1 OR P>3 OR P>N THEN PRINT "CHOOSE 1, 2, OR 3.":GOTO 90
|
||||||
|
120 N=N-P:IF N=0 THEN PRINT "YOU TOOK THE LAST STICK!":GOTO 210
|
||||||
|
130 C=INT(RND(1)*3)+1:IF C>N THEN C=N
|
||||||
|
150 PRINT "THE COMPUTER TAKES";C:FOR D=1 TO 700:NEXT
|
||||||
|
160 N=N-C:IF N=0 THEN PRINT "THE COMPUTER WINS.":GOTO 210
|
||||||
|
170 PRINT CHR$(147):GOTO 70
|
||||||
|
210 PRINT:PRINT "R=PLAY AGAIN Q=QUIT"
|
||||||
|
230 GET A$:IF A$="R" THEN RUN
|
||||||
|
240 IF A$<>"Q" THEN 230
|
||||||
|
250 PRINT CHR$(147):END
|
||||||
BIN
nim-challenge/nim-challenge.prg
Normal file
BIN
nim-challenge/nim-challenge.prg
Normal file
Binary file not shown.
|
|
@ -68,6 +68,76 @@
|
||||||
"description": "Watch and control a layered animated starfield.",
|
"description": "Watch and control a layered animated starfield.",
|
||||||
"controls": ["1", "2", "3", "Q"],
|
"controls": ["1", "2", "3", "Q"],
|
||||||
"path": "starfield/starfield.prg"
|
"path": "starfield/starfield.prg"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "Snake Trail",
|
||||||
|
"type": "Arcade",
|
||||||
|
"description": "Guide a growing snake through a field of food and danger.",
|
||||||
|
"controls": ["W", "A", "S", "D", "Q"],
|
||||||
|
"path": "snake-trail/snake-trail.prg"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "Dice Poker",
|
||||||
|
"type": "Dice",
|
||||||
|
"description": "Keep your best dice and chase a winning poker combination.",
|
||||||
|
"controls": ["1-5", "RETURN", "Q"],
|
||||||
|
"path": "dice-poker/dice-poker.prg"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "Word Scramble",
|
||||||
|
"type": "Word",
|
||||||
|
"description": "Unscramble five computer-themed words from helpful clues.",
|
||||||
|
"controls": ["A-Z", "RETURN", "Q"],
|
||||||
|
"path": "word-scramble/word-scramble.prg"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "Nim Challenge",
|
||||||
|
"type": "Strategy",
|
||||||
|
"description": "Outthink the computer in the classic game of twenty-one sticks.",
|
||||||
|
"controls": ["1", "2", "3", "0"],
|
||||||
|
"path": "nim-challenge/nim-challenge.prg"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "Reaction Timer",
|
||||||
|
"type": "Reflex",
|
||||||
|
"description": "Test your reactions across five unpredictable timed rounds.",
|
||||||
|
"controls": ["ANY KEY", "Q"],
|
||||||
|
"path": "reaction-timer/reaction-timer.prg"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "Morse Trainer",
|
||||||
|
"type": "Educational",
|
||||||
|
"description": "Learn Morse letters by reading and hearing their signals.",
|
||||||
|
"controls": ["A-Z", "RETURN", "Q"],
|
||||||
|
"path": "morse-trainer/morse-trainer.prg"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "Kaleidoscope",
|
||||||
|
"type": "Demo",
|
||||||
|
"description": "Grow colorful symmetrical patterns across the character screen.",
|
||||||
|
"controls": ["SPACE", "C", "Q"],
|
||||||
|
"path": "kaleidoscope/kaleidoscope.prg"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "World Quiz",
|
||||||
|
"type": "Trivia",
|
||||||
|
"description": "Take a seven-stop tour of world geography and landmarks.",
|
||||||
|
"controls": ["1", "2", "3", "Q"],
|
||||||
|
"path": "world-quiz/world-quiz.prg"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "Life Lab",
|
||||||
|
"type": "Simulation",
|
||||||
|
"description": "Observe generations of Conway's cellular automaton evolve.",
|
||||||
|
"controls": ["SPACE", "R", "Q"],
|
||||||
|
"path": "life-lab/life-lab.prg"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "Cipher Wheel",
|
||||||
|
"type": "Utility",
|
||||||
|
"description": "Encode and decode secret messages with a Caesar shift.",
|
||||||
|
"controls": ["E", "D", "N", "Q"],
|
||||||
|
"path": "cipher-wheel/cipher-wheel.prg"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,13 @@ const typeIcons = {
|
||||||
Puzzle: '⌘',
|
Puzzle: '⌘',
|
||||||
Music: '♪',
|
Music: '♪',
|
||||||
Creative: '✎',
|
Creative: '✎',
|
||||||
Demo: '✦'
|
Demo: '✦',
|
||||||
|
Dice: '⚄',
|
||||||
|
Word: 'Aa',
|
||||||
|
Reflex: '⚡',
|
||||||
|
Educational: '⌁',
|
||||||
|
Trivia: '?',
|
||||||
|
Utility: '⚒'
|
||||||
};
|
};
|
||||||
|
|
||||||
function renderPrograms() {
|
function renderPrograms() {
|
||||||
|
|
|
||||||
24
reaction-timer/reaction-timer.bas
Normal file
24
reaction-timer/reaction-timer.bas
Normal file
|
|
@ -0,0 +1,24 @@
|
||||||
|
10 PRINT CHR$(147):PRINT " REACTION TIMER":PRINT
|
||||||
|
20 PRINT "WAIT FOR NOW! THEN PRESS ANY KEY."
|
||||||
|
30 PRINT "PRESSING EARLY COSTS THE ROUND.":PRINT
|
||||||
|
40 PRINT "PRESS ANY KEY TO BEGIN"
|
||||||
|
50 GET A$:IF A$="" THEN 50
|
||||||
|
60 R=RND(-TI):S=0:FOR T=1 TO 5
|
||||||
|
70 PRINT CHR$(147):PRINT "ROUND";T;"OF 5":PRINT:PRINT "GET READY..."
|
||||||
|
80 W=INT(RND(1)*180)+120:FOR D=1 TO W
|
||||||
|
90 GET A$:IF A$<>"" THEN PRINT "TOO SOON!":RT=300:GOTO 140
|
||||||
|
100 NEXT:PRINT CHR$(147):PRINT:PRINT:PRINT " NOW!"
|
||||||
|
110 T0=TI
|
||||||
|
120 GET A$:IF A$="Q" THEN 210
|
||||||
|
130 IF A$="" THEN 120
|
||||||
|
135 RT=TI-T0:IF RT<0 THEN RT=RT+5184000
|
||||||
|
140 PRINT:PRINT "TIME:";INT(RT*100/60)/100;"SECONDS"
|
||||||
|
150 S=S+RT:FOR D=1 TO 700:NEXT:NEXT
|
||||||
|
160 AV=INT(S*100/300)/100:PRINT CHR$(147):PRINT "AVERAGE:";AV;"SECONDS":PRINT
|
||||||
|
170 IF AV<.3 THEN PRINT "LIGHTNING FAST!"
|
||||||
|
180 IF AV>=.3 AND AV<.6 THEN PRINT "SHARP REACTIONS!"
|
||||||
|
190 IF AV>=.6 THEN PRINT "KEEP PRACTICING!"
|
||||||
|
200 PRINT:PRINT "R=TRY AGAIN Q=QUIT"
|
||||||
|
210 GET A$:IF A$="R" THEN RUN
|
||||||
|
220 IF A$<>"Q" THEN 210
|
||||||
|
230 PRINT CHR$(147):END
|
||||||
BIN
reaction-timer/reaction-timer.prg
Normal file
BIN
reaction-timer/reaction-timer.prg
Normal file
Binary file not shown.
34
snake-trail/snake-trail.bas
Normal file
34
snake-trail/snake-trail.bas
Normal file
|
|
@ -0,0 +1,34 @@
|
||||||
|
10 PRINT CHR$(147):POKE 53280,5:POKE 53281,0
|
||||||
|
20 PRINT " SNAKE TRAIL":PRINT
|
||||||
|
30 PRINT "EAT THE DOTS. AVOID WALLS AND YOUR TAIL."
|
||||||
|
40 PRINT "W A S D=MOVE Q=QUIT":PRINT:PRINT "PRESS ANY KEY"
|
||||||
|
50 GET A$:IF A$="" THEN 50
|
||||||
|
60 R=RND(-TI):DIM X(900),Y(900):L=4:DX=1:DY=0:S=0
|
||||||
|
70 FOR I=1 TO L:X(I)=21-I:Y(I)=12:NEXT:GOSUB 240
|
||||||
|
80 PRINT CHR$(147):FOR I=0 TO 39:POKE 1024+I,160:POKE 1984+I,160:NEXT
|
||||||
|
90 FOR I=1 TO 23:POKE 1024+I*40,160:POKE 1063+I*40,160:NEXT
|
||||||
|
100 FOR I=1 TO L:POKE 1024+Y(I)*40+X(I),81:NEXT:GOSUB 250
|
||||||
|
110 GET A$:IF A$="Q" THEN 330
|
||||||
|
120 IF A$="W" AND DY=0 THEN DX=0:DY=-1
|
||||||
|
130 IF A$="S" AND DY=0 THEN DX=0:DY=1
|
||||||
|
140 IF A$="A" AND DX=0 THEN DX=-1:DY=0
|
||||||
|
150 IF A$="D" AND DX=0 THEN DX=1:DY=0
|
||||||
|
160 NX=X(1)+DX:NY=Y(1)+DY:IF NX<1 OR NX>38 OR NY<1 OR NY>23 THEN 300
|
||||||
|
170 FOR I=1 TO L:IF NX=X(I) AND NY=Y(I) THEN 300
|
||||||
|
180 NEXT:E=0:IF NX=FX AND NY=FY THEN E=1
|
||||||
|
190 IF E=0 THEN POKE 1024+Y(L)*40+X(L),32
|
||||||
|
200 IF E THEN L=L+1:S=S+10
|
||||||
|
210 FOR I=L TO 2 STEP -1:X(I)=X(I-1):Y(I)=Y(I-1):NEXT
|
||||||
|
220 X(1)=NX:Y(1)=NY:POKE 1024+NY*40+NX,81
|
||||||
|
230 IF E THEN GOSUB 240:GOSUB 250
|
||||||
|
235 PRINT CHR$(19);" SCORE";S;" LENGTH";L;" ":FOR D=1 TO 45:NEXT:GOTO 110
|
||||||
|
240 FX=INT(RND(1)*38)+1:FY=INT(RND(1)*23)+1:F=0
|
||||||
|
245 FOR J=1 TO L:IF FX=X(J) AND FY=Y(J) THEN F=1
|
||||||
|
247 NEXT:IF F THEN 240
|
||||||
|
248 RETURN
|
||||||
|
250 POKE 1024+FY*40+FX,46:POKE 55296+FY*40+FX,7:RETURN
|
||||||
|
300 PRINT CHR$(147):PRINT "SNAKE CRASHED! SCORE";S:PRINT
|
||||||
|
310 PRINT "R=REPLAY Q=QUIT"
|
||||||
|
320 GET A$:IF A$="R" THEN RUN
|
||||||
|
325 IF A$<>"Q" THEN 320
|
||||||
|
330 POKE 53280,14:POKE 53281,6:PRINT CHR$(147):END
|
||||||
BIN
snake-trail/snake-trail.prg
Normal file
BIN
snake-trail/snake-trail.prg
Normal file
Binary file not shown.
30
word-scramble/word-scramble.bas
Normal file
30
word-scramble/word-scramble.bas
Normal file
|
|
@ -0,0 +1,30 @@
|
||||||
|
10 PRINT CHR$(147):PRINT " WORD SCRAMBLE":PRINT
|
||||||
|
20 PRINT "UNSCRAMBLE FIVE C64 WORDS.":PRINT "TYPE Q TO QUIT.":PRINT
|
||||||
|
30 PRINT "PRESS ANY KEY"
|
||||||
|
40 GET A$:IF A$="" THEN 40
|
||||||
|
50 R=RND(-TI):DIM W$(12),H$(12),U(12),P(20)
|
||||||
|
60 FOR I=1 TO 12:READ W$(I),H$(I):NEXT:S=0
|
||||||
|
70 FOR T=1 TO 5
|
||||||
|
80 N=INT(RND(1)*12)+1
|
||||||
|
85 IF U(N) THEN 80
|
||||||
|
90 U(N)=1:L=LEN(W$(N)):FOR I=1 TO L:P(I)=I:NEXT
|
||||||
|
100 FOR I=1 TO L:J=INT(RND(1)*L)+1:X=P(I):P(I)=P(J):P(J)=X:NEXT
|
||||||
|
110 A$="":FOR I=1 TO L:A$=A$+MID$(W$(N),P(I),1):NEXT
|
||||||
|
120 IF A$=W$(N) THEN 100
|
||||||
|
130 PRINT CHR$(147):PRINT "WORD";T;"OF 5":PRINT:PRINT " ";A$:PRINT
|
||||||
|
140 PRINT "HINT: ";H$(N):PRINT:INPUT "YOUR ANSWER";G$
|
||||||
|
150 IF G$="Q" THEN 230
|
||||||
|
160 IF G$=W$(N) THEN PRINT "CORRECT!":S=S+1:GOTO 190
|
||||||
|
170 PRINT "THE WORD WAS ";W$(N)
|
||||||
|
190 FOR D=1 TO 700:NEXT:NEXT
|
||||||
|
200 PRINT CHR$(147):PRINT "FINAL SCORE";S;"OUT OF 5":PRINT
|
||||||
|
210 PRINT "R=PLAY AGAIN Q=QUIT"
|
||||||
|
230 GET A$:IF A$="R" THEN RUN
|
||||||
|
240 IF A$<>"Q" THEN 230
|
||||||
|
250 PRINT CHR$(147):END
|
||||||
|
300 DATA COMMODORE,THE COMPANY,JOYSTICK,GAME CONTROLLER
|
||||||
|
310 DATA SPRITE,MOVING GRAPHIC,CASSETTE,TAPE STORAGE
|
||||||
|
320 DATA FLOPPY,DISK TYPE,KEYBOARD,TYPING DEVICE
|
||||||
|
330 DATA MONITOR,VIDEO DISPLAY,PROGRAM,LIST OF COMMANDS
|
||||||
|
340 DATA MEMORY,COMPUTER STORAGE,CURSOR,SCREEN MARKER
|
||||||
|
350 DATA MODEM,PHONE CONNECTION,PIXEL,TINY PICTURE DOT
|
||||||
BIN
word-scramble/word-scramble.prg
Normal file
BIN
word-scramble/word-scramble.prg
Normal file
Binary file not shown.
35
world-quiz/world-quiz.bas
Normal file
35
world-quiz/world-quiz.bas
Normal file
|
|
@ -0,0 +1,35 @@
|
||||||
|
10 PRINT CHR$(147):PRINT " WORLD QUIZ":PRINT
|
||||||
|
20 PRINT "ANSWER SEVEN QUESTIONS ABOUT OUR WORLD."
|
||||||
|
30 PRINT "PRESS 1, 2, OR 3. Q=QUIT.":PRINT
|
||||||
|
40 PRINT "PRESS ANY KEY"
|
||||||
|
50 GET A$:IF A$="" THEN 50
|
||||||
|
60 R=RND(-TI):DIM Q$(10),A$(10),B$(10),C$(10),K(10),U(10)
|
||||||
|
70 FOR I=1 TO 10:READ Q$(I),A$(I),B$(I),C$(I),K(I):NEXT:S=0
|
||||||
|
80 FOR T=1 TO 7
|
||||||
|
85 N=INT(RND(1)*10)+1:IF U(N) THEN 85
|
||||||
|
90 U(N)=1:PRINT CHR$(147):PRINT "QUESTION";T;"OF 7":PRINT
|
||||||
|
100 PRINT Q$(N):PRINT:PRINT "1. ";A$(N):PRINT "2. ";B$(N):PRINT "3. ";C$(N)
|
||||||
|
110 GET X$:IF X$="" THEN 110
|
||||||
|
120 IF X$="Q" THEN 230
|
||||||
|
130 IF VAL(X$)<1 OR VAL(X$)>3 THEN 110
|
||||||
|
140 IF VAL(X$)=K(N) THEN PRINT:PRINT "CORRECT!":S=S+1:GOTO 160
|
||||||
|
150 PRINT:PRINT "NOT THIS TIME. ANSWER";K(N)
|
||||||
|
160 FOR D=1 TO 700:NEXT:NEXT
|
||||||
|
170 PRINT CHR$(147):PRINT "FINAL SCORE";S;"OUT OF 7":PRINT
|
||||||
|
180 IF S=7 THEN PRINT "PERFECT WORLD TOUR!"
|
||||||
|
190 IF S>=4 AND S<7 THEN PRINT "SEASONED TRAVELLER!"
|
||||||
|
200 IF S<4 THEN PRINT "ANOTHER JOURNEY AWAITS."
|
||||||
|
210 PRINT:PRINT "R=PLAY AGAIN Q=QUIT"
|
||||||
|
230 GET X$:IF X$="R" THEN RUN
|
||||||
|
240 IF X$<>"Q" THEN 230
|
||||||
|
250 PRINT CHR$(147):END
|
||||||
|
300 DATA WHICH OCEAN IS LARGEST?,ATLANTIC,PACIFIC,INDIAN,2
|
||||||
|
310 DATA CAPITAL OF CANADA?,TORONTO,VANCOUVER,OTTAWA,3
|
||||||
|
320 DATA THE NILE FLOWS THROUGH?,EGYPT,SPAIN,INDIA,1
|
||||||
|
330 DATA MOUNT FUJI IS IN?,CHINA,JAPAN,NEPAL,2
|
||||||
|
340 DATA BRAZIL SPEAKS MAINLY?,SPANISH,PORTUGUESE,FRENCH,2
|
||||||
|
350 DATA SAHARA IS A?,RIVER,FOREST,DESERT,3
|
||||||
|
360 DATA CAPITAL OF DENMARK?,AARHUS,ODENSE,COPENHAGEN,3
|
||||||
|
370 DATA MACHU PICCHU IS IN?,PERU,MEXICO,CHILE,1
|
||||||
|
380 DATA THE ALPS ARE IN?,EUROPE,AFRICA,ASIA,1
|
||||||
|
390 DATA NEW ZEALAND LIES IN?,PACIFIC,ARCTIC,ATLANTIC,1
|
||||||
BIN
world-quiz/world-quiz.prg
Normal file
BIN
world-quiz/world-quiz.prg
Normal file
Binary file not shown.
Loading…
Add table
Reference in a new issue