This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| size(500, 500); | |
| for (int i = 0; i < width; i++) { | |
| point(i, height * noise(0.01 * i)); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| void setup() { | |
| size(500, 500); | |
| } | |
| void draw() { | |
| translate(width/2, height); | |
| scale(1, -1); | |
| tree(120); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| float[] xs = new float[100]; | |
| float[] ys = new float[100]; | |
| void setup() { | |
| size(800, 800); | |
| frameRate(20); | |
| for (int i = 0; i < 100; i++) { | |
| xs[i] = random(width); | |
| ys[i] = random(height); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| void setup() { | |
| size(500, 500); | |
| fill(0); | |
| noLoop(); | |
| } | |
| void draw() { | |
| gasket(0, 50, 500, 7); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| void setup() { | |
| size(500, 500); | |
| noLoop(); | |
| } | |
| void draw() { | |
| translate(0, 300); | |
| koch(500, 5); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ArrayList<PVector> points = new ArrayList<PVector>(); | |
| void setup() { | |
| size(600, 600); | |
| } | |
| void mouseClicked() { | |
| PVector p = new PVector(mouseX, mouseY); | |
| points.add(p); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| void setup() { | |
| size(500, 500); | |
| fill(0); | |
| noLoop(); | |
| } | |
| void draw() { | |
| fill(0, 128, 0); | |
| noStroke(); | |
| carpet(0, 0, 500, 500, 4); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdlib.h> | |
| #include <stdio.h> | |
| #include <ctype.h> | |
| int e_atoi(char *str) { | |
| enum { ST_START, ST_ZERO, ST_DEC, ST_OCT, ST_X, ST_HEX } state = ST_START; | |
| int result = 0; | |
| for (int c = *(str++); c != '\0'; c = *(str++)) { | |
| switch (state) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (require srfi/1) ; list library | |
| (require srfi/13) ; string library | |
| (require srfi/26) ; cut (function placeholder) | |
| (require srfi/42) ; comprehension | |
| (require srfi/45) ; lazy -- efficient `delay' for tail calls | |
| ;;(require rnrs/hashtables-6) | |
| (require srfi/69) ; hash-table | |
| ;;; | |
| ;;; power modulo: a^n mod m |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| float unit = 10; | |
| void setup() { | |
| size(500, 500); | |
| noLoop(); | |
| } | |
| void draw() { | |
| translate(10, 10); | |
| hilbert(20, 20, 480, 4); |