Skip to content

Instantly share code, notes, and snippets.

@mrphlip
mrphlip / draftpool.txt
Last active June 9, 2022 02:21
Crack-a-pack Draft Pool
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
@mrphlip
mrphlip / riddler_dice.hs
Created August 13, 2021 15:53
Riddler Classic solution for 2021-08-13
{-# 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
#!/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):
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
@mrphlip
mrphlip / numword.py
Created September 11, 2016 04:26
English names for numbers
__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
@mrphlip
mrphlip / showupgrade.py
Created September 12, 2014 15:58
Show upgrade script (lrrbot/#50)
#!/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",