Related Articles: Game of Sticks, Sticks
Developer(s): Imre Auersbacher
Date: 1985
Type: Program
Platform(s): TS 2068
Appears on
Source Code
2 REM Game of Sticks (NIM) 4 REM \* 1985 I. Auersbacher 6 BORDER 6: PAPER 5: CLS 10 PRINT PAPER 7;AT 2,8;"Game of Sticks"; PAPER 5;AT 3,8;"\''\''\''\''\''\''\''\''\''\''\''\''\''\''"; PAPER 7;AT 5,8;"Level of play ";AT 7,11;"1- Novice";AT 8,11;"2- Expert": GO SUB 400 12 INPUT "Enter option: ";d 14 LET d=INT d: IF (d<1)+(d>2) THEN BEEP 1,-20: GO TO 12 20 PRINT PAPER 3;AT 6+d,8;">>" 25 DIM z$(30): LET y=INT (RND*21)+10: LET mm=INT (RND*6)+3 30 PAUSE 100: CLS : BEEP .1,20 32 PRINT PAPER 7;AT 3,0;"\:'\''\''\''\''\''\''\''\''\''\''\''\''\''\''\''\''\''\''\''\''\''\''\''\''\''\''\''\''\''\''\':";AT 4,0;"\: ";AT 4,31;"\ :";AT 5,0;"\:.\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\.:" 35 PRINT PAPER 7;AT 1,2;"Sticks: ";y;" ";AT 1,17;"Max move: ";mm;" ": GO SUB 300: GO SUB 400 40 PRINT PAPER 7;AT 9,5;"Player move: ": INPUT pm: IF (pm<=0)+(pm>mm)+(pm>y) THEN BEEP 0.5,-16: BEEP 0.7,-20: GO TO 40 50 PRINT PAPER 7;AT 9,18;pm: LET y=y-pm: IF y>0 THEN GO TO 85 70 PRINT PAPER 7;AT 4,1;" ";AT 1,10;"0"; FLASH 1;AT 9,5;" You lose, SUCKER!! ": STOP 85 GO SUB 300: PRINT PAPER 7;AT 1,2;"Sticks: ";y;" ": PAUSE 100: IF d<>2 THEN GO TO 110 95 LET z=(y-1)/(mm+1): LET cm=(mm+1)*(z-INT z)+.01: GO TO 135 110 LET cm=INT (RND*mm)+1 115 IF y<>1 THEN GO TO 130 120 LET cm=1: GO TO 140 130 IF y<=mm THEN LET cm=y-1 135 IF INT cm=0 THEN LET cm=1 140 LET cm=INT cm: PRINT PAPER 7;AT 9,5;"Computer takes: ";cm: LET y=y-cm: PAUSE 100 155 IF y<>0 THEN GO TO 170 160 PRINT PAPER 7;AT 4,1;" ";AT 1,10;"0"; FLASH 1;AT 9,5;".....YOU WIN.....": STOP 170 GO SUB 300: PRINT PAPER 7;AT 1,2;"Sticks: ";y;" ": PAUSE 100: GO TO 40 300 DIM z$(30): FOR z=1 TO y: LET z$(z)="I": NEXT z: PRINT PAPER 7; INK 0;AT 4,1;z$: RETURN 400 INK 0: PLOT 0,72: DRAW 255,0: DRAW 0,103: DRAW -255,0: DRAW 0,-103: INK 0: RETURN 999 SAVE "sticks" LINE 6