Close
Close full mode
logoMakeCode AP CSP

Arrays Practice Programs

Activity

Create the following programs to practice using arrays in your programs:

Tasks

Arrays Challenge 1

  1. Create a game that uses Arrays of images.
  2. Randomly spawn an image from the array.
  3. Use an array to animate a sprite.

Shared project link:


Arrays Challenge 2

  1. Create a game that mimics a Slot Machine.
  2. Create a text array of different fruit and 7.
  3. On Button A pressed, pick 3 random values from the array to display.
  4. If the user gets a match – display β€œMatch!”
  5. If the user gets 7 7 7 – display β€œJackpot!”

Shared project link:


Practice Program 3

  1. Create a Magic 8 Ball game to tell people’s fortunes.
  2. Create a list of phrases that are random responses to user questions (Yes, Never, It is likely, etc.).
  3. Once you’ve finished your game, use the Exam Reference Sheet (ERS) to recreate the Array functions, and to remove each phrase after it is used.

Shared project link:


Reflection/Homework

  1. What challenges did you have when creating the Array practice programs?
  2. What could you modify or add to improve the program?
πŸ“˜ Unit 5 - AAP Part 2 β€” Previous
Arrays Practice
Next β€” πŸ“˜ Unit 5 - AAP Part 2
Day 18