##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
Group multiple values without custom structs. Learn pairs for coordinates and tuples for returns.
Section Overview
Basic concept
Construction methods
Reading values
Knowledge check
How operators work
Storing multiple pairs
Two-value container
Automatic ordering
Knowledge check
Key-value pairs
Beyond two elements
Two-value container
Construction syntax
Knowledge check
Compile-time indexing
Automatic extraction
Ordering rules
Knowledge check
Assign to existing variables
Choosing the right tool
Two-value container
Common pattern
Knowledge check
Geometric applications
Representing connections
Storing priorities
Knowledge check
Clean map traversal
When to stop
Two-value container
Avoiding copies
Knowledge check
Modifying pairs
Common mistakes
Two-value container
Exercise
Exercise
Key-value storage
Exercise
Rearranging soldiers
Paired information
Breaking it down
Two-value container
Complete solution
summary
Room availability
Simple filtering
Breaking it down
Two-value container
Complete solution
summary
What we learned