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
NAME:🏃 | |
TAGS:sprint | |
MONS:orc,urug,mara | |
ITEM:orb of zot,random rune | |
ORIENT:encompass | |
MAP | |
bbbbbbbbb|1b | |
beld=3=2=11=|||{ | |
bbbbbbbbb|1b | |
ENDMAP |
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 Data.Map(Map, fromList, lookup, union) | |
import Control.Monad(msum) | |
fromMay d = (!!0) . foldr (:) [d] | |
mapIns :: (Ord k) => k -> a -> Map k a -> Map k a | |
mapIns k a = union (fromList [(k, a)]) | |
-- | A TM to add 1 to a binary natural. | |
incr :: (Int, [Int], [(Int, Int, Char, Char, Int)]) |
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
from datetime import datetime, timedelta | |
from PIL import Image | |
import twitter | |
def clock_fraction(): | |
'Return time since midnight rescaled to [0, 1); e.g. 0.5 is noon.' | |
now = datetime.now() | |
midnight = now.replace(hour=0, minute=0, second=0, microsecond=0) | |
return (now - midnight) / timedelta(days=1) |
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
Require Arith. | |
Require Le. | |
Inductive Divides k : nat -> Prop := | |
| Divides_base : Divides k 0 | |
| Divides_step : forall n, Divides k n -> Divides k (k+n). | |
Definition Prime (p : nat) : Prop := | |
forall k, Divides k p -> (k = 1 \/ k = p). |
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
function yuyugrep { | |
yuzucol="\x1b[38;5;213m" | |
yukacol="\x1b[38;5;93m" | |
yuicol="\x1b[38;5;221m" | |
chihocol="\x1b[38;5;180m" | |
fumicol="\x1b[38;5;35m" | |
keicol="\x1b[38;5;130m" | |
momcol="\x1b[38;5;38m" | |
ncol="\x1b[0m" | |
grep --ignore-case --color=always $* \ |
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
(* CanHalveEven.v *) | |
Inductive Even : nat -> Prop := | |
| Even_base : Even 0 | |
| Even_step : forall n, Even n -> Even (S (S n)). | |
Check Even_ind. | |
Theorem can_halve_even : | |
forall n, Even n -> (exists k, k + k = n). |
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 | |
# Example: | |
# | |
# % python3 followers-graph.py 0xlynn chordbug | |
# 2017/04/21 224 | |
# 2017/04/22 238 | |
# 2017/04/27 288 | |
# 2017/05/07 328 | |
# 2017/05/08 329 |
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
"Brainfuck Interpreter" by "Lynn" | |
[ Such language in a high-class establishment like this! ] | |
Chapter 1 - Implementation | |
[ These inputs are queried before execution starts: ] | |
The code is a text that varies. | |
The program input is a text that varies. | |
[ These global values describe the state of our machine: ] |
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
K := 5 x^2 + 4 x y + 2 y^2 + 2 x - 4 y + 3 (* Input quadric *) | |
X := Variables[K]; n := Length[X] | |
(* Mathematica's Coefficient[3x+2xy,x] gets us 3+2y. We just want the free term, 3. *) | |
FreeTerm[p_] := p /. Map[# -> 0 &, X] (* p with all variables substituted by 0 *) | |
Co[m_] := FreeTerm[Coefficient[K, m]] (* So Co[x^2] is 5, Co[y] is -4... *) | |
A := Table[Co[X[[i]] * X[[j]]] / If[i==j, 1, 2], {i, 1, n}, {j, 1, n}] | |
B := Table[Co[X[[i]]], {i, 1, n}] |
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
from collections import defaultdict | |
import fileinput | |
import random | |
import re | |
common = """the of and to a in for is on that by this with | |
i you it not or be are from at as your all have an was we | |
will can us i'm it you're i've my of""".split() | |
pronounce = {} |
OlderNewer