Welcome to the Mike Wagman's Python Site.
My big project is a turn based emailable strategy game called Lunacy. It's
a ways from being done, however there are somethings I have done in python
that I do wish to share.
Max Dice - my goal is to create the ultimate dice rolling
software.
There are three parts to this, a command line program,
a dice roller with graphical interface and a dice roller as a python module.
Max Dice came about for two reasons. First I needed a more flexible dice
roller. Secondly it was pointed out to me that a dice roller makes a great
first python program, and they were right. While my code is far from perfect
it was a good learning experience. If you have been thinking about programming
check Python out.
Max Dice is a command line python dice roller. It support the following
options as listed. The statements in parenthesis represent the values (numbers)
that are passed to the program.
(Num of dice)d(dice size)x(number of rolls)f(force re-roll if first roll
is this value or higher)m(number of dice that are automatically set to the
highest dice roll)t(number of low dice to toss)r(re-roll all rolls of this
value or lower)
Also the statement can end with a o or c. o stands for open dice. This is
a accurate open dice and adds the maximum dice roll minus one to the total.
c is classic open dice and just rolls another dice and adds it on. Both open
dice will continue if the new dice also rolls the maximum value.
Examples
4d6x2t1 Roll 4d6 toss the lower dice - do this 6 times
4d6o Roll 4d6 on any 6's roll again
and add them back into the total
5d12x2m1t2r2 Max Out 2d12, roll 3d12 and toss the lowest
of them.
The output shows each dice and it's assigned value as well as the total
so I suggest you experiment with it. This program should run on every
playform that supports python and that is alot of platforms. (Windows, Mac,
Linux, Beos, Dos, AmigaOS, and more)
Secondly - there is the graphical Max Dice roller. This requires wxpython
so it will only work on windows, linux, and Mac.
Maxed Dice are dice that are automatically set to the highest value that
dice can roll.
Tossed dice are the number of low dice that are thrown out.
Reroll High - if a die is higher than this value the first time it is rerolled.
Reroll Low - if a die is lower than this value reroll it (every time it
is this or lower).
Open dice - this is a situation where if the maximum value is rolled additional
dice are rolled. With classic open dice the dice is rerolled and added, with
regular open dice one is subtracted this allows for rolls that equal the maximum
dice size.
Finally there is the max module.
If you import max (with max in the local directory or Python path) you gain
the following 4 routines.
x = max.initplayer(20)
This routine returns an array configured to pass on to the next command.
x = max.nextplayer(x)
This routine modify's the array x[0] contains the value of the next randomly
selected player. If x[0]==0 then all players have been selected.
x = max.rolldice(dice_to_roll,size_dice,maxed_dice,tossed_dice,force_reroll,min_roll,open_status)
dice_to_roll - number of dice to roll
size_dice - size of dice to roll
maxed_dice - number of dice to set to maximum value
tossed_dice - number of low dice to toss
force_reroll - first time - reroll numbers above this
value
min_roll - reroll values below this every time
open_status - if it's 0 - no open dice, 1 classic open
dice, 2 true open dice.
x = max.rolladice(maxroll, reroll, minroll, opentype)
roll one die
maxroll - size of dice to roll
reroll - first time reroll if higher than this value
minroll - reroll this value if rolled less everytime
opentype - same as open _status listed above.
These are free for you to use, orginal author's name must remain in any
program or documentation based on this. If you are just using the module
no credit is needed, however if you are adding to it - you must credit me
with the orginal work.
System requirements
Python , wxPython
Finally the files
Max Dice Files
If you want to reach me you can at
Sorry about the inconvience of not putting a real email link but I get enough
spam as it is.
Why is it called Max - it's my nickname at work.
Please feel free to email me with ideas - my goal is to maintain the best
dice roller on the net.