This is a Gray-Scott system, using parameters from Karl Sims: F=.0545, K=.062.
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
<!DOCTYPE html> | |
<title>Stumbling blocks</title> | |
<script src="http://bl.ocks.org/robinhouston/raw/6096562/rAF.js" charset="utf-8"></script> | |
<script src="http://bl.ocks.org/robinhouston/raw/6096562/doyle.js" charset="utf-8"></script> | |
<canvas width=960 height=500></canvas> | |
<script> | |
// Initialisation | |
var canvas = document.getElementsByTagName("canvas")[0], | |
context = canvas.getContext("2d"); | |
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
<!DOCTYPE html> | |
<title>Triangular spiral</title> | |
<script src="http://bl.ocks.org/robinhouston/raw/6096562/rAF.js" charset="utf-8"></script> | |
<script src="http://bl.ocks.org/robinhouston/raw/6096562/doyle.js" charset="utf-8"></script> | |
<canvas width=960 height=500></canvas> | |
<script> | |
// Initialisation | |
var canvas = document.getElementsByTagName("canvas")[0], | |
context = canvas.getContext("2d"); | |
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
/* Numerics for Doyle spirals. | |
* Robin Houston, 2013 | |
*/ | |
(function() { | |
var pow = Math.pow, | |
sin = Math.sin, | |
cos = Math.cos, | |
pi = Math.PI; | |
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 | |
TARGET = "cnut" | |
AVOID = { "cnut", "\x63\x75\x6E\x74" } | |
WIDTH = 20 | |
HEIGHT = 10 | |
DIRS = [ (0,1), (1,1), (1,0), (1,-1), (0,-1), (-1,-1), (-1,0), (-1, 1) ] | |
import random |
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
// gcc -g -Wall --std=c99 wilson.c -lpng -o wilson && ./wilson | |
/* Generate a random spanning tree of the RGB cube, and a random | |
spanning tree of the pixel grid, using Wilson's algorithm, then | |
do a simultaneous breadth-first search of these trees to obtain | |
a bijection between the RGB cube and the pixel grid. | |
Inspired by allrgb.com. | |
-- Robin Houston, 2014-03 |
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
sage: %paste | |
def cgfh(cg_plus_fh): | |
for cg in range(1, cg_plus_fh): | |
fh = cg_plus_fh - cg | |
for c in divisors(cg): | |
for f in divisors(fh): | |
yield (c, cg//c, f, fh//f) | |
for r in range(1, 99, 2): | |
cg_plus_fh = (101^2 - r^2)/4 |
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
sage: digits = 3 | |
....: | |
....: for a in range(10^(digits-1), 10^digits - 10^(digits - 1) + 2): | |
....: x = (10^digits + 1)*a - a^2 | |
....: for b in divisors(x): | |
....: if 10^(digits - 1) <= b < 10^digits and 10^(digits - 1) <= x//b < 10^digits: | |
....: print(a, b, "|", x//b, 10^digits + 1 - a) | |
....: | |
100 100 | 901 901 | |
100 106 | 850 901 |
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
/* efmc.c - Even Faster Maze Counter | |
(which actually turns out to be slower, lol) | |
*/ | |
#include <stdbool.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <gmp.h> | |
#include "fmc.h" |
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
import re | |
from rtree import index | |
p = index.Property() | |
p.dimension = 3 | |
ix = index.Index(properties=p) | |
def volume(cuboids): | |
return sum(( |
NewerOlder