Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save philsof/8e1a7d8a3c24772b922c to your computer and use it in GitHub Desktop.
Save philsof/8e1a7d8a3c24772b922c to your computer and use it in GitHub Desktop.
code-review-branch-andy4626_and_greensneakers-for-algorithm-drill-shuffle-challenge

This is good stuff. Your code does the job and passes all of the tests. Here are some notes:

  • One of your variable names is too vague. Instead of new_array how about dup_of_array or something that indicates what the array is holding/why you need it.
  • You are creating a duplicate array in a very unconventional manner. Check out clone and dup for a better way to do this. (Hint: one of these will be better than the other.)
  • Good use of until and rand and << and length and especially slice!, which is taking care of two needs simultaneously (removing and returning the desired array object).
  • Watch your indentation. Specifically, lines 7 to 11 should be indented. Readability is vital!
  • Be sure to delete unused/extra code from your final product. Specifically, this line should not be in your final code, since the runner.rb file is taking care of the running and printing.

Good work! Any questions let me know.

-Phil

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment