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
"""Spelling Corrector. | |
Copyright 2010 Kevin Stock | |
Open source code under MIT license: http://www.opensource.org/licenses/mit-license.php | |
Derived from http://norvig.com/spell.py | |
Prunes the search space by only performing edits that are valid while walking a prefix trie. | |
""" | |
import re, collections |
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 python3 | |
# A 3x3 puzzle: | |
# .....2....2......66..5...8...3..9...89..37..1........7....239.87.2.6.5........... | |
import argparse | |
import math | |
import random | |
import subprocess | |
import sys |
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
# ---------- Primitives ----------------- | |
def circle(r=None, d=None): | |
return _base_object("circle", r=r, d=d) | |
def square(*args, center=True): | |
if len(args) == 1: | |
size = str(args[0]) | |
elif len(args) == 2: | |
size = str(args) |
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
"use strict"; | |
function Part(name, size, deadend, cost, mass, fuel, thrust, iatm, ivac, gimbal, cost_save) { | |
this.name = name; | |
this.size = size; | |
this.deadend = deadend; | |
this.cost = cost; | |
this.mass = mass; | |
this.fuel = fuel; | |
this.thrust = thrust; |
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 python3 | |
from collections import namedtuple | |
from itertools import combinations_with_replacement, groupby | |
import math | |
import operator | |
# FIXME: ban engines over certain length | |
# FIXME: ban 1x of any engine |
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
; define where the screen is | |
:screen .equ 0x8000 | |
; i : hardware id counter | |
set i, 0 | |
hwn j | |
:setup ; inspect all connected devices, setup recognized ones | |
ife i, j | |
set pc, main |
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
; Quicksort | |
; | |
; Jump to qsort w/ A at first element and B at last | |
; A - start | |
; B - end | |
; X - pivot | |
; Y - swap temp |