Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Cube Game Question
#4
Hi @JRace

Did you download your version or type it up from magazine page?

This is the version that doesn't work from another forum. I dont know if the guy typed the text himself with typos or he downloaded it but it does not allow even the first move of 1,1,2 or 1,2,1 or 2,1,1
Code: (Select All)
' CUBE - CREATIVE COMPUTING PUBLISHED 1978 IN
' *********** BASIC COMPUTER GAMES ***********

' ***THIS CODE HAS A BUG***

10 Print Tab(34); "CUBE"
20 Print Tab(15); "CREATIVE COMPUTING MORRISTOWN, NEW JERSEY"
30 Print: Print: Print
100 Print "DO YOU UANT TO SEE THE INSTRUCTIONS? (YES--1,NO--0)"
110 Input B7$
120 If Val(B7$) = 0 Then 370 ' added val() to this line to convert a string input to a number
130 Print "THIS IS A GAME IN UHICH YOU WILL BE PLAYING AGAINST THE"
140 Print "RANDON DECISION OF THE COMPUTER. THE FIELD OF PLAY IS A"
150 Print "CUBE OF SIDE 3. ANY OF THE 27 LOCATIONS CAN BE DESIGNATED"
160 Print "BY INPUTING THREE NUMBERS SUCH AS 2, 3, 1. AT THE START"
170 Print "YOU ARE AUTOMATICALLY AT LOCATION 1,1,1. THE OBJECT OF,"
180 Print "THE GAME IS TO GET TO LOCATION 3,3,3. ONE MINOR DETAIL,"
190 Print "THE COMPUTER WILL PICK, AT RANDOM, 5 LOCATIONS AT WHICH"
200 Print "IT WILL PLANT LAND MINES. IF YOU HIT ONE OF THESES LOCATIONS"
210 Print "YOU LOSE. ONE OTHER DETAIL, YOU MAY MOVE ONLY ONE SPACE "
220 Print "IN ONE DIRECTION EACH MOVE. FOR EXAMPLE: FROM 1, 1, 2 YOU"
230 Print "MAY MOVE TO 2,1,2 OR 1,1,3. YOU MAY NOT CHANGE"
240 Print "TWO OF THE NUMBERS ON THE SAME MOVE. IF YOU MAKE AN ILLEGAL"
250 Print "MOVE, YOU LOSE AND THE COMPUTER TAKES THE MOENY YOU MAY "
260 Print "HAVE BET ON THAT ROUND."
270 Print
280 Print
290 Print "ALL YES OR NO QUESTIONS WILL BE ANSWERED BY A 1 FOR YES"
300 Print "OR A 0 (ZERO) FOR NO."
310 Print
320 Print "WHEN STATING THE AMMOUNT OF A WAGER, PRINT ONLY THE NUMBER"
330 Print "OF DOLLARS (EXAMPLE: 250) YOU ARE AUTOMATICALY STARTED WITH"
340 Print "500 DOLLAR ACCOUNT."
350 Print
360 Print "GOOD LUCK"
370 Let A1 = 500
380 Let A = Int(3 * (Rnd(X)))
390 If A <> 0 Then 410
400 Let A = 3
410 Let B = Int(3 * (Rnd(X)))
420 If B <> 0 Then 440
430 Let B = 2
440 Let C = Int(3 * (Rnd(X)))
450 If C <> 0 Then 470
460 Let C = 3
470 Let D = Int(3 * (Rnd(X)))
480 If D <> 0 Then 500
490 Let D = 1
500 Let E = Int(3 * (Rnd(X)))
510 If E <> 0 Then 530
520 Let E = 3
530 Let F = Int(3 * (Rnd(X)))
540 If F <> 0 Then 560
550 Let F = 3
560 Let G = Int(3 * (Rnd(X)))
570 If G <> 0 Then 590
580 Let G = 3
590 Let H = Int(3 * (Rnd(X)))
600 If H <> 0 Then 620
610 Let H = 3
620 Let I = Int(3 * (Rnd(X)))
630 If I <> 0 Then 650
640 Let I = 2
650 Let J = Int(3 * (Rnd(X)))
660 If J <> 0 Then 680
670 Let J = 3
680 Let K = Int(3 * (Rnd(X)))
690 If K <> 0 Then 710
700 Let L = 2
710 Let L = Int(3 * (Rnd(X)))
720 If L <> 0 Then 740
730 Let L = 3
740 Let H = Int(3 * (RHD(X)))
750 If H <> 0 Then 770
760 Let H = 3
770 Let N = Int(3 * (Rnd(X)))
780 If N <> 0 Then 800
790 Let N = 1
800 Let O = Int(3 * (Rnd(X)))
810 If O <> 0 Then 830
820 Let O = 3
830 Print "WANT TO MAKE A WAGER?"
840 Input Z
850 If Z = 0 Then 920
860 Print "HOW MUCH?"
870 Input Z1
876 If A1 < Z1 Then 1522
890 Let X = 1
900 Let Y = 1
910 Print
920 Print "ITS YOUR NOVE"
930 Input P, O, R
940 If P > U + 1 Then 1030
950 If P = X + 1 Then 1000
960 If O > X + 1 Then 1030
970 If Q = (X + 1) Then 1010
980 If R > (Y + 1) Then 1030
990 GoTo 1050
1000 If O > -X * 1 Then 1030
1010 If R >= Y + 1 Then 1030
1020 GoTo 1050
1030 Print "ILLEGAL MOVE", "YOU LOSE"
1040 GoTo 1440
1050 Let W = P
1060 Let X = Q
1070 Let Y = R
1080 If P = 3 Then 1100
1090 GoTo 1130
1100 If Q = 3 Then 1120
1110 GoTo 1130
1120 If R = 3 Then 1530
1130 If P = A Then 1150
1140 GoTo 1180
1150 If Q = B Then 1170
1160 GoTo 1180
1170 If R = C Then 1400
1180 If P = D Then 1200
1190 GoTo 1230
1200 If Q = E Then 1220
1210 GoTo 1230
1220 If R = F Then 1400
1230 If P = G Then 1000
1240 GoTo 1280
1250 If Q = H Then 1270
1260 GoTo 1280
1270 If R = I Then 1400
1280 If P = J Then 1300
1290 GoTo 1330
1300 If Q = K Then 1320
1310 GoTo 1330
1320 If R = L Then 1440
1330 If P = N Then 1350
1340 GoTo 1380
1350 If Q = N Then 1370
1360 GoTo 1380
1370 If R = 0 Then 1400
1380 Print "NEXT MOVE"
1390 GoTo 930
1400 Print "*********BANG*********"
1410 Print "YOU LOSE"
1420 Print
1430 Print
1440 If Z = 0 Then 1580
1450 Print
1460 Let Z2 = A1 - Z1
1470 If Z2 > 0 Then 1500
1480 Print "YOU BUST"
1490 GoTo 1610
1500 Print " YOU NOW HAVE"; Z2; "DOLLARS"
1510 Let A1 = Z2
1520 GoTo 1580
1522 Print "TRIED TO FOOL ME; BET AGAIN";
1525 GoTo 870
1530 Print "CONGRATULATIONS"
1540 If Z = 0 Then 1580
1550 Let Z2 = A1 + Z1
1560 Print "YOU NOU HAVE"; Z2; "DOLLARS"
1570 Let A1 = Z2
1580 Print "DO YOU WANT TO TRY AGAIN?"
1590 Input S$
1600 If Val(S$) = 1 Then 380
1610 Print "TOUGH LUCK"
1620 Print
1630 Print " GOODBYE"
1640 End

I suspected the problem was in Input but no Input allows 3 numbers separated by commas. But I know Q was mistaken for O or vice versa, at least.
b = b + ...
Reply


Messages In This Thread
Cube Game Question - by bplus - 10-16-2023, 01:06 PM
RE: Cube Game Question - by bplus - 10-16-2023, 01:40 PM
RE: Cube Game Question - by JRace - 10-16-2023, 07:52 PM
RE: Cube Game Question - by bplus - 10-17-2023, 01:59 PM
RE: Cube Game Question - by JRace - 10-17-2023, 02:09 PM
RE: Cube Game Question - by bplus - 10-17-2023, 03:12 PM
RE: Cube Game Question - by SMcNeill - 10-17-2023, 02:14 PM
RE: Cube Game Question - by bplus - 10-17-2023, 03:20 PM
RE: Cube Game Question - by bplus - 10-16-2023, 08:04 PM
RE: Cube Game Question - by JRace - 10-17-2023, 12:59 AM
RE: Cube Game Question - by SMcNeill - 10-17-2023, 01:15 AM
RE: Cube Game Question - by SMcNeill - 10-17-2023, 01:22 AM
RE: Cube Game Question - by SMcNeill - 10-17-2023, 02:28 AM
RE: Cube Game Question - by JRace - 10-17-2023, 02:38 AM
RE: Cube Game Question - by SMcNeill - 10-17-2023, 02:48 AM
RE: Cube Game Question - by SMcNeill - 10-17-2023, 02:51 AM
RE: Cube Game Question - by mnrvovrfc - 10-17-2023, 05:09 PM
RE: Cube Game Question - by bplus - 10-17-2023, 05:38 PM
RE: Cube Game Question - by SMcNeill - 10-17-2023, 08:13 PM
RE: Cube Game Question - by bplus - 10-18-2023, 12:34 AM



Users browsing this thread: 3 Guest(s)