Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python
from collections import defaultdict
from itertools import repeat
from pprint import pprint
from random import choice
def grid(height, width):
return [['0' for n in range(width)] for n in range(height)]
def place_bombs(grid, n_bombs):
#!/usr/bin/env python
from collections import defaultdict
from itertools import chain, repeat
from random import choice
##################
# Map Generation #
##################
#==============
crawl () {
case "$1" in
"cao" )
user="joshua"
server="crawl.akrasiac.org"
;;
"cdo" )
user="crawl"
server="crawl.develz.org"
;;
crawl () {
case "$1" in
"cao" )
user="joshua"
server="crawl.akrasiac.org"
;;
"cdo" )
user="crawl"
server="crawl.develz.org"
;;
crawl () {
case "$1" in
"cao" )
user="joshua"
server="crawl.akrasiac.org"
;;
"cdo" )
user="crawl"
server="crawl.develz.org"
;;
#!/usr/bin/env bash
log_dir=~/irclogs/crawl
rm ~/names
grep -ir "$1" "$log_dir" | grep -oE "< [[:alnum:]]+>" | grep -ivE "(Henzell|Sequell|Gretell|Sizzell)" >> ~/names
python name_counts.py
from collections import defaultdict
with open("names") as f:
names = [name.strip() for name in f]
counts = defaultdict(int)
for name in names:
counts[name] += 1
Amulet of Cekugob
Amulet of the Air
Amulet of the Four Winds
Armour of the Dragon King
Autumn Katana
Black Knight's Horse Barding
Blowgun of the Assassin
Boots of the Assassin
Bow of Krishna "sharnga"
Brooch of Shielding
Host cao
User joshua
HostName crawl.akrasiac.org
IdentityFile ~/.ssh/cao_key
Compression yes
Host cdo
User crawl
HostName crawl.develz.org
IdentityFile ~/.ssh/cao_key
import time
from math import sqrt
def sieve(stop):
stop += 1
counter = 0
num_list = range(2, stop)
for i in num_list:
counter += 1
if i: