<<STICKS>>
PUSH
SET MODE BASIC
LET P1 = 16
WRITE 'BORED ? FRUSTRATED ? WELL HAVE A GO AT THIS LITTLE GAME TO '
WRITE 'TAKE SOME OF THAT TENSION OUT OF YOUR LIFE. THERE ARE 16 '
WRITE 'STICKS IN THE PILE. YOU HAVE TO LEAVE ME WITH ONE '
<<WRITE>>
WRITE 'YOU MAY PICK UP 1,2 OR 3 STICKS ON ANY TURN, SO PLEASE START'
WRITE 'MAY THE BEST MAN WIN (PROBABLY ME).'
WRITE ' '
WRITE 'YOUR TURN '
<<READ>>
: VERIFY USERS ENTRY IS VALID
READ L1
IF (L1 LT 1)
GOTO <<WRITE>>
ELSE
IF (L1 GT 3)
GOTO <<WRITE>>
ELSE
IF (CONFORM(L1 'N') NE 1)
GOTO <<WRITE>>
ENDIF
ENDIF
LET P1 = P1 - L1
ENDIF
: IF REMAINDER IS GREATER THAN 8, EQUAL TO 5 OR 6, THE GAME TAKES 1.
IF (P1 GT 8) OR (P1 EQ 6) OR (P1 EQ 5)
LET L2 = 1
GOTO <<TAKE>>
ENDIF
: REMAINDER IS LESS THAN 5, THE USER WINS IF IT IS 1; OTHERWISE GAME
: WINS. IF REMAINDER IS 8, THE GAME TAKES 3. IF REMAINDER IS 7, GAME
: TAKES 2.
IF (P1 LT 5)
GOTO <<LOSE>>
ELSE
IF (P1 EQ 8)
LET L2 = 3
GOTO <<TAKE>>
ELSE
IF (P1 EQ 7)
LET L2 = 2
GOTO <<TAKE>>
ENDIF
ENDIF
ENDIF
<<TAKE>>
LET P1 = P1 - L2
WRITE 'I TAKE ' |L2
WRITE 'THE NUMBER OF STICKS REMAINING IS '|P1
WRITE ' '
WRITE 'YOUR TURN:'
GOTO <<READ>>
<<LOSE>>
IF (P1 EQ 1)
WRITE 'YOU LUCKY MUTHA YOU HAVE ACTUALLY WON!!!!!!!!'
ELSE
WRITE 'THE NUMBER OF STICKS REMAINING IS 1.'
WRITE 'HA YOU LOSE AND I WIN.'
ENDIF
WRITE 'DO YOU WANT TO TRY AGAIN SUCKER .....YES OR NO ?'
READ L3
IF (L3 EQ 'YES')
GOTO <<STICKS>>
ELSE
STOP
ENDIF
POP
PUSH
SET MODE BASIC
LET P1 = 16
WRITE 'BORED ? FRUSTRATED ? WELL HAVE A GO AT THIS LITTLE GAME TO '
WRITE 'TAKE SOME OF THAT TENSION OUT OF YOUR LIFE. THERE ARE 16 '
WRITE 'STICKS IN THE PILE. YOU HAVE TO LEAVE ME WITH ONE '
<<WRITE>>
WRITE 'YOU MAY PICK UP 1,2 OR 3 STICKS ON ANY TURN, SO PLEASE START'
WRITE 'MAY THE BEST MAN WIN (PROBABLY ME).'
WRITE ' '
WRITE 'YOUR TURN '
<<READ>>
: VERIFY USERS ENTRY IS VALID
READ L1
IF (L1 LT 1)
GOTO <<WRITE>>
ELSE
IF (L1 GT 3)
GOTO <<WRITE>>
ELSE
IF (CONFORM(L1 'N') NE 1)
GOTO <<WRITE>>
ENDIF
ENDIF
LET P1 = P1 - L1
ENDIF
: IF REMAINDER IS GREATER THAN 8, EQUAL TO 5 OR 6, THE GAME TAKES 1.
IF (P1 GT 8) OR (P1 EQ 6) OR (P1 EQ 5)
LET L2 = 1
GOTO <<TAKE>>
ENDIF
: REMAINDER IS LESS THAN 5, THE USER WINS IF IT IS 1; OTHERWISE GAME
: WINS. IF REMAINDER IS 8, THE GAME TAKES 3. IF REMAINDER IS 7, GAME
: TAKES 2.
IF (P1 LT 5)
GOTO <<LOSE>>
ELSE
IF (P1 EQ 8)
LET L2 = 3
GOTO <<TAKE>>
ELSE
IF (P1 EQ 7)
LET L2 = 2
GOTO <<TAKE>>
ENDIF
ENDIF
ENDIF
<<TAKE>>
LET P1 = P1 - L2
WRITE 'I TAKE ' |L2
WRITE 'THE NUMBER OF STICKS REMAINING IS '|P1
WRITE ' '
WRITE 'YOUR TURN:'
GOTO <<READ>>
<<LOSE>>
IF (P1 EQ 1)
WRITE 'YOU LUCKY MUTHA YOU HAVE ACTUALLY WON!!!!!!!!'
ELSE
WRITE 'THE NUMBER OF STICKS REMAINING IS 1.'
WRITE 'HA YOU LOSE AND I WIN.'
ENDIF
WRITE 'DO YOU WANT TO TRY AGAIN SUCKER .....YES OR NO ?'
READ L3
IF (L3 EQ 'YES')
GOTO <<STICKS>>
ELSE
STOP
ENDIF
POP
Leave a comment: