Skip to content

Instantly share code, notes, and snippets.

View disser2's full-sized avatar
🏠
Working from home

disser2

🏠
Working from home
View GitHub Profile
@disser2
disser2 / KurveAusGeraden2.pde
Created April 1, 2013 10:58
Really nice curve consisting only out of straight lines
void setup() {
size(900, 900);
noLoop();
}
//Hier kann eingestellt werden, wie nah die Linien beeinander liegen
int dichte = 5;
void draw() {
int a = 1;
@disser2
disser2 / KreiszahlPiMonteCarlo.pde
Last active December 15, 2015 15:49
Calculates Pi by throwing dots randomly at a circle in a square. Monte Carlo method: http://en.wikipedia.org/wiki/Monte_Carlo_method
///Mit diesem Algorithmus kann die Kreizahl Pi über einen Monte-Carlo-Algorithmus genähert werden.
///Die Abbruchveriable der Schleife kann für zusätzliche Genauigkeit erhöht werden
//Großer Kreis wird gezeichnet
void setup(){
size(500,500);
noLoop();
}
@disser2
disser2 / KuchenDiagrammRotating2.pde
Created April 1, 2013 10:51
Rotating pie chart!
void setup(){
size(500,500);
}
float start = 0;
float speed = 0;
void draw(){
speed = 0.1*(mouseX-width/2)/width;
void setup() {
size(900, 900);
smooth();
}
//start parameter
float t = 0;
//density of two lines
float density = 0.05;
@disser2
disser2 / LinienVerfolgungFarbe.pde
Last active December 15, 2015 15:49
Lines follow you everywhere!
void setup() {
size(500, 500);
}
int lineLength = 20;
int interval = 25;
int resolution = 10;
int blue = 0;
int border = 300;
@disser2
disser2 / GameOFLife3.pde
Last active December 15, 2015 15:49
Precedurale version of Conway's Game of Life
//Settings
int size = 400;
float startCellsPercentage = 20;
int framrate = 60;
//Rules for living cells from 0 to 8 neighbours, true = lives on, false = dies
boolean[] aliveCellRules = {
false, false, true, true, false, false, false, false
};