Course Week01 Day01

First day! Introductions. Then review and duo work on about 12 problems.

Topics with new tidbits:

  • Array
  • String
    • chomp takes away new line literals from a string
    • strip takes away ending spaces from a string
  • Hash
  • Enumerables
    • any? takes a block and returns true/false for that block
  • Object

Lessons

  • Separating a number into its digits is best done with modulo for all powers of 10 less than it:
    • (234 / 1)   % 10 #=> 4
      (234 / 10)  % 10 #=> 3
      (234 / 100) % 10 #=> 2
  • Main in Ruby:
    • if __FILE__ == $PROGRAM_NAME
        puts primes(100)
      end
  • add git directories recursively with git add and not git add .
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s