programming_fundamentals_with_processing:ch03-places-to-put-things
Differences
This shows you the differences between two versions of the page.
Next revisionBoth sides next revision | |||
programming_fundamentals_with_processing:ch03-places-to-put-things [2017/07/26 17:49] – created mithat | programming_fundamentals_with_processing:ch03-places-to-put-things [2017/07/26 17:53] – [Math versus programming] mithat | ||
---|---|---|---|
Line 16: | Line 16: | ||
$a = b + 20$ | $a = b + 20$ | ||
- | If I asked you what the value of $a$ is, you would probably reply " | + | If I asked you what the value of $a$ is, you would probably reply " |
Let's now look at a Processing program that does what the mathematics example above does. | Let's now look at a Processing program that does what the mathematics example above does. | ||
- | **program '' | + | <file java variables1.pde> |
- | + | ||
- | <code java> | + | |
void setup () { | void setup () { | ||
int a; | int a; | ||
Line 30: | Line 28: | ||
a = b + 20; | a = b + 20; | ||
} | } | ||
- | </code> | + | </file> |
The second part of the example probably makes sense to you. It's really just the mathematical expressions with semicolons tacked onto the ends. (Remember that the end of a statement in Processing must be marked with a semicolon.) But you might be confused about the lines that begin with '' | The second part of the example probably makes sense to you. It's really just the mathematical expressions with semicolons tacked onto the ends. (Remember that the end of a statement in Processing must be marked with a semicolon.) But you might be confused about the lines that begin with '' | ||
Line 40: | Line 39: | ||
)) | )) | ||
- | Processing' | + | Processing' |
- | )) So, in the above example, you could have written: | + | |
<code java> | <code java> | ||
Line 50: | Line 48: | ||
a = b + 20; | a = b + 20; | ||
</ | </ | ||
+ | |||
as well. | as well. | ||
programming_fundamentals_with_processing/ch03-places-to-put-things.txt · Last modified: 2017/07/26 18:06 by mithat