![]() |
|
|
|
Thread Tools | Display Modes |
|
|
|
|
#1 |
|
Newbie
Join Date: Apr 2008
Posts: 8
Rep Power: 0
![]() |
Ten sided die simulator.
Hello everyone! This is the first time I have really tried to program, so I'd like to apologize in advance if the code I'm about to present is god-awful. Here's the basic idea, A certain # of 10 sided dice (w/ values 1-10) will be rolled, if the resulting number on any die is above a certain threshold it will be recorded and if it above another threshold then it will be recorded, and "rolled" again.
For example If I instructed it to roll 5 dice with a threshold of 8 and a repeat of 10 and the results were: 1,3,7,10,8 the program would tally the 2 successes and "roll" the ten again resulting in a 9, there would then be 3 successes and the program would end and output the tally to a text area. So far I have an almost functional program, the current issue is that it will only allow the generation of one # at a time. If more then one "roll" is requested, or it hits the again threshold when rolling 1 die it will run forever. Just so you know I'm implementing it into a GUI, but for simplicity's sake I'll leave that code out. And if it matters I'm working in the Net Beans IDE. java Syntax (Toggle Plain Text)
Thank you in advance you your help, any advice is much appreciated. |
|
|
|
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| cache simulator..PLZ HELP | Natsoumi_Maya | C | 0 | Apr 25th, 2008 3:41 AM |
| Network Simulator design | renato | Software Design and Algorithms | 2 | Dec 11th, 2007 10:54 PM |
| GPS Simulator alogorithm | fisherking | C++ | 10 | Apr 28th, 2006 3:39 AM |
| Starship Combat Simulator | ChiHappens | Existing Project Development | 7 | Feb 14th, 2006 4:59 PM |