Sample exercises for learning immutabiltiy in Ruby.
These are based on the Learning Scala by Building Scala blog posts.
Try to implement these functions without mutable state:
Easiest
- reverse an array
- implement count for an array
Intermediate
- implement take and drop for array
- implement include? on array (find)
Harder (will need blocks, procs, or lambdas)
- implement select on array (filter)
- implement map on an array