The Old Shell Game

Developer(s): Jack Armstrong
Date: 1985
Type: Program
Platform(s): TS 2068

Gallery

The Old Shell Game

Source Code

    5 REM  THE OLD SHELL GAME             ยฉ1985 JACK ARMSTRONG
   10 BORDER 5: INK 1: PAPER 6: CLS : LET m=0
   15 DIM s$(3): DIM p$(1): GO SUB 20: GO TO 50
   20 FOR k=-5 TO 7: BEEP .05,k: NEXT k: CLS : PRINT INK 2;AT 7,6;"โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ"
   30 PRINT FLASH 1;AT 8,6;" THE OLD SHELL GAME "
   40 PRINT INK 2;AT 9,6;"โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ": PAUSE 120: RETURN 
   50 GO SUB 3030
   60 GO SUB 3000
   70 FOR k=1 TO 3: LET s$(k)=CHR$ (k+143): NEXT k: LET p$=CHR$ 147
   80 PRINT '''''"Hi There! My Name's Tim Sinclair": POKE 23658,8
   90 PRINT '''''"What is your name?": INPUT n$: PAUSE 60: CLS 
  100 PRINT '''''"Well, now-";n$;"..."
  110 PRINT "do you, by any chance, have a"
  120 PRINT "bit of gambling blood in you?"
  130 PRINT ''"Input your answer Y(es) or N(o)": PAUSE 0: LET q$=INKEY$
  140 IF q$<>"Y" AND q$<>"N" THEN GO TO 130
  150 IF q$=CHR$ 78 THEN GO TO 610
  160 CLS : PRINT '''''"Well now, ";n$;" they call this ": PAUSE 120
  170 CLS : GO SUB 20
  180 PAUSE 60: CLS 
  190 PRINT '''"Here's the deal, ";n$
  200 PRINT '"I have these three shells..."''TAB 10; INK 2;s$;" ";s$;" ";s$
  210 PRINT '"And I have this little pea..."; INK 4;p$: PAUSE 180
  220 GO SUB 1000
  230 PAUSE 60: CLS 
  240 PRINT '''"Here's the deal, ";n$;"..."
  250 PRINT '"I'll put the pea under a shell,"
  260 PRINT '"Mix them up...Then YOU guess..."
  270 PRINT '"which shell is the pea under...";''TAB 11;"1 - 2 or 3"
  280 PRINT '"Just to make things interesting-";''"Let's make a little wager on it.": LET m=10
  290 PRINT ''"Press ENTER to continue...": PAUSE 0: CLS : PRINT '"How much do you want to bet that"
  300 PRINT '"you can guess correctly?"
  310 PRINT ''"Since we are friends, let's"
  320 PRINT '"make some limits-say you have";''"$10.00 and you can bet any even"
  330 PRINT '"amount from $1 to $10 as long as"''"you have the money to bet."
  340 PRINT ''''"Press ENTER to continue...": PAUSE 0: CLS : PRINT '''''"PLACE YOUR BET. Please enter the"
  350 PRINT '"number only. Don't use the ($)"''"dollar sign-just the number."
  360 PRINT AT 21,0;"You have $";m;" in your poke.": INPUT bet: PAUSE 60: CLS 
  370 IF bet>m THEN GO TO 410
  380 IF bet>10 THEN GO TO 410
  390 LET m=m-bet
  400 IF bet>=1 AND bet<=10 THEN GO TO 430
  410 PAUSE 60: CLS : PRINT ''''"Come, come, Sport-I'm no sucker-"
  420 PRINT '"Quit trying to con me-Make your bet!": IF bet>m OR bet>10 THEN PRINT ''"You can't bet more than $10.00  or more than is in your poke.": LET bet=0: PAUSE 180: CLS : GO TO 340
  430 PRINT ''''"O.K., Sport...Her we go..."
  440 GO SUB 20: GO SUB 1000
  450 LET p=INT (RND*3)+1
  460 PRINT ''''"Well, now, ";n$;"..."
  470 PRINT '"Where's the pea?": INPUT "What's your guess? ";g
  480 CLS : IF g<1 OR g>3 THEN GO TO 450
  490 PRINT '''''"O.K., Sport, glad you made that"
  500 PRINT '"choice-Let's see now...": IF g=p THEN LET m=m+2*bet
  510 IF g<>p THEN GO TO 670
  520 PAUSE 120: CLS : GO SUB 800: PAUSE 60
  530 PRINT ''"How about that sport-You made a"
  540 PRINT '"good guess...Now you have $";m;"."
  550 PRINT '"Want to try again? If you feel"
  560 PRINT '"lucky. Input (Y)es or if you are"
  570 PRINT '"just a piker-Input (N)o.": INPUT f$: PAUSE 60: CLS 
  580 IF f$="N" THEN GO TO 610
  590 IF f$="Y" THEN GO TO 340
  600 IF f$<>"Y" OR f$<>"N" THEN PRINT '"Hey, sport, Y or y or N or n.": PAUSE 120: CLS : GO TO 550
  610 PAUSE 60: CLS : PRINT '''''"O.K., Sport, no hard feelings..."
  620 PRINT '"See you around, ";n$;"..."
  630 PRINT '"You had $";m;" left..."
  640 PRINT '"If you'd like to try again,"
  650 PRINT '"Press R for a re-run...": PAUSE 0: IF INKEY$="R" OR INKEY$="r" THEN RUN 
  660 PAUSE 60: CLS : STOP 
  670 PAUSE 60: CLS : PRINT '''''"The pea was under ": GO SUB 800
  680 PAUSE 60: CLS : PRINT '''''"Sorry, Sport-you missed that one"
  690 PRINT '"You now have $";m;" left."
  700 IF m<1 THEN GO TO 740
  710 PRINT '''''"If you want to try again press"
  720 PRINT '"(Y)es, if not press (N)o.": IF INKEY$="Y" THEN GO TO 340
  730 IF INKEY$="N" THEN GO TO 610
  740 PAUSE 60: CLS : PRINT '''''"If you'd like to play again..."
  750 PRINT '"press R to re-run.": PAUSE 0: IF INKEY$="R" OR INKEY$="r" THEN RUN 
  760 STOP 
  800 PAUSE 60: CLS : PRINT '''''"The pea was under..."
  810 PRINT INVERSE 1;AT 8,(8 AND p=1)+(16 AND p=2)+(24 AND p=3);p
  820 PRINT INK 2;AT 10,3;"    \a\b\c     \a\b\c     \a\b\c";AT 10,(8 AND p=1)+(16 AND p=2)+(24 AND p=3); INK 4;p$: PAUSE 120: RETURN 
  999 STOP 
 1000 REM 
 1010 CLS 
 1020 LET v=10: LET h=5: FOR l=1 TO 3
 1030 IF l=2 THEN LET h=h+10
 1040 IF l=3 THEN LET h=h+10
 1050 PRINT INK 2;AT v,h;s$
 1060 NEXT l
 1070 PRINT AT 8,6;"1";AT 8,16;"2";AT 8,26;"3"
 1080 LET d=10: FOR l=1 TO 14
 1090 LET x=(RND*30)+1: IF x<=10 THEN LET x=6
 1100 IF x>=10 AND x<=20 THEN LET x=16
 1110 IF x>20 THEN LET x=26
 1120 PRINT INK 4;AT d,x;p$: PAUSE 10
 1130 PRINT INK 2;AT d,x;s$(2): PAUSE 5
 1140 NEXT l
 1150 RETURN 
 3000 REM 
 3010 CLS : PRINT '''''"To play this game..."''"follow instructions carefully..."''"Press ENTER after each input or just press the key required."''TAB 11;"Good Luck!"
 3020 PRINT AT 18,0;"Press ENTER to start...": PAUSE 0: CLS : RETURN 
 3030 REM 
 3040 FOR a=USR "a" TO USR "d"+7
 3050 READ user: POKE a,user: NEXT a: RETURN 
 3060 DATA 0,3,12,16,32,64,128,255
 3070 DATA 60,195,0,0,0,0,0,255
 3080 DATA 0,192,48,8,4,2,1,255
 3090 DATA 24,126,250,247,239,94,126,24
 8999 STOP 
 9000 SAVE "shellgame": PRINT "Rewind & key ENTER to VERIFY.": PAUSE 0: VERIFY "shellgame"
 9010 FOR k=-5 TO 7: BEEP .05,k: NEXT k
Scroll to Top