Random Number generator for all of you. Also shuffles cards.
I was trying to come up with a solution for creating a random number generator.
Here it is:
http://www.crypes.com/work/RandomSecdTestX2.gameproj.zip
This was a few hard days of work, but it's now very little code. It requires 3 actors, and all you need to do is adjust the Game-Level Attribute of how many numbers there are (1-50) or (5-600). With some tweaking, you can easily make it choose items in a table, or every even number, or whatever. The way it's displayed is so I can see it's using every number given, only once. No repeats. The time delay was solved with the Pusher.
It's extremely well documented. Lot's of notes inside about what each thing does.
the Pusher rules.
I'm not asking $40 for it. If you like it, please donate $1 to bweb@bdowrick.com at paypal. I just saved you a lot of headaches.
for larger number strings (1-1000, or 1-10,000), adjust your Pusher speed. Faster... Stronger... better.....
Here it is:
http://www.crypes.com/work/RandomSecdTestX2.gameproj.zip
This was a few hard days of work, but it's now very little code. It requires 3 actors, and all you need to do is adjust the Game-Level Attribute of how many numbers there are (1-50) or (5-600). With some tweaking, you can easily make it choose items in a table, or every even number, or whatever. The way it's displayed is so I can see it's using every number given, only once. No repeats. The time delay was solved with the Pusher.
It's extremely well documented. Lot's of notes inside about what each thing does.
the Pusher rules.
I'm not asking $40 for it. If you like it, please donate $1 to bweb@bdowrick.com at paypal. I just saved you a lot of headaches.
for larger number strings (1-1000, or 1-10,000), adjust your Pusher speed. Faster... Stronger... better.....
Comments
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Yeah, what you did was not allow the cards enough to get delt before the blocker ran into them. This will give you that error of not having the total cards.
I fixed this, and made it faster.
As the Pusher moves down the row, he changes the start value of the Random(min,max). I know everything behind him has been eaten, so no it's only choosing numbers in the area between the Pusher, and the end.
I'm play with two Pushers (one on each end). It make sit super fast, but I really don't see the need for the extra code, and extra actors. I'm not going to shuffle 10,000 cards. Just under 100 is about right for me.
http://www.crypes.com/work/Random_movie1.mov
Here is a movie of 150 cards getting sorted. No repeats. You can see the pink ones are random, the White are the Pusher's. Even though it looks like he is eating a lot, the random counter is fast.