Skip to content

Instantly share code, notes, and snippets.

@robinhouston
robinhouston / universal-tartan.py
Created March 4, 2014 21:01
A 4096×4096 image containing each RGB value once (h/t allrgb.com). Z-order traversal of RGB cube mapped to z-order traversal of 4096×4096 square.
from PIL import Image
def splitnum(k, x):
parts = [0] * k
for n in range(24):
parts[n % k] |= ((x >> n) & 1) << (n // k)
return tuple(parts)
im = Image.new("RGB", (4096, 4096))
pix = im.load()
@robinhouston
robinhouston / README.md
Last active August 29, 2015 14:02
Black and white and red all over

Random noise at first, but leave it running for 5–10 minutes and it will slowly become more interesting.

Notionally a numerical solution of a system of differential equations, but the “checkerboard” solution is presumably an artefact of discretisation.

Suggested by Cornus Ammonis

@robinhouston
robinhouston / README.md
Last active August 29, 2015 14:02
Close-up of the chequered grid
@robinhouston
robinhouston / README.md
Last active August 29, 2015 14:02
Ammonis worms
@robinhouston
robinhouston / README.md
Last active August 29, 2015 14:02
Ammonis worms up close and personal
@robinhouston
robinhouston / README.md
Last active August 29, 2015 14:02
Worms 2

This is Cornus Ammonis’s new variant on the worms, from here. Click to magnify.

@robinhouston
robinhouston / README.md
Last active August 29, 2015 14:03
FitzHugh-Nagomo maze generator
@robinhouston
robinhouston / README.md
Created June 27, 2014 20:38
Interactive maze generator

Click and drag to seed.

@robinhouston
robinhouston / index.html
Last active August 29, 2015 14:03
Test case for Safari fullscreen bug
<!DOCTYPE html>
<meta charset="utf-8">
<title>Cut-down fullscreen bug test</title>
<script src="http://d3js.org/d3.v3.min.js" charset="utf-8"></script>
<style>
body { margin: 0; font-family: sans-serif; }
#main { position: absolute; margin: 12px; width: 600px; }
#canvas { position: relative; top: 20px; width: 400px; height: 200px; margin: auto; border: 1px solid #666; }
#canvas #ball { position: absolute; left: 0; top: 90px; width: 20px; height: 20px; border-radius: 10px;
@robinhouston
robinhouston / superpermutation.txt
Created August 19, 2014 18:20
A superpermutation on six symbols of length 872
12345612345162345126345123645132645136245136425136452136451234651234156234152634152364152346152341652341256341253641253461253416253412653412356412354612354162354126354123654132654312645316243516243156243165243162543162453164253146253142653142563142536142531645231465231456231452631452361452316453216453126435126431526431256432156423154623154263154236154231654231564213564215362415362145362154362153462135462134562134652134625134621536421563421653421635421634521634251634215643251643256143256413256431265432165432615342613542613452613425613426513426153246513246531246351246315246312546321546325146325416325461325463124563214563241563245163245613245631246532146532416532461532641532614532615432651436251436521435621435261435216435214635214365124361524361254361245361243561243651423561423516423514623514263514236514326541362541365241356241352641352461352416352413654213654123