Skip to main content

Space Travel Tickets

Challenge: On the Math Planet, each alien has a unique ID (Please see the following image). If the ID number is a multiple of 18, the alien will receive a space travel ticket. The object of the activity is to create an algorithm to determine which aliens will receive the tickets, code the VR Robot to send the tickets to the qualified aliens, and count the number of aliens who received the travel ticket. To “send a ticket” to an alien, use the VR Pen to fill the ticket circle under that alien with red. 

  • Download the Space Travel Tickets activity image as a PNG file from this Google slideshow.
  • Select the Art Canvas+ Playground and upload the Space Travel Tickets activity image.
    • To learn more about uploading images to the Art Canvas+ Playground, see this article.
  • Declare a list to store the ID numbers of the six aliens, with each ID number stored as an item in the list.
  • Declare an index variable to represent the item’s position within the list, and set the initial value to 1. 
  • Declare a variable to count and store the number of aliens who received the travel ticket, and set the initial value to 0.
  • Code the VR Robot to drive to the ticket circle under the first alien.
  • Code the VR Robot to “send the tickets” to the qualified aliens, and count the number of aliens who received the travel ticket.
    • Use the index variable to retrieve an ID number of an alien from the list and determine if it is a multiple of 18. 
    • If the ID number is a multiple of 18, use the VR Pen to fill the corresponding ticket circle with red and increase the count variable value by 1.
    • Move the robot to the next ticket circle and increase the index variable by 1 to point to the next item’s position in the list.
    • Use a loop to repeat the above steps for a set number of times to code the VR Robot to check each ID number in the list.
  • Monitor the list value and the variable values in the Monitor Console.
  • Use the [print] block to print the number of aliens who received the travel ticket to the Print Console. 

Helpful Hints

  • Use the remainder block from the Operators category to divide the first value by the second value and reports the reminder. Remainder Block
    • Matching Python command:Remainder Python
  • Use the Equal to comparison operator block from the Operators category to report If the ID number is a multiple of 18. Remainder Equal To
    • Matching Python command:Remainder Equal To Python