Skip to content

Instantly share code, notes, and snippets.

Mitchell’s best-candidate algorithm generates a new random sample by creating k candidate samples and picking the best of k. Here the “best” sample is defined as the sample that is farthest away from previous samples. The algorithm approximates Poisson-disc sampling, producing a much more natural appearance (better blue noise spectral characteristics) than uniform random sampling.

See also the white-on-black and Voronoi variations of this example.

@chetan51
chetan51 / README.md
Last active August 29, 2015 14:03 — forked from mbostock/.block
Test
@chetan51
chetan51 / riddle-poisoned-bottles.md
Last active December 14, 2015 11:29
Riddle: Poisoned Bottles

You have 1000 bottles and 10 slaves and 10 cups. You have the pick the one bottle out of the 1000 which is poisoned.

Rule: All the slaves need to drink at the exact same time and you only have one attempt.

Find a way to mix the drinks and find the bottle that's poisoned.

@chetan51
chetan51 / index.html
Created November 19, 2012 06:25 — forked from mbostock/.block
Circles
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
</head>
<body>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.js?2.5.0"></script>
<script type="text/javascript">
var w = 960,