Menu

Creating TV Show High Roller(Bonus Round Only)

2020-04-19
2020-05-12
  • Cedric T Jemison

    MYHIROLL.txt
    

    The problem is when a user makes a mistake with incorrect value. eg the dices rolled 12 but use pick 3 numbers on the board that does not sum up to 12 maybe 11. So the user repick numbers, and this time the value of 12 is correct using 3 numbers maybe 1,3 and 8 or any order. Only last number selected is remove from the board eg. number 8. Number 1 and 3 should have been removed also. The purpose is the make the fool proof. So my issue is base on when to insert the line IF B(D) THEN B(D)=0 so all 3 selected numbers are removed after the single roll of 12. Does this line B(I)=-1 controls the number of each number eliminated from the board? On the dice drawing, I would like to see the dices side by side so it won't take up more vertical lines than necessary on the screen. Here's the program itself and running the program below:

    10 CLS: COLOR 14: PRINT "H H II GGG H H"
    20 PRINT "H H II G H H"
    30 PRINT "HHH II G G HHH"
    40 PRINT "H H II GGG H H"
    50 PRINT "H H II GGG H H"
    60 PRINT
    70 PRINT "RRR OOO L L EEE RRR SSS"
    80 PRINT "R R O O L L E R R S "
    90 PRINT "RRR O O L L EEE RRR S "
    100 PRINT "RR O O L L L L E RR S"
    110 PRINT "R R OOO LLL LLL EEE R R SSS"
    120 PRINT
    130 COLOR 7:
    140 INPUT "PRESS <enter> KEY TO BEGIN...";BE
    150 CLS
    160 RANDOMIZE:NC=9:NTH$(1)="st":NTH$(2)="nd":NTH$(3)="rd":NTH$(4)="th"
    170 RC=0:AD=45:DR=0:DIM B(12):FOR I=1 TO NC:B(I)=-1:NEXT
    180 R=0:FOR I=1 TO NC:R=R OR B(I):NEXT:IF NOT R THEN GOTO 580
    190 AD=AD-D:PRINT" Board ":FOR I=1 TO NC
    200 IF B(I) THEN PRINT USING "<#>";I; ELSE PRINT " ";
    210 IF I MOD 3 = 0 THEN PRINT
    220 NEXT:PRINT:PRINT
    230 RC=RC+1:IF RC>3 THEN I=4 ELSE I=RC
    240 IF AD=1 THEN PRINT "With the number 1 left on the board, the game is over.":END
    250 PRINT"Press <enter> to roll the dice. (";RC;NTH$(I)". roll)";:INPUT A$
    260 DA=INT(6RND(1))+1:PRINT"With dice one, a";DA
    270 DB=INT(6
    RND(1))+1:PRINT"With dice one, a";DB
    280 IF DA THEN PRINT "-------"
    290 IF DA=2 OR DA=3 THEN PRINT "| O |" ELSE IF DA=4 OR DA=5 THEN PRINT "| O O |" ELSE IF DA=6 THEN PRINT "| OOO |" ELSE PRINT "| |"
    300 IF DA=1 OR DA=3 OR DA=5 THEN PRINT "| O |" ELSE PRINT "| |"
    310 IF DA=2 OR DA=3 THEN PRINT "| O |" ELSE IF DA=4 OR DA=5 THEN PRINT "| O O |" ELSE IF DA=6 THEN PRINT "| OOO |" ELSE PRINT "| |"
    320 IF DA THEN PRINT "-------"
    330 IF DB THEN PRINT "-------"
    340 IF DB=2 OR DB=3 THEN PRINT "| O |" ELSE IF DB=4 OR DB=5 THEN PRINT "| O O |" ELSE IF DB=6 THEN PRINT "| OOO |" ELSE PRINT "| |"
    350 IF DB=1 OR DB=3 OR DB=5 THEN PRINT "| O |" ELSE PRINT "| |"
    360 IF DB=2 OR DB=3 THEN PRINT "| O |" ELSE IF DB=4 OR DB=5 THEN PRINT "| O O |" ELSE IF DB=6 THEN PRINT "| OOO |" ELSE PRINT "| |"
    370 IF DB THEN PRINT "-------"
    380 D=DA+DB:PRINT"You rolled a";D
    390 IF DA=DB THEN PRINT"A double roll!!!":IF DA=DB THEN DR=DR+1
    400 IF D=2 THEN 470
    410 IF D>9 THEN GOTO 490
    420 IF B(D)=0 AND AD<d then="" <br="" 530="">430 IF B(D)=0 THEN 490
    440 IF D>2 AND D<10 THEN INPUT "Do you want to remove combination of numbers?...";CM$
    450 IF CM$ = "Y" OR CM$ = "YES" THEN 590
    460 IF CM$<>"Y" AND CM$<>"YES" AND CM$<>"N" AND CM$<>"NO" THEN 440
    470 IF B(D) THEN B(D)=0:GOTO 180
    480 IF B(D)=0 AND AD<d then="" else="" if="" d="" 530="">9 AND AD<d then="" <br="" 530="">490 IF B(D)=0 THEN PRINT "Do you have combination numbers equal to";D;"on the board?"
    500 IF B(D)=0 THEN INPUT CB$
    510 IF CB$="Y" OR CB$="YES" THEN 590
    520 IF CB$<>"Y" AND CB$<>"YES" AND CB$<>"N" AND CB$<>"NO" THEN 490
    530 IF D<10 THEN PRINT"Number";D;"is already off the board." ELSE IF D>9 THEN PRINT"The combination of number";D;"is already off the board."
    540 DR=DR-1
    550 IF DR>-1 THEN PRINT "You have";DR;"spare marker insurance left.":D=0
    560 IF DR>-1 THEN 180
    570 PRINT"Bad roll. You loose.":END
    580 PRINT"Board is empty. You win.":END
    590 IF D>2 THEN INPUT "How many numbers you want to remove?...";RE
    600 IF RE<2 OR RE>4 THEN PRINT "Incorrect Response!!!"
    610 IF RE<2 OR RE>4 THEN 590
    620 INPUT "1st num to remove...";N(I):D=N(I):IF B(D)=0 THEN PRINT D;"is not on the board."
    630 IF B(D)=0 THEN 620
    640 IF B(D) THEN B(D)=0
    650 IF N(I)=0 OR N(I)>9 THEN PRINT "Only digits 1 to 9 can be selected.":GOTO 620
    660 P1=N(I):GOTO 730
    670 R=0:FOR I=1 TO NC:R=R OR B(I):NEXT:IF NOT R THEN GOTO 580
    680 PRINT D=P1;
    690 AD=AD-D:PRINT" Board ":FOR I=1 TO NC
    700 IF B(I) THEN PRINT USING "<#>";I; ELSE PRINT " ";
    710 IF I MOD 3 = 0 THEN PRINT
    720 NEXT:PRINT:PRINT
    730 INPUT "2nd num to remove...";N(I):D=N(I):IF B(D)=0 THEN PRINT D;"is not on the board."
    740 IF B(D)=0 THEN 730
    750 IF B(D) THEN B(D)=0
    760 IF RE=2 AND N(I)=0 OR N(I)>9 THEN PRINT "Only digits 1 to 9 can be selected.":GOTO 730
    770 P2=N(I):IF P2=P1 THEN PRINT "Repeated number in selection is not allowed.":GOTO 730
    780 IF RE=3 OR RE=4 THEN 880
    790 IF RE=2 AND P1+P2<>DA+DB THEN PRINT "Incorrect Value!!!":D=0:GOTO 620
    800 IF RE=2 AND P1+P2=DA+DB AND B(D) THEN B(D)=0
    810 R=0:FOR I=1 TO NC:R=R OR B(I):NEXT:IF NOT R THEN GOTO 580
    820 PRINT D=P1+P2;
    830 AD=AD-D:PRINT" Board ":FOR I=1 TO NC
    840 IF B(I) THEN PRINT USING "<#>";I; ELSE PRINT " ";
    850 IF I MOD 3 = 0 THEN PRINT
    860 NEXT:PRINT:PRINT
    870 IF RE=2 THEN 1160
    880 IF RE=3 OR RE=4 THEN INPUT "3rd num to remove...";N(I):D=N(I):IF B(D)=0 THEN PRINT D;"is not on the board."
    890 IF B(D)=0 THEN 880
    900 IF B(D) THEN B(D)=0
    910 IF RE=3 AND N(I)=0 OR N(I)>9 THEN PRINT "Only digits 1 to 9 can be selected.":GOTO 880
    920 P3=N(I):IF P3=P2 OR P3=P1 THEN PRINT "Repeated number in selection is not allowed.":GOTO 880
    930 IF RE=4 THEN 1030
    940 IF RE=3 AND P1+P2+P3<>DA+DB THEN PRINT "Incorrect Value!!!":D=0:GOTO 620
    950 IF RE=3 AND P1+P2+P3=DA+DB AND B(D) THEN B(D)=0
    960 R=0:FOR I=1 TO NC:R=R OR B(I):NEXT:IF NOT R THEN GOTO 580
    970 PRINT D=P1+P2+P3;
    980 AD=AD-D:PRINT" Board ":FOR I=1 TO NC
    990 IF B(I) THEN PRINT USING "<#>";I; ELSE PRINT " ";
    1000 IF I MOD 3 = 0 THEN PRINT
    1010 NEXT:PRINT:PRINT
    1020 IF RE=3 THEN 1160
    1030 IF RE=4 THEN INPUT "4th num to remove...";N(I):D=N(I):IF B(D)=0 THEN PRINT D;"is not on the board."
    1040 IF B(D)=0 THEN 1030
    1050 IF B(D) THEN B(D)=0
    1060 IF RE=4 AND N(I)=0 OR N(I)>9 THEN PRINT "Only digits 1 to 9 can be selected.":GOTO 1030
    1070 P4=N(I):IF P4=P3 OR P4=P2 OR P4=P1 THEN PRINT "Repeated number in selection is not allowed.":GOTO 1030
    1080 IF RE=4 AND P1+P2+P3+P4<>DA+DB THEN PRINT "Incorrect Value!!!":D=0:GOTO 620
    1090 IF RE=4 AND P1+P2+P3+P4=DA+DB AND B(D) THEN B(D)=0
    1100 R=0:FOR I=1 TO NC:R=R OR B(I):NEXT:IF NOT R THEN GOTO 580
    1110 PRINT D=P1+P2+P3+P4;
    1120 AD=AD-D:PRINT" Board ":FOR I=1 TO NC
    1130 IF B(I) THEN PRINT USING "<#>";I; ELSE PRINT " ";
    1140 IF I MOD 3 = 0 THEN PRINT
    1150 NEXT:PRINT:PRINT
    1160 GOTO 230 </d></d></d></enter></enter>

    Running the program is in attachments. A lot easier to show fellow programmers what am i missing with the fool proof plan.

     

    Last edit: Cedric T Jemison 2020-04-23
  • Cedric T Jemison

    Update on my program:

    I am happy to say that the dices are now side by side and the it taking up less vertical spaces on the screen. So here the attachments for the game. What a difference. However, I still working out the kinks of the selected numbers not equal to dice number rolled. The player can rechoose the numbers that will equal to the dice rolled without included the numbers selected already eliminated before making correct selections. eg. dices rolled a 12, and I choose 3 numbers to eliminate such as 2,4, and 7(that's the total of 13 not equal to dice rolled 12). Then I start over with 3 new numbers that are on the board such as 3, 1, and 8. The board already eliminated 2, 4, and 7 but it will also eliminate 3, 1, and 8. So the 2, 4, and 7 needs to be back on the board. That is the issue ofthe statement if b(d) then b(d)=0 comes in play and possibly b(i)=-1 for each number eliminated on the board.

    Happy programming,

    Cedric T. Jemison

     
  • Smithdoor

    Smithdoor - 2020-05-01

    I uploaded a Yahtzee game to this site
    It may help to see how i did random
    Now working setting up for mouse

    DaveDave

     
    • Cedric T Jemison

      Is there a better way to randomize a game from picking a range of numbers from -32,000 something to 32,000 something? If I pick the same random number lets say 301, the game will operate the same at the beginning until the user make a choice of eliminating face value of 7 or combination of numbers of equal value like 3 and 4.

      Thanks,

      Cedric T. Jemison

       
      • Smithdoor

        Smithdoor - 2020-05-07

        I started by using time in seconds from time then used random.Which works I did not any dupiltion pattern.
        Now use a on screen dice cup for time with same no dupiltion pattern.
        I am just about finished with Paint YATHZEE. It fully playable at this down make the shaking sounds and saving pass game wins.
        Dave

        Sent from Yahoo Mail on Android

        On Thu, May 7, 2020 at 4:30 PM, Cedric T Jemisonslimvice-9002@users.sourceforge.net wrote:
        Is there a better way to randomize a game from picking a range of numbers from -32,000 something to 32,000 something? If I pick the same random number lets say 301, the game will operate the same at the beginning until the user make a choice of eliminating face value of 7 or combination of numbers of equal value like 3 and 4.

        Thanks,

        Cedric T. Jemison

        Creating TV Show High Roller(Bonus Round Only)

        Sent from sourceforge.net because you indicated interest in https://sourceforge.net/p/pcbasic/discussion/general/

        To unsubscribe from further messages, please visit https://sourceforge.net/auth/subscriptions/

         
        • Cedric T Jemison

          Dave,

          At the beginning of the game, I just use the command line RANDOMIZE TIMER and it serves the purpose not selecting numbers. That command statement is better. No more headache of typing different numbers at the start of the game. I need to remember that command for my football game.

          Thanks again.

          Cedric

           
  • Cedric T Jemison

    More update to this program: Location of the High Roller cover and how much money a player could win. Just like the version on TV (1976). Each number removed off the board worth 100 dollar but all nine numbers clear off the board worth 10 thousand dollars.

     
  • Cedric T Jemison

    Check out my version off High Rollers with a twist in BASIC programs section.

    Cedric T. Jemison

     
    • Smithdoor

      Smithdoor - 2020-05-12

      Just try high rollerWorks great
      Dave

      Sent from Yahoo Mail on Android

      On Mon, May 11, 2020 at 8:07 PM, Cedric T Jemisonslimvice-9002@users.sourceforge.net wrote:
      Check out my version off High Rollers with a twist in BASIC programs section.

      Cedric T. Jemison

      Creating TV Show High Roller(Bonus Round Only)

      Sent from sourceforge.net because you indicated interest in https://sourceforge.net/p/pcbasic/discussion/general/

      To unsubscribe from further messages, please visit https://sourceforge.net/auth/subscriptions/