Welcome to the get_random_elements 3 ways code challenge!
-------------- THE CHALLENGE
The given environment is built out in lines 4-14 and includes... An array (referenced here as "mystery_array"), containing an unknown of elements A get_element method that will return the next element in mystery_array
The challenge has 3 parts, and the solutions are labeled accordingly within the code. Part 1: Create a method that will return a random element from mystery array. Part 2: Create a method that returns a random element from mystery array WITHOUT creating a new array to do so. Part 3: Create a method that returns a random element from mystery array by only looping once
-------------- INSTRUCTIONS
To run the file in the command line, first fork this repo and navigate to the get_elements directory, which contains get_elements.rb. Open a repl such as irb or pry and require 'get_element.rb'. Note that you will need to provide the full path - for example, on my machine, the path is: /Users/spanuska/Development/code/get_elements/get_elements.rb. Once you have required the file, you can call any of the methods within the repl.
To run the tests, navigate to the get_elements directory and type the following command: 'rspec spec/get_elements_spec.rb'. Next, get excited about all the passing tests!
Note: in order to install rspec on your machine, see the instructions listed here: http://rspec.info/. To install pry, see the instructions listed here: http://pryrepl.org/.