Class 2: Getting started with Ruby
Held: Wednesday, 25 January 2017
We start to investigate some issues in Ruby.
Preliminaries
Related Pages
Updates
News / Etc.
- We now have a schedule in place. The rest of the syllabus should be there tonight.
- I lied. Most students last year said they took 4-5 hours for the Ruby tutorial. That means I’ve used about half of your homework time for this week (assuming that you got through everything).
Homework
A Quick Overview of Ruby
- Modern programming language.
- “One” designer.
- Imperative, functional, and OOP characteristics.
- Good at “Get the job done quickly.”
Ruby
What’s something familiar?
What’s something new and exciting you’ve discovered about Ruby?
How does Ruby handle a programmer’s need for multiple inheritance?
What is something particularly confusing or puzzling in the reading?
Some Ruby Problems
Write sums_to_n?(vals,val)
that returns true if any pair
of values from vals
sums to val
.
Write multiple_of_4?(bitstring)
that takes a string of 0’s and 1’s
(representing an unsigned integer) as input and returns true if the
string represents an integer divisible by four.
Write starts_with_consonant?(str)
that determines if a string
starts with a consonant.