Cricket

Type: Program
Platform(s): TS 2068

Not for Englishmen only!

Appears on

Source Code

    1 REM Cricket
    2 GO SUB 9000
    3 BORDER 4: PAPER 4
    5 PRINT AT 0,10;"Cricket"
    7 PRINT AT 7,0;"Operating Instructions"
    8 PRINT AT 9,2;"7 for next delivery"
    9 PRINT AT 11,2;"5 to strike ball on Off-Side"
   10 PRINT AT 13,2;"8 to strike ball on On-Side"
   11 PRINT AT 15,0;"  If you don't bat straight you may get bowled or caught behind! Try not to get a Duck!"
   12 INPUT "Level of difficulty? 1-3?";d
   13 IF d<>1 AND d<>2 AND d<>3 THEN GO TO 12
   15 IF d=1 THEN LET p=5
   16 IF d=2 THEN LET p=3
   17 IF d=3 THEN LET p=1
   19 DIM t(2)
   20 DIM h$(2,12)
   21 LET tt=1
   22 FOR o=1 TO 2
   25 INPUT "Team?";h$(o)
   27 NEXT o
   30 LET o=1
   31 IF tt=2 THEN LET o=2
   32 PRINT AT 21,0;"Innings of ";h$(o)
   40 PAUSE 25
   50 CLS 
   65 GO SUB 8505
   72 LET rr=0: LET ss=0: LET w=0: LET r=0
   75 GO TO 4500
   96 INK 7: LET k=0: PRINT AT 20,14;"\f": PRINT AT 21,14;"\g"
  100 LET x=19: LET y=15
  110 FOR n=1 TO 20: INK 2: PRINT AT x,y;"\e"
  115 PAUSE p
  120 PRINT AT x,y;" ": LET x=x-1
  130 IF n=10 THEN LET q=INT (RND*5-3): LET y=y+q
  140 IF n<>12 AND INKEY$="0" THEN LET n=13
  145 IF x<=3 THEN LET x=3
  150 IF n=12 AND y<=15 AND INKEY$="5" THEN GO TO 5001
  155 IF n=12 AND y>=16 AND INKEY$="8" THEN GO TO 5001
  160 IF y<=14 AND n=12 AND INKEY$="8" THEN GO TO 3000
  170 IF y>=16 AND n=12 AND INKEY$="5" THEN GO TO 3000
 1200 NEXT n
 1210 IF y=b THEN GO TO 1300
 1220 IF y=b+1 THEN GO TO 1300
 1250 GO TO 4500
 1300 PRINT AT 10,0;"BOWLED"
 1303 GO SUB 8555
 1305 PRINT ;10,0;"      "
 1308 GO TO 6095
 2000 LET k=1+INT (RND*2)
 2010 IF k=1 THEN GO TO 2200
 2020 IF k=2 THEN GO TO 2050
 2050 GO SUB 8555
 2060 PRINT AT 10,0;"DROPPED"
 2070 BEEP .1,-10: BEEP .1,-10
 2075 PAUSE 5
 2080 PRINT AT 10,0;"       "
 2090 GO TO 6095
 2200 PRINT AT 10,0;"CAUGHT"
 2210 GO SUB 8555
 2220 PRINT AT 10,0;"      "
 2250 GO TO 6095
 3000 PRINT AT 13,5;"\e";AT 13,0;"CAUGHT BEHIND"
 3010 GO SUB 8555
 3020 PRINT AT 3,15;" ";AT 13,0;"             "
 3035 GO TO 6095
 4410 GO TO 4500
 4500 PRINT AT 10,b;"  "
 4505 INPUT INKEY$
 4510 IF INKEY$="7" THEN GO TO 85
 4520 IF INKEY$<>"7" THEN GO TO 4500
 5000 GO TO 4500
 5002 INK 7: PRINT AT 7,m;"\l";AT 8,m;"\m"
 5003 BEEP .03,0
 5005 LET c=x: LET d=y
 5006 LET s=INT (RND*15)
 5010 LET h=INT (1+4*RND)
 5015 FOR n=1 TO s
 5020 IF h=1 THEN GO TO 5100
 5030 IF h=2 THEN GO TO 5110
 5040 IF h=3 THEN GO TO 5120
 5050 IF h=4 THEN GO TO 5130
 5100 LET d=d-1: LET c=c-1: GO TO 6000
 5110 LET d=d-1: LET c=c+1: GO TO 6000
 5120 LET d=d+1: LET c=c-1: GO TO 6000
 5130 LET d=d+1: LET c=c+1
 6000 IF c=2 AND d=9 THEN GO TO 2000
 6005 IF c=10 AND d=10 THEN GO TO 2000
 6010 IF c=0 AND d=20 THEN GO TO 2000
 6015 IF c=15 AND d=22 THEN GO TO 2000
 6040 INK 2: PRINT AT c,d;"\e"
 6045 PAUSE 10
 6047 IF c<=0 THEN LET n=s: IF c>=20 THEN LET n=s
 6048 IF d<=0 THEN LET n=s: IF d>=32 THEN LET n=s
 6050 PRINT AT c,d;" "
 6055 GO SUB 8525
 6060 NEXT n
 6061 IF s>=0 AND s<=3 THEN LET r=1
 6062 IF s>=4 AND s<=7 THEN LET r=2
 6063 IF s>=8 AND s<=10 THEN LET r=3
 6064 IF s>=11 AND s<=13 THEN LET r=4
 6078 IF s>=14 THEN LET r=6
 6082 INK 1: PRINT AT 10,b;r
 6084 PAUSE 10
 6086 LET t(o)=t(o)+r
 6088 LET rr=t(o)
 6095 INK 1: PRINT AT 0,1;h$(o)
 6096 PRINT AT 1,2;t(o)
 6097 PRINT AT 2,1;"For"
 6098 PRINT AT 3,2;w
 6099 INK 7
 7000 IF w=10 THEN GO TO 8200
 7010 GO SUB 8505
 8000 GO TO 4500
 8200 CLS 
 8210 PRINT AT 5,5;"All Out"
 8220 PRINT AT 7,5;h$(o);" Scored ";t(o)
 8222 IF o=2 THEN GO TO 8630
 8250 INPUT "ENTER for next innings";i$
 8260 LET tt=2
 8300 CLS 
 8500 GO TO 28
 8505 INK 7: PRINT AT 1,15;"\f";AT 2,15;"\n";AT 0,13;"\f";AT 1,13;"\n"
 8510 PRINT AT 4,27;"\f";AT 5,27;"\g";AT 17,7;"\f";AT 18,7;"\g"
 8515 PRINT AT 5,5;"\f";AT 6,5;"\g";AT 20,14;"\h";AT 21,14;"\g"
 8520 LET m=17: LET a=5: LET b=15
 8525 INK 7: PRINT AT a,b;"\a\b";AT 6,b;"\d\c";AT 21,b;"\a\b"
 8530 PRINT AT 7,m;"\j";AT 8,m;"\k"
 8535 PRINT AT 2,9;"\f";AT 3,9;"\n";AT 10,10;"\f";AT 11,10;"\g"
 8540 PRINT AT 1,11;"\f";AT 2,11;"\n"
 8545 PRINT AT 0,20;"\f";AT 1,20;"\g";AT 15,22;"\f";AT 16,22;"\g"
 8550 RETURN 
 8555 INK 7: PRINT ;2,9;"\h";AT 0,13;"\h";AT 1,b;"\h";AT 5,5;"\h"
 8560 PRINT AT 1,11;"\h";AT 20,14;"\h";AT 21,14;"\n"
 8565 PRINT AT 15,22;"\h";AT 0,20;"\h";AT 10,10;"\h"
 8567 BEEP .1,12: BEEP .1,10: BEEP .1,12: BEEP .1,10
 8569 IF k=2 THEN RETURN 
 8575 LET w=w+1
 8578 IF ss=rr THEN GO TO 9200
 8579 LET ss=t(o)
 8580 FOR v=1 TO 17
 8585 INK 7: PRINT AT 8,m;"\k";AT 7,m;"\j"
 8590 PAUSE 6
 8595 PRINT AT 8,m;"\n"
 8600 PAUSE 6
 8605 PRINT AT 7,m;" ";AT 8,m;" "
 8610 LET m=m-1
 8615 NEXT v
 8620 RETURN 
 8625 STOP 
 8630 PAUSE 20
 8635 CLS 
 8640 IF t(1)>t(2) THEN GO TO 8650
 8642 IF t(1)=t(2) THEN GO TO 8672
 8645 IF t(1)<t(2) THEN GO TO 8665
 8650 LET u=t(1)-t(2)
 8655 PRINT AT 10,0;h$(2);" wins by ";u;" runs"
 8660 STOP 
 8665 LET u=t(2)-t(1)
 8670 PRINT AT 10,0;h$(2);" wins by ";u;" runs"
 8671 STOP 
 8672 PRINT AT 10,0;"MATCH DRAWN"
 8675 STOP 
 9000 RESTORE 9000: FOR a=USR "a" TO USR "q"+7
 9005 READ user: POKE a,user
 9010 NEXT a
 9020 DATA 0,0,0,31,25,25,25,25
 9025 DATA 0,0,0,248,152,152,152,152
 9030 DATA 152,152,152,152,152,152,152,152
 9035 DATA 25,25,25,25,25,25,25,28
 9040 DATA 0,24,60,126,126,126,60,24,0
 9045 DATA 24,36,36,24,126,126,189,189
 9050 DATA 189,126,60,60,60,60,60,60
 9055 DATA 3,3,6,54,78,54,254,190
 9060 DATA 124,60,60,60,60,60,60,60
 9065 DATA 6,9,6,14,31,31,55,111
 9070 DATA 78,78,255,232,238,238,238,94
 9075 DATA 102,105,102,103,103,103,39,63
 9080 DATA 7,7,7,7,7,7,7,15
 9085 DATA 60,60,126,102,102,102,102,238
 9090 DATA 0,0,0,48,120,24,25,31
 9095 DATA 31,30,31,30,14,4,4,12
 9100 DATA 31,30,30,30,14,10,10,10
 9105 REM a b c d e f g h i j k 
 9110 REM \a \b \c \d \e \f \g \h \i \j \k
 9115 REM l m n o p q 
 9120 REM \l \m \n \o \p \q
 9130 RETURN 
 9200 FOR v=1 TO 17
 9210 INK 7: PRINT AT 8,m;"\p";AT 7,m;"\o"
 9220 PAUSE 6
 9230 PRINT AT 8,m;"\q"
 9240 BEEP .1,-10
 9250 PRINT AT 7,m;" ";AT 8,m;" "
 9260 LET m=m-1
 9270 NEXT v
 9280 GO TO 8620
 9500 CLS : LET z=(PEEK 23670+(256*PEEK 23731))-(PEEK 23653+(256*PEEK 23654)): PRINT "SPARE MEMORY=";z
 9998 SAVE "Cricket" LINE 0: BEEP .4,15
 9999 VERIFY ""

People

No people associated with this content.

Scroll to Top