Skip to content
This repository has been archived by the owner on Aug 31, 2021. It is now read-only.

Latest commit

 

History

History
40 lines (27 loc) · 1.45 KB

tuple.md

File metadata and controls

40 lines (27 loc) · 1.45 KB

Tuple

A data structure that groups together a fixed number of items. Unlike an array, the tuple can usually contain items of more than one type. Often used to implement records.

Exercises

Kitchen Calculator

This exercise asks student to create and maintain few functions which use tuples as grouped information to represent different kitchen measurements

  • 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

Track Exercise Changes
Elixir tuples None

Santa's Helper

This exercise asks the student to the student to implement a pair of functions which extract values from tuples, create tuples, and work with named tuple fields.

  • Tuples
  • Extract tuple components
  • Decompose tuples via pattern matching
  • Create and extract components of labeled and unlabeled tuples

Implementations

Track Exercise Changes
Swift tuples None