Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python
import random
import re
import sys
from collections import defaultdict, namedtuple
from itertools import chain, count
from operator import add
from random import choice
from string import uppercase
#!/usr/bin/env python
import random
import re
import sys
from collections import defaultdict, namedtuple
from itertools import chain, count
from operator import add
from random import choice
from string import uppercase
import random
from collections import defaultdict
def update(input):
counts[input] += 1
def play():
rcounts = {str(v): k for k, v in counts}
return rcounts[max([str(val) for val in counts.values())]]
import random
print "bot 1"
if input is '':
print "input = ''"
else:
print input
output = random.choice(['R', 'P', 'S'])
print "bot 1"
print output
#!/usr/bin/env python
import time
from math import sqrt
def sieve(stop):
'''
That sieve of eratosthenes thing. Implemented directly from the
pseudocode found here:
http://en.wikipedia.org/wiki/Sieve_of_Eratosthenes#Implementation
'''
import time
from math import sqrt
def sieve(stop):
'''
That sieve of eratosthenes thing. Implemented directly from the
pseudocode found here:
http://en.wikipedia.org/wiki/Sieve_of_Eratosthenes#Implementation
'''
stop += 1
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:
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
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
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