How to playRun a successful gold mine
You're a gold miner. Ride the elevator down, dig at the dots, and carry your gold back up to the bank. Watch out for cave-ins, which can cost you all your gold, and underground springs that flood your tunnels. Every move costs money, and so do the tools. Reach $10,000 and you win. Go broke and you lose.
At the start, press 6 to step into the elevator, then 2 to ride it down. It keeps going until you press a key. Walk out at a level with a side tunnel and start digging. The drill, the pump and the explosives work in the direction you last moved. To sell your gold, ride to the top and walk left to the bank.
The PET had no auto-repeat, so hold a key and it types once. Esc is RUN/STOP. When the game ends, type RUN and press Return to play again.
1980 and 1981The game that started mine
In 1981 I went to the Canada-Wide Science Fair in Waterloo, Ontario. It was the first time I'd seen computers, and someone there had a Commodore PET running this game. I couldn't leave it alone. A few months later I had my own Atari 800, and one of the first things I wrote was my own Miner.
For forty-five years I believed I'd written mine from memory. In 2026, fact-checking this website, I found Ron's program in the CURSOR archive and compared the two line by line. Parts of mine match his far too closely for memory, so I must have had at least part of his listing to work from, probably lines copied down at the fair. I never had a PET or his tape. The rest of my version is my own.
| Ron's PET program, 1980 | My Atari program, 1981 |
|---|---|
| 311 M$(1)="FUSE WENT OUT" | 311 M1$="FUSE WENT OUT" |
| 331 M$(11)="SOLID GRANITE - PICKAXE WON'T DO" | 331 M11$="SOLID GRANITE - PICKAXE WON'T DO." |
| 490 FORI=1TO2:PRINTX2$;:PRINTX2$;:PRINTX2$;:PRINTX1$;:PRINTX1$;:PRINTX1$;:NEXT | 490 FOR I=1 TO 2:? X2$;X2$;X2$;X1$;X1$;X1$;:NEXT I |
| A PETTA / MINE sign | An ATARI / MINE sign |
| PLAY AGAIN? | DO YOU CARE TO TRY AGAIN, then I GUESS YOU WOULDN'T MAKE A GOOD PROSPECTOR!! |
Thank you, Ron. This page is here on your behalf, so people can play the original that started mine.
SourcesWhere the original lives
MINER! appeared in issue 19 of CURSOR, a magazine for the PET that came on cassette, published by The Code Works in Goleta, California. The program says "Copyright (C) 1980 Ron Longfellow", and its title-screen lines (61000 to 65000) are "(C) 1980 CURSOR Magazine". The CURSOR archive at tierceron.com keeps the issues and their programs, and Ron has told his own story in an interview:
- CURSOR #19 in the archive: the issue's programs, with a screenshot and a description of MINER!
- miner.prg: Ron's program, the file this page runs
- Notes for CURSOR 19 (PDF): the two-page notes that came with the tape, including Ron's instructions
- tierceron.com's guide to CURSOR
- An interview with Ron Longfellow at commodoregames.net: how he came to write MINER! (partly inspired by hiking and backpacking in California's gold-rush foothills), why it was his only published program, and the PET he still owns
About this pageHow it runs
The page runs Ron's original program byte for byte, from the tokenized file in the archive. A small emulator built for this page interprets it the way Commodore BASIC 2 does, with the PET's 40 by 25 screen, its graphics characters, its screen editor and its keyboard buffer. The character shapes were drawn by hand to match the PET's.
The ! at the end of MINER! meant something. The first PETs had no speaker, and the CURSOR notes say "Program names ending with '!' use CB2 sound": owners wired a small amplifier to the user port and programs played tones through the 6522 chip's shift register. This page plays those tones the same way, as narrow pulses set by the timer value Ron's program POKEs into address 59464.
PET 2001s came with green or white screens, so the Screen button switches between them. Nobody remembers exactly how fast BASIC ran, so Speed lets you slow it down.
The programRon's listing
Show the listing
0 CLR:POKE59468,12 1 REM PROGRAM COPYRIGHT (C) 1980 RON LONGFELLOW 2 REM 103 ESPLANADE #35 3 REM PACIFICA CA 94044 4 : 5 REM CURSOR #19 APR 80 6 REM BOX 550, GOLETA, CA. 93017 7 REM LINES 61000-65000 (C) 1980 CURSOR MAGAZINE 8 : 10 REM AS OF APR 28 80 90 PG$="MINER!":NM$="19":GOSUB62000 100 : 110 DEFFNR(X)=INT(RND(TI)*X)+1 280 DM=40:ES=125:TC=1:CRT=32768:LM=CRT+190:LE=CRT+112:M=42 290 DIME(15),ES(15),M$(17):S=59464 310 M$(0)="{18} {145}" 311 M$(1)="{18}FUSE WENT OUT{145}" 312 M$(2)="{18}STAND CLEAR - DANGEROUS EXPLOSION!!{145}" 313 M$(3)="{18}UNDERGROUND SPRING - FLOODING!{145}" 320 M$(4)="{18}ONE MOMENT PLEASE{145}" 330 M$(5)="{18}YOU MAY BEGIN MINING{145}" 331 M$(11)="{18}SOLID GRANITE - PICKAXE WON'T DO{145}" 332 M$(12)="{18}UNSTABLE FOOTING - WATCH OUT!{145}" 333 M$(13)="{18}SANDSTONE--EASY DIGGING!{145}" 340 FORI=1TO15:READ E(I):NEXT 350 DATA 45,93,45,231,160,229,244,218,231,231,160,229,45,45,45 360 FORI=1TO15:READ ES(I):NEXT 370 DATA 0,1,2,42,41,40,80,81,82,122,121,120,160,161,162 380 T(1,1)=31:T(1,2)=30:T(2,1)=61:T(2,2)=60:T(3,1)=61:T(3,2)=94 400 PRINT"{147}"TAB(15)"{18} BANK {146}"TAB(33)"{18}{221} {146}" 410 PRINTTAB(15)"{171}{214}{214}{214}{214}{179}"TAB(33)"{221} {182}{214}{165}" 420 PRINT"{18} PETTA {146}";TAB(13)"{18}{169}{146}{163}{163}{163}{163}{163}{163}{163}{208}"TAB(33)"{221} {182}{214}{165}" 430 PRINT"{18} MINE {146}";TAB(13)"{18} {146}{223}{18} {223}{146}"TAB(32)"{18}{207} {208}{146}{182}{214}{165} 440 PRINT" {182} {160}{182}"TAB(13)"{18} {146} {167}"TAB(32)"{18}{180}{218} {146}{182}{214}{165}" 450 PRINT"{146}{166}{166}{166}{166}{166}{166}{166}{166}{166}{166}{166}{166}{166}{166}{166}{166}{166}{166}{166}{166}{166}{166}{166}{166}{166}{166}{166}{166}{166}{166}{166}{166}{18}{204}{164}{186} {146}{166}{166}{166}{166}"; 460 X1$="{146}{166}{18} {146}---{18} {146}{166}{166}{166}{166}" 470 X2$="{146}{166}{18} {146} ---{18} {146}{166}{166}{166}{166}" 480 PRINTX1$; 490 FORI=1TO2:PRINTX2$;:PRINTX2$;:PRINTX2$;:PRINTX1$;:PRINTX1$;:PRINTX1$;:NEXT 500 FORI=1TO3:PRINTX2$;:NEXT:PRINTX1$;:PRINTX1$; 510 PRINT"{146}{166}{166}{166}{166}{166}{166}{166}{166}{166}{166}{166}{166}{166}{166}{166}{166}{166}{166}{166}{166}{166}{166}{166}{166}{166}{166}{166}{166}{166}{166}{166}{166}{166}{166}{166}{166}{166}{166}{166}{19}":POKECRT+999,102 520 GOSUB1540:M1$="MINER{17}{157}{157}{221}{17}{157}V":M2$=" {17}{157}{157} {17}{157} " 530 PRINT"{19}{17}"TAB(27)M1$:POKES,20:POKELM,M:POKES,0:MS=5:GOSUB1530 542 GETZ$:IFZ$=""THEN542 544 POKES+3,16:POKES+2,16:POKES,0 550 POKELM,32:LM=LM+1:POKES,20:POKELM,M:POKES,0 560 PRINT"{19}{17}"TAB(27)M2$:MS=0:GOSUB1530:GOTO580 570 IFZ$=""THENGETZ$:GOTO570 573 ZZ$=Z$:Z$="" 580 OLM=LM:REMNP=LM+DM:NS=PEEK(NP):GOSUB1610 590 IFZZ$="2"THENDM=40:GOTO710 600 IFZZ$="8"THENDM=-40:GOTO710 610 IFZZ$="4"THENDM=-1:GOTO720 620 IFZZ$="6"THENDM=1:GOTO720 660 IFZZ$="D"THENTC=2:Z$=OZ$:GOTO970 670 IFZZ$="P"THENTC=3:Z$=OZ$:GOTO970 680 IFZZ$="E"THENTC=4:Z$="":GOTO970 684 IFZZ$="Q"THEN2000 690 GOTO570 710 IFLM=LE+80THEN870 720 NP=LM+DM:NS=PEEK(NP) 725 IFNP<CRT+160THEN570 726 IFNP>=CRT+920THEN570 730 MS=0:GOSUB1530 740 GOSUB1340:GOSUB1610:NS=PEEK(NP) 748 IFNS=160THENTC=1:GOTO970 750 IFNS=0ORNS=218ORNS=174ORNS=220ORNS=102ORNS=229ORNS=231ORNS=45THEN570 770 IFNP=CRT+190ANDDM=-1THENGOSUB1900:GOTO570 780 IFNS=135THENGOSUB830:GOTO570 790 IFNS=95THENPOKELM,32:LM=LM+40:POKELM,M:SD=2*FNR(10):GOTO570 800 IFNS=255THENGOSUB1810:GOTO570 810 IFNS=147THENH(F)=160:GOSUB1770:GOSUB1610:GOTO570 820 LM=NP:POKES,20:POKELM,M:POKEOLM,32:POKES,0:GOSUB1610:GOTO570 830 H(F)=160:GN=FNR(3):GA=GA+GN 840 M$(7)="{18}FOUND GOLD NUGGET -"+STR$(GN)+" OZ{145}{145}{145}":MS=7 850 GOSUB1750:FORI=1TO10:POKES,10+2*I:NEXT 860 LM=NP:POKELM,M:POKEOLM,32:POKES,0:RETURN 870 : 876 Z$="5":IFDM>-2ANDDM<2THEN720 880 IFLM<>LE+80THEN570 890 IFLE<CRT+82THENLE=LE-DM:LM=LM-DM:POKES,0:GOSUB1900:GOTO570 900 IFLE>CRT+782THENLE=LE-DM:LM=LM-DM:POKES,0:GOTO570 910 E(1)=32:E(3)=32:IFDM=40THENES=ES+5:FORI=1TO15 920 IFDM=-40THENES=ES-5:FORI=15TO1STEP-1 930 IFLE>CRT+200THENE(1)=45:E(3)=45 940 POKELE+ES(I),E(I):NEXT:POKES,ES:SC=SC-6 950 GETA$:IFA$=""THENLE=LE+DM:LM=LE+80:GOTO870 960 POKES,0:GOTO570 970 TP=DM:NS=PEEK(NP):IFNS=42THENNP=NP+DM:NS=PEEK(NP) 980 IFNS<>0ANDNS<>32ANDNS<>160ANDNS<>174ANDNS<>220ANDNS<>255THEN570 985 IFNS=32ANDTC<>4THEN570 990 IF(NS=220ORNS=255)ANDTC=1THEN570 1000 IFNS=0AND(TC<>3)THEN570 1010 IFNS<>0ANDTC=3THEN570 1020 IFTC=4THENGOSUB1210:GOTO570 1070 IFTC=1ANDNS>180ANDNS<186THEN570 1080 FORI=1TO10:POKE LM+TP,T(TC,1) 1090 ON TC GOSUB1150,1170,1180 1100 POKE LM+TP,T(TC,2):FORW=1TO20:NEXTW:NEXTI 1110 IFTC=1THENSD=5 1120 IFTC=2THENSD=35 1130 IFTC=3THENSD=25 1140 GOSUB860:NP=LM+DM:NS=PEEK(NP):GOSUB1340:GOTO570 1150 : 1160 POKES,70:POKES,0:FORW=1TO100:NEXT:RETURN 1170 POKES,20:POKES,0:RETURN 1180 POKES,50:FORW=1TO20:NEXT:POKES,0:RETURN 1210 MS=0:GOSUB1530 1215 POKELM-1,33:MS=2:GOSUB1750:EL=LM-1 1220 FORI=1TO4:IFPEEK(LM+1)=32THENOLM=LM:LM=LM+1:POKELM,M:POKEOLM,32 1230 NEXT 1240 IFFNR(4)=1THENMS=1:POKELM,M:GOSUB1530:POKEEL,32:SD=25:RETURN 1250 FORI=1TO30:POKES,25:POKEEL,161:FORW=1TO20:NEXT 1260 POKES,0:POKEEL,86:NEXT:POKEEL,32 1270 FORI=1TO50:POKES,10+I:NEXT 1280 POKES,250:POKELM-5,32 1290 FORJ=-2TO2 :POKES,0 1300 FORI=1TO4:EA=LM+(J*40)-FNR(4)-I 1310 IFPEEK(EA)=160ORPEEK(EA)=255THENPOKEEA,214:POKES,250:POKEEA,32:POKES,0 1320 NEXTI:NEXTJ 1330 POKELM-4,32:SD=80:RETURN 1340 M$(15)="{18}YOU'VE GONE BROKE - YOU LOSE!!{145}" 1350 C=0:PT=FNR(40)-20 1390 IFGP>1000THENPT=-ABS(PT) 1400 IFGP<200THENPT=ABS(PT) 1410 M$(16)="{18}YOU WIN! CONGRATULATIONS!!{145}" 1420 IFSC<=0THENMS=15 1430 IFSC>=10000THENMS=16 1440 SC=SC-SD:SD=0:GP=GP+PT 1450 IFC=0THENSC$="{18} ":GP$=SC$+" " 1460 IFC=0ANDMS=16THEN1520 1470 PRINT"{19}{17}{17}{17}{18}$";GP$;"{146}" 1480 PRINT"{19}{17}{17}{17}{29}{29}{29}{29}{29}{29}{29}{29}{29}{29}{29}{29}{29}{29}{29}{18}$";SC$;"{146}" 1490 IFMS=15ORMS=16THEN:GOSUB1530:FORW=1TO500:POKES,W/2:NEXT:POKES,0:GOTO2000 1500 IFMS=17THENPOKES,50:GOSUB1530:FORW=1TO9999:NEXT:POKES,0:GOTO2000 1510 IFC=1THENC=0:RETURN 1520 SC$=STR$(SC):GP$=STR$(GP)+" OZ":C=1:GOTO1470 1530 PRINT"{19}{17}{17}{17}{17}{17}{17}{17}{17}{17}{17}{17}{17}{17}{17}{17}{17}{17}{17}{17}{17}{17}{17}{17}{29}";M$(MS):RETURN 1540 MS=4:GOSUB1530 1550 TG=8+FNR(10) 1560 C=1:FORI=1TO250 1570 HL=CRT+200+FNR(27)+(40*FNR(17)) 1580 POKEHL,174:NEXT 1590 PRINT"{19}{17}{17}{18}GOLD PRICE{146}":PRINT"{18} {146}" 1600 GP=600:SC=1000:GOSUB1340:RETURN 1610 : 1620 IFNS<>174THEN RETURN 1630 RH=FNR(15)-1 1640 H=32:MS=13 1650 IFRH=3THENH=147 1660 IFRH=4THENH=255 1670 IFNP<CRT+880THENIFRH=6ORRH=7THENH=95:MS=12 1680 IFRH=8ORRH=9THENH=135:GC=GC+1 1690 IFRH>9THENH=220:MS=11 1710 POKENP,H 1750 GOSUB1530:FORW=1TO999:NEXT:RETURN 1770 J=O:MS=3:GOSUB1530 1780 FORI=NP-6TOCRT+959 1790 IFPEEK(I)=32THENPOKEI,0:J=0:POKES,35 1794 J=J+1:IFJ>40THENRETURN 1800 POKES,0:NEXT:SD=100:GOSUB1340:POKES,0:RETURN 1810 M$(8)="{18}CAVE-IN! {145}" 1830 IFFNR(4)=3ANDGA>0THENM$(8)="{18}CAVE-IN! LOST YOUR GOLD{145}":GA=0 1840 FORJ=-1TO1:R=FNR(3)+40*J:POKES,200+10+J 1850 FORI=-2TO2:Z=LM-I+R:IFPEEK(Z)=32ORPEEK(Z)=0ORPEEK(Z)=174THENPOKEZ,160 1855 NEXTI:POKES,0:NEXTJ 1860 POKELM,M:MS=8:GOSUB1750:SD=INT(FNR(50)*SC/100):GOSUB1340:RETURN 1900 GOSUB1930:GOSUB1950:VG=0:VG=GP*GA 1910 M$(6)="{18}"+STR$(GA)+" OZ. GOLD WORTH $"+STR$(VG)+"{145}":MS=6:GOSUB1530 1920 SC=SC+VG:GA=0:GOSUB1340:GOSUB1970:RETURN 1930 FORI=CRT+183TOLM:POKELM,32:POKES,20:LM=LM-1:POKELM,M:POKES,0 1940 FORW=1TO50:NEXTW:NEXTI:RETURN 1950 FORI=1TO20:FORJ=1TO4:POKELM-1-J,164 1960 POKES,FNR(10)+10:POKELM-1-J,32:NEXTJ:NEXTI:POKES,0:RETURN 1970 FORI=1TO10:POKELM,32:POKES,20:LM=LM+1:POKELM,M:POKES,0 1980 FORW=1TO50:NEXTW:NEXTI 1990 Z$="6":RETURN 2000 GETZ$:IFZ$<>""THEN2010 2010 POKES+2,0:POKES+3,0:PRINT"{147}{17}{17}{17}PLAY AGAIN? "; 2015 GETZ$:IFZ$=""THEN2015 2020 IFZ$="N"THENEND 2030 CLR:PRINT"{147}":GOTO100 62000 PRINT"{147}{17}{17}";TAB(9);"CURSOR #";NM$;" ";PG$ 62010 PRINT"{17} COPYRIGHT (C) 1980 BY RON LONGFELLOW{17} 62020 FORI=1TO10:PRINT"{192}{192}{192}{192}";:NEXTI 62030 PRINT"{17}RUN A SUCCESSFUL GOLD MINE. 62100 PRINT"{17}PRESS {18}RETURN{146} TO BEGIN"; 62120 GETT$:IFT$=""THEN62120 62130 PRINT"{147}":CLR:GOTO100
Decoded from miner.prg. The PET's cursor-control and graphics characters are shown as their code numbers in braces, for example {147} for clear screen and {18} for reverse on.