Lucky Leo's Guessing Game


Story

The story facilitates the exploration of tuples in a language.

Your town has an annual carnival with a fan favorite called "Lucky Leo's Guessing Game". The carnival picks a number between 1 and 7 each day. Participants try to guess that number. If they guess correctly, they win whatever prize contained within the slot. Your firm has been tasked with building the storage mechanism for the 7 slots. It can contain local currency, extra carnival tickets, or nothing.

Tasks

This should guide students how to use:

  • Tuples
  • Tuples as grouped information
  • Getting values from a tuple by use of element index
  • Getting values from a tuple using pattern matching
  • Creating new tuples

Implementations