![]() |
|
#1
|
||||
|
||||
Dice rolling program (random number generator)Here's a program I wrote for use in my Colonial Marines game. It uses a random number generator to simulate dice rolls. Only a few dice combinations are implemented right now but you can change this program if you want to use it. If you discover any problems with it, please let me know.
Python Code:
__________________
Common Sense v2.0-Striving to make the world a little bit smarter. |
|
#2
|
||||
|
||||
Re: Dice rolling program (random number generator)I changed the program a little bit to make it "programmer friendly". The new version lets the multiDie() function return an integer, rather than just printing the value. This means you can import the module into another program and use the multiDie() value directly. The test() function has also been modified to account for the change. I also included the usual GPL license information for clarity.
Python Code:
__________________
Common Sense v2.0-Striving to make the world a little bit smarter. |
Recent GIDBlog
Toyota - 2008 September Promotion by Nihal
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Converting a number amount to text | Godzilla | C++ Forum | 5 | 31-Mar-2006 11:38 |
| random number generation issues | Jonnyz007 | C++ Forum | 8 | 27-Oct-2005 19:13 |
| Need Help with my Cards Program (C++) | krisopotamus | C++ Forum | 2 | 06-Oct-2005 16:48 |
| Help with interactive program, please | nika1p2 | C Programming Language | 1 | 09-May-2005 00:22 |
| Anyone can write a program code for this??? | chriskan76 | C Programming Language | 1 | 19-Oct-2004 20:25 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The