Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revisionBoth sides next revision
p5js-week-01 [2023/06/30 00:29] reina.chenp5js-week-01 [2023/07/03 03:32] reina.chen
Line 20: Line 20:
  
 Now that you've done that, let's learn more about how it all works. Now that you've done that, let's learn more about how it all works.
 +
 +===== When you have trouble... =====
 +
 +You can use the "share" function in the File menu of the p5js editor to share the code you are working on with a teacher.
 +
 +Another good way to share you code is to put it on Pastebin and share the link with a teacher: https://pastebin.com/
  
 ===== What's a function? ===== ===== What's a function? =====
Line 55: Line 61:
 https://www.programiz.com/javascript/keywords-identifiers https://www.programiz.com/javascript/keywords-identifiers
  
-The __parentheses__ contain the <color black/pink>[[p5js-week-01#what_s_an_argument_what_s_a_variable|arguments]]</color> (arguments are inputs; this is explained more below), and the __curly braces__ contain what the function does. This is like making a toaster!+The __parentheses__ contain the [[p5js-week-01#what_s_an_argument_what_s_a_variable|arguments]] (arguments are inputs; this is explained more below), and the __curly braces__ contain what the function does. This is like making a toaster!
  
 {{:inside-toaster-800px-toaster_filaments.jpg?400|}} {{:inside-toaster-800px-toaster_filaments.jpg?400|}}
Line 83: Line 89:
 ===== What's an argument? What's a variable? ===== ===== What's an argument? What's a variable? =====
  
-<color black/pink>Arguments</color> ([[https://en.wikipedia.org/wiki/Parameter_(computer_programming)#:~:text=In%20computer%20programming%2C%20a%20parameter,as%20input%20to%20the%20subroutine.]]) are the things that you put into function. It's like the uncooked bread in our toaster analogy. +<color black/pink>Arguments</color> ([[https://en.wikipedia.org/wiki/Parameter_(computer_programming)]] ) are the things that you put into function. It's like the uncooked bread in our toaster analogy. 
  
 {{:untoasted-toast-74375_960_720.jpg?400|}} {{:untoasted-toast-74375_960_720.jpg?400|}}
Line 158: Line 164:
 </code> </code>
  
-<color black/yellow>'let'</color> tells the computer to make a <[[p5js-week-01#variables|variable]] with the name that we give it. After we use <color black/yellow>'let'</color> to declare a variable, we can't use <color black/yellow>'let'</color> with the same variable name. This is to protect us. If we want to change the value, we just use the name and the equal sign again, like this:+<color black/yellow>'let'</color> tells the computer to make a [[p5js-week-01#variables|variable]] with the name that we give it. After we use <color black/yellow>'let'</color> to declare a variable, we can't use <color black/yellow>'let'</color> with the same variable name. This is to protect us. If we want to change the value, we just use the name and the equal sign again, like this:
  
 <code> <code>
  • p5js-week-01.txt
  • Last modified: 12 months ago
  • by reina.chen