10-17-2023, 02:28 AM
Here's a version cleaned up and modernized fairly decently:
Code: (Select All)
Print Tab(34); "CUBE"
Print Tab(15); "CREATIVE COMPUTING MORRISTOWN, NEW JERSEY"
Print: Print: Print
Print "DO YOU WANT TO SEE THE INSTRUCTIONS? (Y)es or (N)o."
Do
instructions$ = UCase$(Input$(1))
Loop Until instructions$ = "Y" Or instructions$ = "N"
If instructions$ = "Y" Then
Print "THIS IS A GAME IN WHICH YOU WILL BE PLAYING AGAINST THE"
Print "RANDOM DECISION OF THE COMPUTER. THE FIELD OF PLAY IS A"
Print "CUBE OF SIDE 3. ANY OF THE 27 LOCATIONS CAN BE DESIGNATED"
Print "BY INPUTING THREE NUMBERS SUCH AS 2,3,1. AT THE START,"
Print "YOU ARE AUTOMATICALLY AT LOCATION 1,1,1. THE OBJECT OF"
Print "THE GAME IS TO GET TO LOCATION 3,3,3. ONE MINOR DETAIL:"
Print "THE COMPUTER WILL PICK, AT RANDOM, 5 LOCATIONS AT WHICH"
Print "IT WILL PLANT LAND MINES. IF YOU HIT ONE OF THESE LOCATIONS"
Print "YOU LOSE. ONE OTHER DETAIL: YOU MAY MOVE ONLY ONE SPACE "
Print "IN ONE DIRECTION EACH MOVE. FOR EXAMPLE: FROM 1,1,2 YOU"
Print "MAY MOVE TO 2,1,2 OR 1,1,3. YOU MAY NOT CHANGE"
Print "TWO OF THE NUMBERS ON THE SAME MOVE. IF YOU MAKE AN ILLEGAL"
Print "MOVE, YOU LOSE AND THE COMPUTER TAKES THE MONEY YOU MAY"
Print "HAVE BET ON THAT ROUND."
Print
Print
Print "ALL YES OR NO QUESTIONS WILL BE ANSWERED BY A 1 FOR YES"
Print "OR A 0 (ZERO) FOR NO."
Print
Print "WHEN STATING THE AMOUNT OF A WAGER, PRINT ONLY THE NUMBER"
Print "OF DOLLARS (EXAMPLE: 250) YOU ARE AUTOMATICALLY STARTED WITH"
Print "500 DOLLARS IN YOUR ACCOUNT."
Print
Print "GOOD LUCK!"
End If
Money = 500
start_game:
A = Int(3 * (Rnd(X))) + 1 '1, 2, 3
B = Int(3 * (Rnd(X))): If B = 0 Then B = 2
C = Int(3 * (Rnd(X))) + 1 '1, 2, 3
D = Int(3 * (Rnd(X))): If D = 0 Then D = 1
E = Int(3 * (Rnd(X))) + 1 '1, 2, 3
F = Int(3 * (Rnd(X))) + 1
G = Int(3 * (Rnd(X))) + 1
H = Int(3 * (Rnd(X))) + 1
i = Int(3 * (Rnd(X))): If i = 0 Then i = 2
J = Int(3 * (Rnd(X))) + 1
K = Int(3 * (Rnd(X))): If K = 0 Then K = 2
L = Int(3 * (Rnd(X))) + 1
M = Int(3 * (Rnd(X))) + 1
N = Int(3 * (Rnd(X))): If N = 0 Then N = 1
O = Int(3 * (Rnd(X))) + 1
Print "WANT TO MAKE A WAGER?"
Input Z
If Z <> 0 Then
Do
Print "HOW MUCH ";
Input Bet
If Money < Bet Then Print "TRIED TO FOOL ME; BET AGAIN!"
Loop Until Money >= Bet
Let W = 1
Let X = 1
Let Y = 1
Print
End If
Print "IT'S YOUR MOVE: ";
your_move:
Input P, Q, R
lose = 0
If P > W + 1 Then lose = -1
If P = W + 1 And Q >= X + 1 Then lose = -1
If Q > X + 1 Then lose = -1
If Q = (X + 1) And R >= Y + 1 Then lose = -1
If R > (Y + 1) Then lose = -1
If lose Then Print "ILLEGAL MOVE. YOU LOSE.": GoTo you_lose
W = P
X = Q
Y = R
If P = 3 And Q = 3 And R = 3 Then
Print "CONGRATULATIONS!"
If Z <> 0 Then
Money = Money + Bet
Print "YOU NOW HAVE"; Money; "DOLLARS."
End If
Else
If P = A And Q = B And R = C GoTo you_lose
If P = D And Q = E And R = F GoTo you_lose
If P = G And Q = H And R = i GoTo you_lose
If P = J And Q = K And R = L GoTo you_lose
If P = M And Q = N And R = O GoTo you_lose
Print "NEXT MOVE: ";
GoTo your_move
you_lose:
Print "******BANG******"
Print "YOU LOSE!"
Print
Print
If Z <> 0 Then
Print
Money = Money - Bet
If Money = 0 Then
Print "YOU BUST."
GoTo quit
End If
Print " YOU NOW HAVE"; Money; "DOLLARS."
End If
End If
Print "DO YOU WANT TO TRY AGAIN ";
Input S
If S = 1 Then GoTo start_game
quit:
Print "TOUGH LUCK!"
Print
Print "GOODBYE."
End