Skip to content

Instantly share code, notes, and snippets.

View paul-schwendenman's full-sized avatar

Paul Schwendenman paul-schwendenman

View GitHub Profile
@paul-schwendenman
paul-schwendenman / snakes_and_ladders.py
Last active August 12, 2016 05:14 — forked from benhoyt/snakes_and_ladders.py
Calculate the average number of moves in a snakes and ladders game
"""Calculate the average number of moves in a snakes and ladders game.
Because as a parent one gets roped into these board (boring?) games
every so often, and I wanted to calculate the average duration of a
snakes and ladders game. Turns out it's about 36 moves for a
single-player game and 15 moves for a three-player game :-)
> python snakes_and_ladders.py
Played 10000 rounds, averaged 36.0559 moves, max 324 moves, took 0.508s
@paul-schwendenman
paul-schwendenman / snake.py
Created February 14, 2016 16:17 — forked from sanchitgangwar/snake.py
Snakes Game using Python
# SNAKES GAME
# Use ARROW KEYS to play, SPACE BAR for pausing/resuming and Esc Key for exiting
import curses
from curses import KEY_RIGHT, KEY_LEFT, KEY_UP, KEY_DOWN
from random import randint
curses.initscr()
win = curses.newwin(20, 60, 0, 0)
@paul-schwendenman
paul-schwendenman / cee_lo.py
Last active November 11, 2020 20:03 — forked from anonymous/Cee-Lo
Cee Lo dice game
'''
Cee-lo is a gambling game played with three six-sided dice.
'''
from __future__ import print_function
import random
from collections import Counter
def input_float(msg):
'''