Skip to content

Instantly share code, notes, and snippets.

#include <stdio.h>
#include <sys/mman.h>
#include <stdint.h>
#include <stdbool.h>
static char *start;
static char *code;
// Registers:
// BL: current value of cell
#define CONCAT2(x, y) x ## y
#define CONCAT(x, y) CONCAT2(x, y)
#define COMPONENT(...)
#define DEFEVENT(...)
#define DEFBUBBLE(...)
struct context {
#define DEFCONTEXT(type, name, default) type name;
#include "components.i"
@LiterallyVoid
LiterallyVoid / bsp.js
Created August 16, 2018 20:32
Simple BSP Compiler
var dot = function(x1, y1, x2, y2) {
return x1 * x2 + y1 * y2;
};
var Plane = function(x, y, d) {
this.x = x;
this.y = y;
this.d = d;
};
import sys
f = open(sys.argv[1]).read().split("\n")
o = "[\n"
for l in f:
o += " " + ", ".join(l.strip().split(" ")) + ",\n"
o += "]"
print(o)