File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5,30 +5,6 @@ permalink: /walkInNeighborhood-lessons/2 # Give your page a permalink
55published : true
66
77---
8-
9- ``` jsx
10- let x = 25 ;
11- let h = 20 ;
12- let y = 25 ;
13- function setup () {
14- createCanvas (480 , 120 );
15- }
16- function draw () {
17- background (204 );
18- rect (x, y, 300 , h); // Top
19- x = x + 100 ;
20- rect (x, y + h, 300 , h); // Middle
21- x = x - 250 ;
22- rect (x, y + h* 2 , 300 , h); // Bottom
23- }
24- ```
25-
26- ### Updating a value
27- We can also update the value of a variable throughout our code. It can mean one value in a specific context, and then change its value in another.
28-
29- - Replacing the value of a variable
30- - Variables can update themselves with new information - ie. x = x+1; This means that x will keep updating to add 1 to itself.
31- - If using “let,” we can change the variable type. The same variable used for storing numbers can also update to be text or array of values.
328
339# Lesson Plans & Technical Steps
3410## 1. Variables + Animation
You can’t perform that action at this time.
0 commit comments