This file contains hidden or 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
from itertools import chain | |
from math import sqrt | |
from random import random | |
import drawille | |
def wrap(x, low, high): | |
if x > high: | |
return low |
This file contains hidden or 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
Object.defineProperty(Number.prototype,Symbol.iterator,{ | |
*value({ start = 0, step = 1 } = {}) { | |
var inc = this > 0 ? step : -step; | |
for (let i = start; Math.abs(i) <= Math.abs(this); i += inc) { | |
yield i; | |
} | |
}, | |
enumerable: false, | |
writable: true, | |
configurable: true |
This file contains hidden or 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
import sys | |
import numpy as np | |
import scipy.ndimage as nd | |
from scipy.cluster.vq import vq | |
from scipy.misc import imsave | |
def crayola_9(): | |
""" | |
Palette of the first 8 crayola colors + white | |
""" |