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 | |
# Stupid Python program that runs Go code. | |
import requests | |
import sys | |
import string | |
def run_go(src): | |
payload = {"version":2, "body": src} |
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 sys | |
idx = 0 | |
lit = 1 | |
ops = { | |
("and", (idx, idx)): 0x0, | |
("and", (idx, lit)): 0x1, | |
("or", (idx, idx)): 0x2, | |
("or", (idx, lit)): 0x3, |
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/python | |
grid = [[8,8,4,4,5],[4,9,6,4,8],[8,6,4,1,2],[4,8,2,6,3],[0,6,8,8,4]] | |
seen_locations = [] | |
def next_location(loc): | |
if loc[0]: | |
yield (loc[0] - 1, loc[1]) | |
if loc[1]: | |
yield (loc[0], loc[1] - 1) | |
if loc[0] < 4: | |
yield (loc[0] + 1, loc[1]) |