This file contains 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
//Scale your shapes up without them moving all over the place! | |
float scalingFactor = 1; | |
float x = 100; | |
float y = 200; | |
float w = 40; | |
float h = 30; | |
void setup() | |
{ |
This file contains 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
/* | |
Computational Design! | |
Title: | |
Imagined, Designed, and Programmed by: | |
Date: | |
Description: <(example, replace text in <>s)This app enables you to create your very own custom pompom makers and export them | |
to make on a lasercutter! Use the sliders to change the size and inside-to-outside ratio | |
of the pompom makers.> |
This file contains 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
/****************** | |
Activity: Exploring a Fractal Tree! | |
Ported to Processing from a BJC Snap activity: http://bjc.berkeley.edu/bjc-r/cur/programming/recursion/tree/recursive-tree-part-1.html | |
Finish as many of these as you can. They are in approximate order of difficulty, but you can do them in any order, at your own pace. | |
1. Change the left tree to a different color (of your choice). Look for setPenColor for turtle1. | |
2. Change the parameters of the tree function to make the left tree have 1 level (modify the line of code marked with ***2***). | |
3. Change the parameters of the tree function to make the left tree have 0 levels. |
This file contains 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
/****************** | |
Activity: Exploring a Fractal Tree! | |
Ported to Processing from a BJC Snap activity: http://bjc.berkeley.edu/bjc-r/cur/programming/recursion/tree/recursive-tree-part-1.html | |
Finish as many of these as you can. They are in approximate order of difficulty, but you can do them in any order, at your own pace. | |
1. Change the left tree to a different color (of your choice). Look for setPenColor for turtle1. | |
2. Change the parameters of the tree function to make the left tree have 1 levels (modify the line of code marked with ***2***). | |
3. Change the parameters of the tree function to make the left tree have 0 level (modify the line of code marked with ***2***). |
This file contains 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
//Make and export a hypotrochoid as a vector (PDF) | |
import processing.pdf.*; | |
import java.util.Date; | |
float R = 200; //the outer gear number of teeth | |
float r = 96; //the inner gear number of teeth | |
float d = 60; //the pen distance as a percentage of the radius | |
Date date = new Date(); |
This file contains 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
/* | |
Hi there!! You should probably not read this code for learning because it is not a good example | |
in a variety of ways! It was written in a hurry. Also Processing/Java, while being | |
great for many reasons, is a really terrible language to write code-that-generates-code in (IMHO). | |
But! You should /run/ this code for learning. :) | |
-Natalie Freed, Nov 2013 | |
*/ |
This file contains 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
/* | |
Use the program at https://gist.github.com/nataliefreed/871cd281839a2408f008 | |
to create a CometLander class and add it to make this program work | |
The class should have these attributes: | |
-chassisColor (an int) | |
-speed (how many pixels to add per frame as it moves) (a float) | |
-location (where it is on the screen) (a PVector) | |
The class should have these functions: | |
-descend() (returns void) |
This file contains 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
/* | |
Exhibit Invention | |
Title: | |
Imagined, Designed, and Programmed by: | |
Date: | |
Description: | |
This file contains 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
//Use buttons to move from page to page in Processing | |
//Natalie Freed Nov 2014 for Art & Science of Computing | |
import controlP5.*; | |
ControlP5 cp5; | |
String currentPage = "intro"; | |
void setup() |
This file contains 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
//Matching input text against a "correct" text using keyboard input | |
//N Freed for Art and Science of Computing Dec 2014 | |
String inputString = ""; //empty string to begin with | |
String correctString = "candy is delicious"; //the word we are trying to match | |
int index = 0; | |
int fillColor = color(0, 255, 0); | |
String errorMessage = ""; //start with no error message | |
void setup() |