Skip to content

Instantly share code, notes, and snippets.

@scottmascio2115
Created August 11, 2013 22:43
Show Gist options
  • Select an option

  • Save scottmascio2115/6207218 to your computer and use it in GitHub Desktop.

Select an option

Save scottmascio2115/6207218 to your computer and use it in GitHub Desktop.

Revisions

  1. scottmascio2115 created this gist Aug 11, 2013.
    36 changes: 36 additions & 0 deletions reflect_on_learning.md
    Original 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