Snap Projects, March 8, 2012, Cardinal Forest Elementary School
Snap website
Snap is available online - about Snap.
back to more Snap! projects
Lists in Snap!
 
- Make a new variable called "mylist"
  
 
 
- Set your list variable to an empty list:
  
 
 
- An empty list is made with the list block:
  
 
 
- Use a repeat block to put ten random numbers in your list.
  
 
Use random numbers between 1 and 100:
 
  
 
 
- Click on the blocks and see the list created:
  
 
 
- Now print out each number in the list.  Use a counter variable called "i":
  
 
 
- Set "i" to 1.  
  
 
The counter variable "i" starts on 1.
 
  
 
 
- Go through the list using a repeat block, it runs for the length of the list
  
Repeat "length of list" times
 
  
 
 
- Say each item i of mylist for 2 seconds.
  
 
 
  
 
 
- Change the counter "i" by  1 to go to the next number in the list:
  
 
 
- Read the blocks, can you understand how this works?
  
 
 
- Run the blocks
  
 
 
- Now try to put the word "dinosaur" into a list of letters:
