Skip to content

Instantly share code, notes, and snippets.

View CSchoel's full-sized avatar

Christopher Schölzel CSchoel

View GitHub Profile
@CSchoel
CSchoel / labyrinth.pde
Created January 27, 2015 13:23
Labyrinth game with rudimentary Labyrinth generation
//Autor: Christopher Schölzel
class Square {
boolean negotiable; //begehbar oder nicht?
boolean isExit;
Square(boolean negotiable, boolean isExit) {
this.negotiable = negotiable;
this.isExit = isExit;
}
boolean isExit() {
@CSchoel
CSchoel / connect_four.pde
Created January 27, 2015 13:25
Connect four game
//Autor: Christopher Schölzel, Nadja Krümmel
int TYPE_EMPTY = 0;
int TYPE_BLUE = 1;
int TYPE_RED = -1;
class ConnectFour {
float brickWidth = 50;
float margin = 50;
int[][] field;
// 0 = leer, +1 = blau, -1 = rot
ConnectFour(int cols, int rows) {
@CSchoel
CSchoel / fibonacci.pde
Created January 27, 2015 13:27
Three different fibonacci variants with simple performance tests and Stackframe analysis
//Autor: Christopher Schölzel
// -------------------------------------------
// -- Musterlösungen zu Fibonacci-Varianten --
// -------------------------------------------
int fib(int n) {
if (n <= 1) return n;
else return fib(n-2)+fib(n-1);
}
@CSchoel
CSchoel / tree.pde
Created January 27, 2015 13:28
Recursive tree structure with angles depending on mouse position
//Autor: Christopher Schölzel
float angle = 0;
void setup() {
size(400,400);
}
void draw() {
background(255);
@CSchoel
CSchoel / snow.pde
Created January 27, 2015 13:30
Snow falling on a randomly generated mountain
//Autor: Christopher Schölzel
float FRONT_WIDTH = 20;
class Snowflake {
float noiseX;
float noiseY;
float x,y;
float vx,vy;
float w;
Snowflake(float x, float y, float vx, float vy, float w) {
@CSchoel
CSchoel / binary_clock.pde
Created January 27, 2015 13:31
Binary clock
//Autor: Nadja Krümmel
class BinaryDigit {
int[] binary;
int decimal;
BinaryDigit() {
this.binary = new int[4];
this.binary[3] =0;
this.decimal = 0;
}