Dice Roller

Hi all,

I created a simple dice roller to handle Feng Shui game nights and make the flow of the game progress faster and smoother.

Below is the code for the script, in Python 3.1.

Currently, it is designed to randomly generate the positive and negative rolls while allowing for the exploding dice on both ends of the spectrum.

#Feng Shui Dice Roller
#Version 1.0
#Derek A. Drake
#7 September 2010

#Purpose: To roll a positive dice (Pos), rerolling sixes, and less a negative dice (Neg)
#also rerolling sixes, and display a total with history

from random import randint

print ("Feng Shui Dice Roller v1.0")
print ("")

posdie = randint (1,6) #Generates the positive dice roll.

if posdie == 6: #Checks for the exploding dice
positeration = 1 #If yes, then it will roll a bonus die
print ("The Positive Dice is: ", posdie) #Outputs the positive roll
else:
positeration = 0 #If no bonus die
print ("The Positive Dice is: ", posdie) #Outputs the positive roll
totalpos = posdie #Holder for positive die value

while positeration == 1: #Bonus die section
bondie = randint (1,6) #Generates random die roll
totalpos += bondie #Increments the positive total
print ("Bonus Positive Die is: ", bondie) #Outputs the bonus roll
if bondie != 6: #Checks for a non-six roll of the bonus die
positeration = positeration - 1 #Stops the generation of bonus die

print ("The Total Positive Value is: ", totalpos) #Outputs the sum of the positive value

#Code for the negative section mirrors the positive section

negdie = randint (1,6)

if negdie == 6:
negiteration = 1
print ("The Negative Dice is: ", negdie)
else:
negiteration = 0
print ("The Negative Dice is: ", negdie)
totalneg = negdie

while negiteration == 1:
negbondie = randint (1,6)
totalneg += negbondie
print ("Bonus Negative Die is: ", negbondie)
if negbondie != 6:
negiteration = negiteration - 1

print ("The Total Negative Value is: ", totalneg)

print ("---")
SumTotal = totalpos - totalneg #Calculates the overall total of the shot
print ("Your Total Roll is: ", SumTotal) #Outputs the roll total

While I personally don't use or know how to apply Python stuff to a normal html or php site, this is terrific, it is good to see people still making and sharing new content for a game they like and want to help promote and help others to enjoy! I have a site I'm working on that will eventually hopefully be a place for gamers to share gaming resources like this (PDFs, software, scripts, etc) and would like to be able to add it to the site, or have you add it, with your permission - I'll PM you with an address if/when I get it halfway up and working right! Thanks!

Feng Shui play, faster! Is such a thing possible? :smiley:

Ya! It worked pretty damn well, too! Thanks, man! :smiley: