top of page
  • Writer's pictureYang Xu

P5 JS For Loop

Updated: Oct 4, 2021



https://editor.p5js.org/nunuyangxu/sketches/qaqkHTgAy


 

Worksheet


1. Create 20 columns that turn red when you hover over them.

https://editor.p5js.org/Mollysun99/sketches/miq9AkwvO


2. Add to Q1:

a. Skip over col #7.

https://editor.p5js.org/Mollysun99/sketches/pBDMSvBoy

b. Make the left half turn blue, right half turn red.

https://editor.p5js.org/Mollysun99/sketches/Ptt2qzTpG

c. Make every other column blue.

https://editor.p5js.org/Mollysun99/sketches/bowYG6HxR

d. Make every other column blue.

https://editor.p5js.org/Mollysun99/sketches/482gmswDb


3. Create a grid of 100 cells that turn red when you hover over them.

https://editor.p5js.org/Mollysun99/sketches/jrEqz2Btg


4. Challenge: Create a checkerboard grid of 100 cells.

https://editor.p5js.org/Mollysun99/sketches/Gdn__Tw2g

63 views0 comments

Recent Posts

See All
bottom of page