Skip to content

Instantly share code, notes, and snippets.

Anders Nissen anissen

Block or report user

Report or block anissen

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
anissen / StackMachine.hx
Last active Sep 23, 2016
Minimal test of a stack machine
View StackMachine.hx
// Minimal test of a stack machine (
enum Bytecode {
PUSH(v :Int);
class StackMachine {
anissen / UniformPoissonSampler.hx
Created Sep 14, 2016
Fast uniform Poisson sampling
View UniformPoissonSampler.hx
// Adapated from java source by Herman Tulleken
// The algorithm is from the "Fast Poisson Disk Sampling in Arbitrary Dimensions" paper by Robert Bridson
// Code adapted from
typedef Vector2 = { x :Float, y :Float }
anissen / voronoi.lua
Created Sep 8, 2016
Voronoi in pico8
View voronoi.lua
-- grabbed from
function jitter(points)
for i = 1, #points do
p = points[i]
p.x += rnd(2) - 1
p.y += rnd(2) - 1
anissen / Analytics.hx
Created Aug 19, 2016
Testing GameAnalytics REST API integration from Haxe
View Analytics.hx
import haxe.crypto.Base64;
import haxe.crypto.Hmac;
class Analytics {
var game_key :String;
var secret_key :String;
public function new(game_key :String, secret_key :String) {
this.game_key = game_key;
anissen / Main.hx
Created Aug 19, 2016 — forked from po8rewq/Main.hx
Empty haxe / pico-8 project
View Main.hx
package ;
import Pico.*;
class Main
static function main()
onInit = init;
anissen / Main.hx
Last active Jul 6, 2016 — forked from elsassph/ResourceGenerator.hx
Haxe build macro converting a JSON file into strongly typed, inline/dce friendly, properties
View Main.hx
class Main {
public static function main() {
anissen / GeneratorParser.hx
Last active Mar 24, 2016
Parser for simple generative grammar
View GeneratorParser.hx
enum Token {
TSymbol(s :String);
TTerminal(s :String);
TNumber(v :Float);
anissen / Test.hx
Created Mar 7, 2016
Diamond-square algorithm for generating realistic terrain
View Test.hx
class Heightmap {
var size :Int;
var tiles :Array<Array<Null<Float>>>;
var d :Int;
public function new() {
anissen / Perlin.hx
Last active Apr 12, 2016
Animated perlin noise example
View Perlin.hx
class Perlin {
public var repeat :Int;
public function new(repeat :Int = -1) {
this.repeat = repeat;
public function OctavePerlin(x :Float, y :Float, z :Float, octaves :Int, persistence :Float) {
var total :Float = 0;
var frequency :Float = 1;
anissen / GenNew.hx
Last active Feb 23, 2016 — forked from ibilon/GenNew.hx
Object construction with macro
View GenNew.hx
import haxe.macro.Expr;
import haxe.macro.Context;
class GenNew {
macro public static function build () : Array<Field> {
var fields = Context.getBuildFields();
var args = [];
var assigns = [];
for (field in fields) {
You can’t perform that action at this time.