Assignment Instructions
Review these four parts and complete your assignment.
Find additional resources and assistance here.
NOTE: AI use for writing code or answering
questions in the pre-work form is not permitted
- 1 Sign up for p5.js
- 2 Write your code
- 3 Check your work
- 4 Submit your work
Sign up for p5.js
Write your code
– a comment (using comment notation) at the top of your file explaining what your drawing or animation should look like or do
– a variable
– a conditional (example: an if statement),
– a loop (example: a for or while loop),
– a unique function (a block of code you’ve named, and called in the
The default draw() function does not count as the unique function
Check your work
– Add your code inside the draw() function and/or below the draw() function. You MUST have the draw() function in your code for the code to run.
– You MUST leave the setup() function as is. You can make the Canvas larger than the default 400 by 400 size.
– Be sure you have checked and tested your work to verify that it meets the above requirements and looks and behaves how you expect.
– Use the console section (under the code section) to troubleshoot any problems.
Submit your work
Optional Khan Academy Tutorial (recommended for beginners)
If you are new to coding, we suggest you complete the Khan Academy’s Intro to JS course before attempting the pre-work assignment. Code the Dream uses the flipped classroom model, where you learn most new material at home, then practice it in mentor sessions. The following tutorial from Khan Academy is a good way to get used to this approach.
To get started with the tutorial:
- Sign up for a free Khan Academy account
- Complete the 18 lessons in Unit 1: Intro to JS: Drawing and Animation
The Unit 1: Intro to JS: Drawing and Animation tutorial covers all skills required to complete the pre-work, which you will also review in Intro to Programming. As you work, focus especially on concepts tied to the pre-work deliverables: variables, conditionals, loops, and functions.
As a reminder, this step is optional – we will not see your progress, and if you already feel confident with JavaScript, complete the Assignment Instructions section above. You also don’t need to move beyond Unit 1 – we cover those additional concepts in Intro to Programming.
Optional Khan Academy Tutorial (recommended for beginners)
Submission Instructions
Make sure you have ALL of the following:
- A variable
- A conditional statement (ex. an “if” statement)
- A loop (ex. a “for” or “while” loop)
- A unique function ( a block of code you’ve name and called in the draw( ) function). REMINDER: The default draw() function does not count as the unique funtion.
Test your code to be sure the preview (right) side of the page is showing the drawing or animation you have created.
Make sure that you have copied the correct link to your assignment. The link should look like this:
https://editor.p5js.org/yourUsername/sketches/someLettersOrNumbers
To submit your pre-work complete the following form:


