Alice Community Random number 1-6

 Random number 1-6
Powerhouse64
Senior Member

Status: Offline
Posts: 54
Join Date: Nov 2011
Location: In ur base, movin ur stuffs
Random number 1-6 - 11-06-2011, 07:30 PM

So, for a programming class, we had an assignment to make a dice simulator. Everyone in the class but me tried using the random number generator, and testing which numbers were closest to 1-6. Rather than be a sheep, I decided to try it in a different way, and this is the result! I am pretty proud of the program, and it works reliably (though the numbers aren't perfectly spaced, they are close enough for each number to have essentially equal chances of being selected). Feel free to try it out, and let me know if you have any improvements. The assignment is long gone, but I'm too much of a perfectionist to leave this program alone, I'd love some suggestions on how to improve its accuracy, or any other aspect!

EDIT: You do have to restart every time you want the program to come up with a new value.
Attached Files
 dice count.a2w (145.9 KB, 35 views)

Hogwarts: Where everything is made up, and the points don't matter

 Mr Kidnapper Senior Member   Status: Offline Posts: 442 Join Date: Feb 2011 11-06-2011, 07:37 PM Mr. Kidnapper doesn't understand how this is a different way.
 Powerhouse64 Senior Member     Status: Offline Posts: 54 Join Date: Nov 2011 Location: In ur base, movin ur stuffs 11-06-2011, 07:45 PM Other kids used random number generators to select a value, then had Alice print out the closest whole number, mine randomly spins an object, then decides which number it is nearest to. Mine has a visual aspect to it that works without having to deal with the silly an infuriating decimal point. It has the same purpose, but it's done in a different (and I would hope, more creative) way. Hogwarts: Where everything is made up, and the points don't matter
 Mr Kidnapper Senior Member   Status: Offline Posts: 442 Join Date: Feb 2011 11-06-2011, 07:52 PM By the way, people in this forum have a tendency to place objects by hand, and it always looks very messy. To avoid this, you have to place objects mechanically. Use the alice click menus and move objects with numbers instead. If you get good at this, it's usually faster than doing it by hand.
 Powerhouse64 Senior Member     Status: Offline Posts: 54 Join Date: Nov 2011 Location: In ur base, movin ur stuffs 11-06-2011, 08:28 PM Well, I used a 12-sided object and placed the center of the number's axis on every other corner. It got the spacing pretty accurate, I think. But since I made this program, I figured out how to place objects by using their coordinates, and I could tidy this program up with that now that you mention it! Thanks! Hogwarts: Where everything is made up, and the points don't matter

 Thread Tools Display Modes Linear Mode

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is Off Forum Rules
 Forum Jump User Control Panel Private Messages Subscriptions Who's Online Search Forums Forums Home Announcements     Community News and Announcements Alice 3     How Do I?     Works In Progress     Share Your World     Share Custom Classes     Bugs and Trouble Shooting     Suggestion Box Alice 2     How do I...?     Works-In-Progress     Share Worlds     Share Objects     Bugs and Troubleshooting     Suggestion Box Educators     Teaching with Alice     Teaching Using Alice 3     Teaching Using Alice 2     CS Principles and Alice     AP CSA and Intro to Java and Alice     Workshops General Discussion     Questions and Comments     The Lounge