What are Fixnum, String, Array and Hash and how would you use each?
You need to keep track of Revelry employees' names and their github handles. Which
Ruby types could you use?
What is a block? How do you make one? What are some ways you can use one?
What's a method? What does one look like in Ruby?
What's File? FileUtils?
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.
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.