Skip to content

Instantly share code, notes, and snippets.

@roxlu
roxlu / fun.cpp
Last active January 5, 2021 08:52 — forked from kizzx2/fun.cpp
Using lua 5.2 with C++
// fun.cpp
// This is for Lua 5.2, for Lua 5.1, see https://gist.github.com/kizzx2/1594905
#include <lua.hpp>
#include <iostream>
#include <sstream>
class Foo
{
@roxlu
roxlu / fun.cpp
Last active August 29, 2015 14:19 — forked from kizzx2/fun.cpp
THIS DOES NOT WORK WITH 5.2
// fun.cpp
extern "C"
{
#include <lua.h>
#include <lauxlib.h>
#include <lualib.h>
}
#include <iostream>
@roxlu
roxlu / README.md
Created February 23, 2014 13:57 — forked from mbostock/.block

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.