Skip to main content

Smart Delivery

Challenge: In this game, the VR Robot starts in the center of the Number Grid City. The object of the game is to drive the VR Robot to grid 0 to pick up a secret package, then make a delivery to a randomly assigned number grid. The robot can only drive in directions parallel to the x-axis or parallel to the y-axis. The fastest time wins!

  • Choose and download the Smart Delivery background as a PNG file from this Google slideshow.
  • Select the Art Canvas+ Playground and upload the Smart Delivery background.
  • Create an algorithm to drive the VR Robot to grid 0, then to an assigned grid randomly selected from 1 to 99. 
    • Use a variable to store the randomly selected number.
    • Print the variable value to the Print Console to show the assigned grid number.
    • Use the VR Pen to draw the delivery path using variables to determine the drive distances in the directions parallel to the x-axis and y-axis.
    • Use the [Fill area with color] block to fill in grid 0 and the assigned grid.

Helpful Hints

  • Each square in the Numbered Grid Map measures 200mm by 200mm.
  • The digit in the Ones place of the assigned number determines the number of grids the robot must move in a direction parallel to the x-axis from Grid 0 to reach the assigned grid.
  • The digit in the Tens place of the assigned number determines the number of grids the robot must move in a direction parallel to the y-axis from Grid 0 to reach the assigned grid.
  • Use the pick random block from the Operators category to select an assigned delivery grid number.VEXcode Random block that reads 'pick random 1 to 99'.
    • Matching Python command:

      random.randint(1, 99)
  • Use the remainder block from the Operators category to calculate the digit in the Ones place of the assigned grid number.VEXcode Remainder block that reads 'remainder of assignedGridNumber / 10'.
    • Matching Python command:

      assignedGridNumber % 10
  • Use the floor block from the Operators category to calculate the digit in the Tens place of the assigned grid number.VEXcode Floor Function block that reads 'floor of assignedGridNumber / 10'.
    • Matching Python command:

      math.floor((assignedGridNumber) / 10)