BINGO!!!!!!!!!!!!!!!!!

Bingo!

Creating a Bingo game for my kids, I have 75 menus along with a small script for each of them: (1)mov GPRM 2, 1 (2)exit Pre-Script. Have a CLEAR script incase someone wins and they want to start over, so i put a button on each menu incase this happens and is pointed to this script: (1)GPRM 1, 0 (2)mov GPRM 1, 0 (3)mov GPRM 2, 0 (4) mov B1, 0 (5) mov B2, 0 the (B) in the ball number all the way to mov B75, 0
Now my select Ball script is confusing me a bit ,i have 8 scripts for selecting balls; balls 1-9, balls 10-18, ect... The reason for so many ball scripts is that there are not enough lines to add all 75 balls in one script, so and the end jump of ball 1-9 it goes right to 10-18, everything is working ok, but the thing is that yes it's random from ball 1-9 and so on, it's never really a random game because it has to pick those 9 balls in each script before it goes to the next and so on, my question is, can the ball 1-9, ball 10-18, and so on scripts can those be random as well, so if it's picking a ball from script: balls 1-9 and now is going to pick the next from script: 10-18 and back to script balls 1-9 or to another script because i have 8 ball scripts to choose from or did i go about building this wrong.

Power Mac G5, Mac OS X (10.4.10), 4 GB of Ram

Posted on Jan 1, 2008 12:02 PM

Reply
61 replies

Jan 1, 2008 12:33 PM in response to seemoore

Not quite sure how you scripted, but you could just partition the GPRMS into partitions with values of 0 or 1 which would use 5 GRPMs.

Then generate random number from 1-75, if the GPRM is 1 the number has not been picked, set the GRPM to 0 and go to the menu when number is selected, if the GPRM is 0 then run random again.

Of course there will be a slow down when many of the numbers picked, but unless they are playing a full card game, should not be a problem. 🙂

Other ways of scripting, but this may be the easiest (or most straight forward.)

Jan 1, 2008 12:59 PM in response to Drew13

i have 8 scripts setup like this, 9 balls in each script, like i say it works but not truly random, it has to ask for those 9 balls first and then go to the end jump on line 41 and proceed to the next script with the next 9 balls.
(1) add GPRM 0, 1
(2) Goto 41 if (GPRM 0 >= 10
(3) ran GPRM 1, 65535
(4) mod GPRM 1, 9
(5) Goto 14 if (GPRM 1 = 0)
(6) Goto 17 if (GPRM 1 = 1)
(7) Goto 20 if (GPRM 1 = 2)
(8) Goto 23 if (GPRM 1 = 3)
(9) Goto 26 if (GPRM 1 = 4)
(10) Goto 29 if (GPRM 1 = 5)
(11) Goto 32 if (GPRM 1 = 6)
(12) Goto 35 if (GPRM 1 = 7)
(13) Goto 38 if (GPRM 1 = 8)
(14) Goto 3 if (B1 = 1)
(15) mov B1, 1
(16) jump menu 1
(17) Goto 3 if (B2 = 1)
(18) mov B2, 1
(19) jump menu 2
ECT...........
(41) jump balls 10-18

Jan 2, 2008 9:43 AM in response to Drew13

so i went ahead and deleteed my script because it won't really work correctly like i stated above and i'm using 5 GPRM's. the 4th GPRM i renamed the first 15 GPRM B1, B2, ect.... and then GPRM 5 I15, I16, ect... but not sure if i totally understand how to build the random script to call the balls and keep track of the balls picked, is it kinda like a had in my second post because you had said something about partitioning the GPRM's so that the ones on that have already been picked are 0 and the ones left will be 1, guess i'm just not getting what you stated, read the post regarding this but still having issues. Looking for a bit more help, thanks

Jan 2, 2008 8:33 PM in response to Drew13

Thanks so much Drew for getting back to me, got me off to a great start, have a few more quick questions if i may. I totally scrapped my scripts and build the ones you posted and here is what i ended up with 4 clear ball scripts: 1-24, 25-48, 49-70, 71-75, where should the last clear ball script 71-75 end jump go?
Ball shaker script i built it just like you posted, i see that it only holds 9 balls due to the lack of commands you can add to a script, do i just build more like that one but change lines 18-43 and change it with the next set of balls 10-18 and also lines 2 - 9 do they need to be changed as well.

Now as far as the rest of my assets in DSP, i have 75 menus called B1 - B75. i assume i need a small script for each ball do i build them as: (1)mov GPRM 7, 1 (2)exit Pre-Script. and have that as a pre script for each ball menu.
man i want to thank you for all you help so far, i get so much help from this forum, awesome people on here.

Jan 3, 2008 7:46 AM in response to seemoore

seemoore wrote:
Thanks so much Drew for getting back to me, got me off to a great start, have a few more quick questions if i may. I totally scrapped my scripts and build the ones you posted and here is what i ended up with 4 clear ball scripts: 1-24, 25-48, 49-70, 71-75, where should the last clear ball script 71-75 end jump go?


Would probably go to a menu that says "Start Game" with a button that jumps to Shaker script, or you could just jump to Shaker and have the first ball drawn


Ball shaker script i built it just like you posted, i see that it only holds 9 balls due to the lack of commands you can add to a script, do i just build more like that one but change lines 18-43 and change it with the next set of balls 10-18 and also lines 2 - 9 do they need to be changed as well.


Yes basically. Lines 1 through 9 can come out. You will not need to do a Random again since the number is chosen in Line 1 and no further routing is needed because all the Randoms are handled in Lines 2-8 so everything can shift down with Line 9 being the first line. I guess you can then handle an extra ball or two, but this breakdwon into a few scripts handling 9 was something that was (for me) easier to see/maintain. In the other scripts for the balls the lines that are Goto 1 (if Ball Selected) should be go back to Shaker script

Now as far as the rest of my assets in DSP, i have 75 menus called B1 - B75. i assume i need a small script for each ball do i build them as: (1)mov GPRM 7, 1 (2)exit Pre-Script. and have that as a pre script for each ball menu.


Do not need the pre-script (looking like you are just using that to mark as selected) , the lines such as 19, 21, etc mark the balls as selected. Lines 20, 23, 26 should be set to jump to the menu you want

Let's say Shaker is called

1.) Line 1 makes a Random number, it selects 8
2.) Lines 2-8 do nothing since the conditions are not met (GPRM 7 > 9)
3.) Line 16 sends the script down to line 39 since GPRM 7 = 8
4.) Line 39 checks to see if Ball 8 was previously selected (which it wasn't)
5.) Line 40 marks Ball 8 as selected
6.) Line 41 should then send to your Menu B8

man i want to thank you for all you help so far, i get so much help from this forum, awesome people on here.



FWIW I actually made a better version of this, but running into a bug, probably related to Simulator I would guess more than anything. Lot less code and quicker. Will see if I can get it going

Jan 3, 2008 7:24 PM in response to Drew13

Drew you the man, thanks again for the help, i think i'm getting closer.

Hey on the Ball Shaker script after line 44 should there be a jump to the next ball shaker script. and also you stated to drop the first 9 lines when i build the other ball shaker scripts, should that be the first 8 lines and leave in line (9) Goto 18 if (GPRM 7 = 1)

Where do the 4 clear ball scripts fall into play i have the first jumping to the second and so on but there not pointing at anything else.

sorry one more question, lol

On the Ball shaker script lines 20,23,26,29,32,35,38,41,44 when it jumps to those Menus, i'll set a timeout on the menu and should they timeout back to the original ball shaker script. so it can choose the next ball.

Thanks again Drew

Jan 3, 2008 8:56 PM in response to seemoore

seemoore wrote:
Drew you the man, thanks again for the help, i think i'm getting closer.



Thanks 🙂

Hey on the Ball Shaker script after line 44 should there be a jump to the next ball shaker script.


Yup, you may need to delete the last line though (depending on room for lines)

and also you stated to drop the first 9 lines when i build the other ball shaker scripts, should that be the first 8 lines and leave in line (9) Goto 18 if (GPRM 7 = 1)


Ah yes, first 8 lines, line 9 would be line 1 and goto x if (GPRM = y)
Where do the 4 clear ball scripts fall into play i have the first jumping to the second and so on but there not pointing at anything else.

sorry one more question, lol

On the Ball shaker script lines 20,23,26,29,32,35,38,41,44 when it jumps to those Menus, i'll set a timeout on the menu and should they timeout back to the original ball shaker script. so it can choose the next ball.


You could do it that way, or if you like have a button that says "Pull Next Ball" which jumps to the script. Your call on how you want it.

BTW, started this, but did not finish it quite yet (description), but it is less lines and may be of interest

http://www.dvdstepbystep.com/bingo.php

Thanks again Drew

Jan 5, 2008 6:07 AM in response to seemoore

Hey Drew that's pretty cool, might have try that build as well, but still trying to finish up the original Bingo game. I think i have pretty much have everything build: Main Menu called "Begin Game" which has 1 button called "Start" that jumps to "ballShaker_1" which has an end jump to BallShaker_2 and so on, i think i will take your advise and put a button on all my Ball Menus and not have it timeout to go back to BallShaker_1 just have the buttoncalled pull next ball.
On ball menus 1-9 should the pull next ball go back to ballshaker_1 and on the Ball Menus 10-18 jump back to BallShaker_2 script or since it's keeps track of all balls pulled should all the ball menus just go back to BallShaker_1.

Those 4 other scrips named clearballs 1-24, clearballs 25-48, clearballs 49-70, clearballs 71-75, where are these scripts used, all i have right now is end jumps from the first clearballs to the next and so on.

Thanks again Drew,

Jan 5, 2008 7:12 AM in response to seemoore

seemoore wrote:
On ball menus 1-9 should the pull next ball go back to ballshaker_1 and on the Ball Menus 10-18 jump back to BallShaker_2 script or since it's keeps track of all balls pulled should all the ball menus just go back to BallShaker_1.



Should go back to the first script where the random will pull one of the 75 balls

Jan 5, 2008 2:54 PM in response to Drew13

ok, must have messed up some where.
i have a menu called begin 2 buttons, (1) start game and that button is connected to my first ball shaker_1, it doesn't seem to do anything. ballshaker_1 is connect to ballshaker_2 and so one to ballshaker_9 and that one's end jump goes back to ballshaker_1 when i hit it, just sits, the other button (2) is connected to clear ball_1 and i can see everything getting reset to 1 when i click on that.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

BINGO!!!!!!!!!!!!!!!!!

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.