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
This file contains any messages produced by compilers while | |
running configure, to aid debugging if configure makes a mistake. | |
It was created by glib configure 2.32.4, which was | |
generated by GNU Autoconf 2.69. Invocation command line was | |
$ ./configure --disable-maintainer-mode --disable-dependency-tracking --disable-dtrace --prefix=/usr/local/Cellar/glib/2.32.4 --localstatedir=/usr/local/var | |
## --------- ## | |
## Platform. ## |
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 python | |
"""markov generator to make u feel bad | |
Usage: | |
markov.py [<length>] [--sms=<number>] | |
Options: | |
--help -h show this menu | |
-s NUMBER, --sms=<number> end an sms to a number | |
""" |
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 random | |
from collections import defaultdict | |
def get_words(fname='fyad.txt'): | |
with open(fname) as f: | |
return f.read().split() | |
def triplets(words): | |
for i in xrange(len(words) - 2): | |
yield (words[i], words[i+1], words[i+2]) |
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 random | |
from pprint import pprint | |
from collections import defaultdict | |
def get_words(fname='fyad.txt'): | |
with open(fname) as f: | |
return f.read().split() | |
def triplets(words): | |
for i in xrange(len(words) - 2): |
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 python | |
import random | |
from pprint import pprint | |
from collections import defaultdict | |
def get_words(fname='fyad.txt'): | |
with open(fname) as f: | |
return f.read().split() | |
def triplets(words): |
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 python | |
import random | |
from pprint import pprint | |
from collections import defaultdict | |
def get_words(fname='fyad.txt'): | |
with open(fname) as f: | |
return f.read().strip().split() | |
def triplets(words): |
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 python | |
from string import lowercase | |
from collections import defaultdict | |
from pprint import pprint | |
def coded_vals(): | |
for i, l in enumerate(lowercase): | |
yield l, i+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
#!/usr/bin/env python | |
from string import lowercase | |
from collections import defaultdict | |
def coded_vals(): | |
for i, l in enumerate(lowercase): | |
yield l, i+1 | |
def make_map(code_map): |
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 python | |
from collections import defaultdict | |
import random | |
w, h, m = 15, 15, 20 | |
def coords(x, y): | |
for i in xrange(h+1): | |
for n in xrange(w+1): | |
yield(i, 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 python | |
from collections import defaultdict | |
import random | |
w, h, m = 15, 15, 20 | |
coords = lambda x,y: [(i, n) for i in xrange(h) for n in xrange(w)] | |
mine = lambda m: [random.choice([c for c in coords(h,w)]) for i in xrange(m)] | |
def create_board(w, h, m): |
OlderNewer