This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
from collections import defaultdict | |
from fractions import Fraction | |
from functools import reduce | |
from math import comb | |
def lhs(): | |
return Fraction(comb(5, 2), comb(10, 2)) | |
def rhs(): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Wrath of God (5ED) | |
Tibalt's Rager (WAR) | |
Helm of Obedience (ALL) | |
Rattleclaw Mystic (KTK) | |
Ashiok, Nightmare Muse (PTHB) | |
Fighter Class (AFR) | |
Niblis of Frost (EDM) | |
Hydra Broodmaster (JOU) | |
Pink copper mug | |
Bottle of Drizzt Mist soda |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# OPTIONS_GHC -Wno-tabs #-} | |
import Data.List | |
import Data.Ratio | |
-- https://fivethirtyeight.com/features/are-you-clever-enough/ | |
-- calcEV n = expected value of playing the game, rolling n dice | |
calcEV :: Integer -> Rational | |
calcEV 0 = 0 -- base case | |
calcEV n = ev |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
from vector import Vector | |
from math import sqrt | |
import sys | |
class NoBounce(Exception): | |
def __init__(self, side): | |
self.side = side | |
def bounce_line(p, v): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import itertools | |
CX = 6 | |
CY = 3 | |
def neighbours(x, y, ignoredirection=None): | |
""" | |
Find all points that are connected to the supplied point. | |
Can pass the direction of the previous leg, to ensure that |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
__all__ = ['number_words'] | |
WORDS = ["zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten", "eleven", "twelve", "thirteen", "fourteen", "fifteen", "sixteen", "seventeen", "eighteen", "nineteen"] | |
TENS = [None, None, "twenty", "thirty", "forty", "fifty", "sixty", "seventy", "eighty", "ninety"] | |
THOUSANDS = { | |
False: [None, "thousand", "million", "billion", "trillion", "quadrillion", "quintillion" "sextillion", "septillion", "octillion", "nonillion", "decillion", "hendecillion", "dodecillion", "tridecillion", "tetradecillion", "pentadecillion", "hexadecillion", "heptadecillion", "octadecillion", "enneadecillion", "icosillion"], | |
True: [None, "thousand", "million", "milliard", "billion", "billiard", "trillion", "trilliard", "quadrillion", "quadrilliard", "quintillion", "quintilliard" "sextillion", "septillion", "septilliard", "octillion", "octilliard", "nonillion", "nonilliard", "decillion", "decilliard", "hendecillion", "hendecilliard", "dodecillion", "dodecilliard", "trideci |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
SHOWS = { | |
'astc': "A Switftly Tilting Cameron", | |
'gamehaus': "Adam's Gameha\u00FCs", | |
'backlog': "Beej's Backlog", | |
'bop': "Book of Passwords", | |
'ckpt': "CheckPoint Plus", | |
'crossing': "Crossing the Streams", | |
'gplp': "GPLP", |