Skip to content

Instantly share code, notes, and snippets.

PVector[] pnts;
int[] cols = {#530c0c, #8f0e0e, #fa7e0a, #f7f6de};
public void setup() {
size(540, 540);
pnts = new PVector[5];
for (int i = 0; i < pnts.length; i++) pnts[i] = new PVector();
noSmooth();
loadPixels();
}
@FreedomGrenade
FreedomGrenade / gol5.pde
Last active April 17, 2016 12:10
Game of life 5x5
// 5x5 Game of life, by Freedom_Grenade
// s save grid state / selection as image
// ctrl + left click = paste input
// '.' load input
// shift rightclick = select
int[] vals;
int[] oldvals;
int[] sums;
long max;
int[][] livedie;
import java.util.*;
PGraphics pen, colors;
ArrayList<Streamer> streamers;
int pmX, pmY;
int density = 2;
int maxlife = 200;
int hue = 127;
int brt = 127;
boolean menu;
PShape sierp, lightShape;
Col[] cols;
float cubeRot, cubeSize;
float isoAngle;
int lights;
LightInfo[] lightlist;
public void setup() {
size(500, 500, P3D);
PShape cube;
PShape hovercube;
Board b;
PVector tempMove = new PVector();
boolean menuUp;
boolean win;
int newBoardSize;
int newLevelSize;
public void setup() {
// Occasionallly massive slow down due to ...? http://en.wikipedia.org/wiki/Denormal
Grid gri;
int tm;
public void setup() {
size(800, 800);
colorMode(HSB, 1.0, 1.0, 1.0);
// Da, Db, diffusion rates for a, b
// f = feed, k = kill
PVector circle0, circle1; // x,y = centre, z = radius
PVector para0, para1, para2, para3; // x,y = focux, z = directrix (ie y = z)
float line, flip;
public void setup() {
para0 = new PVector();
para1 = new PVector();
para2 = new PVector();
para3 = new PVector();
size(800, 800);
circle0 = new PVector(width/2, height/2, 200);
// Mouse left to toggle cam change on/off
// Other to toggle transformations
public void setup() {
size(500, 500, P3D);
textSize(50);
}
boolean cam = true;
boolean tran = true;
import java.util.concurrent.atomic.*;
AtomicInteger threadCount;
int startTime;
int tTime;
int sorts;
int numbers = 100000000;
int[] h;
public void setup() {
size(1000, 100);
tTime = 0;
import java.util.*;
PImage img;
int num = 15000;
ArrayList<PVector> pRank;
color silver = color(246, 246, 250);
color dblue = color(112, 83, 145);
color dblue2 = color(185, 181, 252);