top of page

Arrays

Arrays allow multiple items to be stored in just one variable. Imagine arrays as filing cabinets with each item in a numbered drawer, starting from the left. Please note that in arrays, the counting starts at 0 for the first drawer. If you try to call something from part of an array that doesn't exist, nothing will happen. You can also create a while or for loop that uses all items in the array before stopping (see below.) You can also modify arrays so that items are added to them over time or due to user interaction. You could do this by creating a new variable called "newInd" and in your code have it that whenever you e.g. click the mouse on the screen it adds that x or y value to the array as a "newInd++." However, this is a lot of code, instead you can just "push" the new item using the code as seen below. Project: Make it rain.

 
A table of code associated with arrays.
Featured Posts
Recent Posts
Archive
Search By Tags
Follow Us
  • LinkedIn Social Icon
  • Pinterest Social Icon
  • Facebook Basic Square

© 2023 by Coming Soon

Proudly created with Wix.com

bottom of page