Skip to content

Instantly share code, notes, and snippets.

@yolfer
yolfer / uno_stacko_die.py
Last active August 29, 2015 14:22
This program simulates the special die that comes with the game Uno Stacko, but with one fun improvement! The physical die always matches a particular number to a particular color. This script randomizes it for more diverse gameplay. It also rolls again for you when it rolls a Reverse.
from random import choice, randint
from termcolor import colored # must be pip installed
def do_roll():
roll = randint(1,6)
if roll < 5:
colors = ['red', 'green', 'blue', 'yellow']
selected_color = choice(colors)
print colored("{} {}".format(roll, selected_color), selected_color)