Created
August 11, 2013 22:43
-
-
Save scottmascio2115/6207218 to your computer and use it in GitHub Desktop.
Revisions
-
scottmascio2115 created this gist
Aug 11, 2013 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,36 @@ # List 10 topics 1. Driver code 2. Recursion 3. Looping 4. Enumerables 5. Arrays 6. Ping pong pairing 7. Debugging 8. Pseudocode 9. Refactoring 10. Blocks ## Choose two and write a description Driver code- Driver code is an efficent way to test each part of your code as you write a method. Every time your write a new peice of code, create a test to see if that code is running how you thought it would. Your driver code should display true if your code is running properly and false if your code is not doing what you want it to do. Enumerable- The enumerable module is a list of methods that can be used on collection classes for the ability to sort the collection based on a specification that you give. ## Write code to illustrate one of your descriptions Driver code def empty_hash {} end puts empty_hash == {} # Your code here array = ["dog", "cat", "rat"] p array.any? {|word| word.length >= 5} using the enumerable any go through each element in the array and determine if the length is greater than or equal to 5