CSE 5J Lecture Notes - Lecture 4: Ellipse, Floating Points, Pariah Dog

111 views3 pages
School
Course
Professor

Document Summary

In processing, variables can hold different kinds of values and we are required to explicitly define the type of value before we can use a given variable. Int: a big number, -21474783648 to 2147483647 for advanced programs requiring mathematical precision): once a variable is declared, we can then assign it a value by setting it equal to something. In most cases, if we forget to initialize a variable, processing will give it a default value, such as 0 for integers, 0. 0 for floating points, and so on. // your basic setup void setup() { size(200,200); smooth(); } void draw() { // draw the background and the ellipse background(backgroundcolor); stroke(circlestroke); fill(circlefill); ellipse(circlex,circley,circlew,circleh); // change the values of all variables circlex = circlex + change; circley = circley + change; circlew = circlew + change; circleh = circleh - change; circlestroke = circlestroke - change; circlefill = circlefill + change;

Get access

Grade+
$40 USD/m
Billed monthly
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
10 Verified Answers
Class+
$30 USD/m
Billed monthly
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
7 Verified Answers

Related Documents