BenRongey / BenApprenticeship

0 stars 0 forks source link

Try Ruby #31

Open BenRongey opened 5 years ago

BenRongey commented 5 years ago

Complete: https://ruby.github.io/TryRuby/

Questions:

Exercise:

A Shuffle Bag is a technique for selecting random items for a list and avoiding selecting the same item multiple times consecutively. Think of it like a bag of scrabble tiles-- you start with all the tiles, and draw random ones out one at a time until the bag is empty. Then, you refill the bag and shake it around, making the tile order different next time.

Implement a shuffle bag using the elements of the Ruby language and the types that you have learned.

Hint: Ruby's types have many built in methods that are useful shortcuts, but that aren't covered in Try Ruby. You are allowed, nay, strongly encouraged to use these built ins to make your task easier. You may want to do some searching.