Skip to content

Instantly share code, notes, and snippets.

@coleo94
coleo94 / YAHTZEE.py
Created August 15, 2016 19:57
YAHTZEE.py
from random import randint
class Table (object):
def __init__(self, points=0, rolls=0, slots=None, plays=None, possible=None, dice=None, scored=None, recent_pts=0, recent_dict=None):
if slots is None:
slots = {}
if plays is None:
plays = []
if possible is None:
@coleo94
coleo94 / YAHTZEE.py
Created August 15, 2016 00:31
YAHTZEE.py
from random import randint
class Table (object):
def __init__(self, points=0, rolls=0, slots=None, plays=None, possible=None, dice=None):
if slots is None:
slots = {}
if plays is None:
plays = []
if possible is None:
@coleo94
coleo94 / YAHTZEE.py
Created August 12, 2016 18:45
YAHTZEE.py
from random import randint
class Table (object):
def __init__(self, points=0, rolls=0, slots=None, plays=None, possible=None, dice=None):
if slots is None:
slots = {}
if plays is None:
plays = []
if possible is None:
@coleo94
coleo94 / YAHTZEE.py
Created August 12, 2016 18:33
YAHTZEE.py
from random import randint
class Table (object):
def __init__(self, points=0, rolls=0, slots=None, plays=None, possible=None, dice=None):
if slots is None:
slots = {}
if plays is None:
plays = []
if possible is None:
@coleo94
coleo94 / gist:7fc67bbcd7680aab42fe5be1671ec02e
Last active October 12, 2023 01:29
Python Yahtzee Game
from random import randint
def singleGame():
roll1 = roll()
print(format("You rolled: ", '64s'), roll1)
print("")
holdPrompt = input("Swap any dice? (y for HITME, n for HOLD): ")
print("")
holdPrompt.replace(" ", "")
@coleo94
coleo94 / blackjack.py
Created June 15, 2016 04:39
blackjack.py
from random import randint
def main():
print("Welcome to blackjack!")
start = input("Type x to begin: ")
start.strip()
start = start.lower()
while start != "x":
print("Invalid input.")
start = input("Type x to begin: ")