Homework John Henry 05 - ITPNYU/ICM-2024-Code GitHub Wiki
ICM Section 05 • Thursdays 12:10PM - 2:40PM EST in Room 407
- Week 1 • Sept 5 • Introduction and Drawing in p5.js
- Week 2 • Sept 12 • Animation with Variables
- Week 3 • Sept 19 • Interaction with Conditionals
- Week 4 • Sept 26 • Repetition with Loops
- Week 5 • Oct 3 • Organization with Functions
- Week 6 • Oct 10 • More Repetition with Classes
- Week 7 • Oct 17 • The DOM: HTML and CSS
- Weeks 8 - 14 • Media
Support
- My Office Hours
- Resident office hours (schedule)
- The Coding Lab (schedule or drop-in help)
- How to ask code-related questions (examples)
Homework Form
Submit all assignments using our homework form
All assignments are due the night before class
Homework Form (Responses)
Sketches from class
Week 1 • Sept 5 • Introduction and Drawing in p5.js
Week 1 Slides
In class:
- Welcome! and introductions
- Course overview
- What is p5?
- p5 web editor
- p5 functions
- Tips for learning to code
- Syllabus / schedule
- What can we do with creative coding?
Resources
-
Digital Color Meter on Macs
Assignment due the night before our next class:
-
DO
-
Create a p5 web editor account.
-
Have a place online to document your creative assignments. This could be a website/blog, Notion page, or even a Google document. If you’re not sure what to use, please reach out to me for help.
-
-
WATCH (BEFORE EXERCISES):
-
(OPTIONAL) if you prefer to READ:
-
Learning to Learn (to program) by Paul Curzon
-
Chapters 1-3 of Getting Started with p5.js cover the same material. Log into the NYU network to read it for free
-
-
PRACTICE • Week 1 Worksheet
-
CREATE • SELF-PORTRAIT
-
Create a "self" portrait using 2D primitive shapes.
-
Think about what a self-portrait means to you. Is it a depiction of what you look like? A bridge between your private and public regard? Or a collection of your lived experiences?
-
Consult the p5 Reference. Add comments to your code to describe the different parts.
-
Submit your assignment on our homework form.
-
-
WATCH (and code along!) (AFTER EXERCISES):
-
(Optional) WATCH • Eyeo 2019 - Amon Millner
-
UNRULY APPROACHES TO EMPOWERMENT, PLAY, AND PROGRAMMING
-
genesis of Scratch programming environment and mention of my Lingo programming language.
-
time: ~40min
-
Week 2 • Sept 12 • Animation with Variables
Week 2 Slides
Week 2 Syllabus Resources
In class:
- Homework review and Questions
- Logging values to the Console
- Introduction to variables
- Animating shapes
- p5's system variables
Video Examples:
- p5js Code! - 2.1 - mouseX,mouseY
- p5js Code! - 2.2 - make your own variable
- p5.js Code! - 2.4 random() - Random Square Design
Variables and Expressions
-
circleX modulo Expressions
-
circleX buttons Buttons to change variables
-
circleX follow An algorithm to follow the mouse
-
reporting variable values, cooridinates and colors
-
TRY: adding specific colors using Color Meter.app
-
remix to demonstrate
- global variables
- local variables
- expressions
- defining your own function
- object literals
- parameter variables
Functions + object literals
Grouping variables into object literals and passing to functions as parameter variables.
Animation using computation
Assignment due the 24-hours before our next class:
-
PRACTICE • Week 2 Worksheet
-
CREATE • Assignment #2 Create a sketch that includes (all of these):
- One element controlled by the mouse.
- One element that changes over time, independently of the mouse.
- One element that is different every time you run the sketch.
You can choose to build off of your week 1 design, but I might suggest starting over and working with one or two simple shapes in order to emphasize practicing with variables. See if you can eliminate all (or as much as you can) hard-coded numbers from the sketch.
- Submit your assignment on our homework form.
-
WATCH, READ, RUN CODE:
-
total time: ~1hour
-
Getting Started with p5: Chapter 5 (Response). | Get Code
Week 3 • Sept 19 • Interaction with Conditionals
Week 3 Slides
Week 3 Syllabus Resources
Additional p5js Resources
- Expressions, variables and loops
- p5js summary
- Make your own!
- Modulo Operator
- example: a % b
- Guest Tutorial #6: The Modulo Operator with Golan Levin
- Object Literals
- example: let a = { b: 1, c: "two" }
- Video Tutorial Objects Literals | ~9mins
- sketch
- Object Literal documentation
- Remix Examples:
- Boolean logic truth tables
- AND &&
- OR ||
- NOT !
- Boolean Algebra Truth Tables
Remix class activity
Assignment due the 24-hours before our next class:
-
PRACTICE • Week 3 Worksheet
-
CREATE • Assignment #3
-
Two roads diverged in a yellow wood, And sorry I could not travel both... Life is full of difficult choices, use conditional statements to control the flow of your programs. Create a sketch that asks people to make difficult choices that have surprising consequences.
-
Which choices are easier, harder? Which choices are false choices?
-
What internal or external factors influence the choice? How do others’ choices affect your choices?
-
What choices surprise you with unexpected outcomes?
-
Can you combine choices to create hard-to-predict results? (Hint: Use && and ||)
-
Work in Pairs Can you divide an idea into two parts and combine those parts? (e.g. One of you codes the input behaviors (if statement) and the other one codes the output behaviors (what to do if it’s true.) Can you swap sketches and riff off of your partner's work? Provide 1 sketch link per pair, however clearly describe who did what in the code.
-
Be sure to cite the source of any material / code you use.
-
Submit your assignment on our homework form.
-
-
WATCH, READ, RUN CODE:
- Coding Train Videos 4.1 - while for
- Coding Train Videos 4.1 - loop nested
- ~23min | Get Code
- Getting Started with p5: Chapter 4.5-4.13 (Variables). | Get Code
- Repetition: Loops Remix
Week 4 • Sept 26 • Repetition with Loops
Week 4 Slides
In class:
- Review worksheet
- Share our homework
- Review conditional statements
- Introduction to loops
- Preview of functions
Examples :
What could the code look like?
Patterns with Loops
-
Resources :
Assignment due the night before our next class:
-
PRACTICE • Week 4 Worksheet
-
CREATE • PATTERNS
-
We humans have a tendency to look for patterns everywhere. We see patterns in nature and on the urban streets of New York. We rely on patterns we’ve detected in life to make predictions and acquire knowledge.
-
Observe, both outside (your surroundings) and inside (your history of thoughts and feelings), make a sketch about a specific pattern you find.
-
Think about how you can tell the unique story of the pattern using code.
-
Be sure to cite the source of any material / code you use.
-
Submit your assignment on our homework form.
-
-
WATCH
Week 5 • Oct 3 • Organization with Functions
Week 5 Slides
Examples:
- Week 5 Syllabus Resources
- Generative Design, Creative Coding on the Web
- Physarum Letters -- jht remix
In class:
-
For-loop review
-
Introduction to arrays
-
Defining and Using Functions
Assignment due the night before our next class:
-
PRACTICE • Week 5 Worksheet - include any questions in your sketch and a note in the document
-
CREATE • Functions
-
Part 1: Functions are the basic unit of labor in your code. Take a sketch you’ve already done and re-organize the code into functional units of labor that you define. You can also conceive of an entirely new world of labor. What kinds of labor does it take to make your sketch run? Add comments and use well named functions and variables to help explain your code.
-
Part 2: Make your sketch canvas size independent. We should be able to adjust the canvas size with reasonable values.
-
Part 3: Pair up with someone to review your code. The reviewer should try to describe how your code works.
-
Be sure to cite the source of any material / code you use.
-
Submit your assignment on our homework form.
-
-
WATCH •
-
Coding Train Videos 7.7 object-communication-2
- about writing classes to create many objects, mouse interacting with those objects, and objects communicating with each other ~1hr 40min
Week 6 • Oct 10 • More Repetition with Classes
Week 6 Slides
In class:
-
hover over algorithm
-
animation cycle using step and delta
-
Object-Oriented Programming -- a revolution
Assignment due the night before our next class:
-
PRACTICE • Week 6 Worksheet
-
CREATE • Arrays and objects allow you to do something new with your programs: keep track of user action over the course of your sketch's execution. Create a sketch that takes advantage of your new skills. The sketch should allow the user to use clicks, key presses, etc. to add new elements to the scene (and potentially to remove them later). Your sketch should use an array of objects.
-
You will have two weeks to work on this creative assignment. For next week prepare a plan for what you hope to accomplish and be prepared to show work in progress.
-
Be sure to cite the source of any material / code you use.
-
Submit your assignment on our homework form.
-
-
WATCH •
- Coding Train Videos 8.1-8.10 - Enter the DOM!(~2 hours)
- Focus on DOM basics, videos 8.1 - 8.4 (~40 minute)
--
Week 7 • Oct 17 • The DOM
Week 7 Slides
In class:
- The DOM
Examples
Assignment due the night before our next class:
-
PRACTICE • Complete previous worksheets
-
CREATE • Complete your array of objects two week assignment.
-
Optional: EXPLORE-CREATE • Add DOM elements (eg. sliders, buttons) to your sketch. The DOM elements should control some key aspect of the sketch. See if you can learn something new about your sketch thru interactive controls.
- Submit your assignment on our homework form.
-
WATCH • Videos: Images/Video 11.1-11.8 - Focus on videos 11.1 and 11.3