Skip to content

Instantly share code, notes, and snippets.

@kingoflolz
kingoflolz / q1
Last active August 30, 2015 07:45
import re
from xml.etree.ElementTree import Element, SubElement, Comment, tostring
RE_TOKENS = re.compile(r'[()\\/\s]|[a-zA-Z]+')
def tokenize(cat):
return RE_TOKENS.findall(cat)
def hassep(ccg):
from xml.etree import ElementTree
from pprint import pprint
tree = ElementTree.parse('diagram.svg')
out = {}
def walk(node, attribs):
__author__ = 'Ben'
from pprint import pprint
import operator
def shift(seq, n):
n %= len(seq)
return seq[n:] + seq[:n]
class Dice:
from pprint import pprint
from queue import Queue
w = input("Enter configuration: ")
z = w.split(" ")
paths = {}
for t in z:
if "<->" in t:
v = t.split("<->")
__author__ = 'Ben'
from pprint import pprint
budget = int(input("Budget: "))
cartrages = [
]
v = (input("Cartridge: "))
from pprint import pprint
from queue import Queue
w = input("Enter configuration: ")
z = w.split(" ")
paths = {}
for t in z:
if "<->" in t:
v = t.split("<->")
from pprint import pprint
import json
def application(functor, arg, slash):
if functor is None or arg is None:
return None
if '/' in arg or '\\' in arg:
arg = '(' + arg + ')'
arg = slash + arg
if functor.endswith(arg):
res = functor[:-len(arg)]
from pprint import pprint
import json
def application(functor, arg, slash):
if functor is None or arg is None:
return None
if '/' in arg or '\\' in arg:
arg = '(' + arg + ')'
arg = slash + arg
if functor.endswith(arg):
res = functor[:-len(arg)]
from pprint import pprint
import json
def application(functor, arg, slash):
if functor is None or arg is None:
return None
if '/' in arg or '\\' in arg:
arg = '(' + arg + ')'
arg = slash + arg
if functor.endswith(arg):
res = functor[:-len(arg)]
B=None
b=len
t=input
n=range
import json
def k(functor,D,slash):
if functor is B or D is B:
return B
if '/' in D or '\\' in D:
D='('+D+')'