flexible dice
# A flexible dice that can help you making decisions
import random
print("Please insert your choices, press enter and make the dices roll with \"end\"")
Options = []
while "end" not in Options:
Options.append(raw_input(""))
Options.remove("end")
zufallssumme = len(Options)
zufallszahl = random.randrange(zufallssumme)
print "The dice tells you: ", Options[zufallszahl]
Finally, it’s done. I’ve played with the idea of a flexible dice for quite a time, but I’ve finally managed to code it (now that I’m finished I see that it really is no big deal). My goal with this program was a dice with sides the user could define and it should be able to have as many options as wanted. Documented version in German and English is attached to this post. If you want to run this within Linux you probably need the python or python2.5 package provided by the team of your distribution. If you want to use it with Windows, maybe my little guide to cygwin could help you.
Download:
0x_flexible_dice1 English version
0x_flexiblerwuerfel1 German version






