Skip to content

Instantly share code, notes, and snippets.

@darthneel
Created November 10, 2014 20:34
Show Gist options
  • Save darthneel/ad9099efb7cf64158a21 to your computer and use it in GitHub Desktop.
Save darthneel/ad9099efb7cf64158a21 to your computer and use it in GitHub Desktop.
Concepts and mechanics to prepare students for the first day of WDI

Pre-work Check in: Understanding Mechanics Part 2


TIP: You can open a new Terminal window and type irb to enter a Ruby prompt. On this screen you type and execute Ruby code, similar to what you were doing on Code Academy.


###Questions to ask yourself:

Methods

  • What is a method in Ruby?

  • What is the use of a method?

  • What are some examples of methods we use on a String?

  • What are some examples of methods we use on an Integer?

  • Can I write my own method?

    • Check this link for some info on writing methods
  • What does an argument and how does this relate to methods?

  • Can I write a method that when called, prints my name to the Terminal?

Conditionals

  • Can I write an if statement in Ruby?

  • If so, can I modify that statement to add an else and elsif?

Comparator

  • Is = the same as ==?

  • What happens if I type a = "Zelda" in my Terminal?

  • What happens if I type a == "Zelda" in my Terminal?

  • What does && mean in Ruby?

  • How is && useful when programming?

Booleans

  • What is a boolean value?

  • What will happen if I type the below into my terminal?

      zelda = true
      if zelda == false
        puts "Zelda is a figment of your imagination"
      else
        puts "Zelda is real! I wonder if this the Easter Bunny is real too"
      end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment