Skip to content

Instantly share code, notes, and snippets.

View cmgiven's full-sized avatar

Chris Given cmgiven

View GitHub Profile
@cmgiven
cmgiven / maze.es6
Last active August 4, 2016 01:39
An ES6 solution to the challenge: enumerate all configurations of walls within a 4 x 4 grid that would result in a valid maze. In a valid maze, 1. any space must be reachable from any other space and 2. there must be only one path between any two spaces in the maze. This solution can handle up to a 5 x 5 grid.
// Having derived that any valid maze must have one and only one wall emanating
// from each of its inner vertices, we express a given arrangement of walls as
// a bit array with each vertex represented by two bits, corresponding to the
// direction its wall points. The northwest corner of the maze occupies the
// most significant bit, with the remainder of the vertices ordered left to
// right, top to bottom. The represented direction is as follows:
var NORTH = 0b00, // 0
EAST = 0b01, // 1
SOUTH = 0b10, // 2
WEST = 0b11; // 3
@cmgiven
cmgiven / .block
Last active February 27, 2020 20:16
Map to Force-Directed Graph
license: mit
height: 600
@cmgiven
cmgiven / .block
Last active December 22, 2018 14:24
Brushable Scatterplot/Choropleth
license: mit
height: 350
@cmgiven
cmgiven / .block
Last active June 6, 2024 00:30
Treemap Bar Chart
license: mit
@cmgiven
cmgiven / .block
Created August 10, 2016 15:53
Triangular Scatterplot
license: mit
height: 800
@cmgiven
cmgiven / .block
Created August 11, 2016 23:12
Choropleth with Animated Stripes
license: mit
@cmgiven
cmgiven / .block
Created August 12, 2016 12:58
Collatz Conjecture
license: mit
height: 960
@cmgiven
cmgiven / .block
Created August 13, 2016 14:41
Bouncing Logo
license: mit
@cmgiven
cmgiven / .block
Last active March 17, 2024 03:17
Rectangular Collision Detection
license: mit
@cmgiven
cmgiven / .block
Created August 15, 2016 16:11
Demers Cartogram
license: mit
height: 600