-
Notifications
You must be signed in to change notification settings - Fork 24
Week 2 Assignments
Total time estimated: 4-10 hours
##Ruby Reading
1-2 hours
You may optionally want to look at Ruby section of the resources page for more reading. Below are selected suggestions from that page:
- Chapters 1-6 of Learn to Program by Chris Pine. This one is very clear and straightforward. If the website is ever down, we shared a Google Drive folder with you which has the book printed to PDF.
- Why's Poignant Guide Chapter 3 - Ruby Basics. So beloved, so absurd. Much mnemonic.
2-5 hours
Your assignment is to complete a portion of the Ruby Koans. Specifically, you should complete all the koans through the section (i.e. file) called triangele_project.rb
(~1/2 of them).
If you would like to have them run automatically, you could try to use the trick described here: https://github.com/neo/ruby_koans/#running-the-koans-automatically
Sometimes a "point" comes from completing multiple lines - pay close attention to which line the koan is pointing at to prevent frustration.
If you don't understand something in the koans, you should try these in order:
- Try to figure it out by trying things in the koans environment
- Look it up
- Make a note to figure it out later
##Assignment 4 - Grandma
1-3 hours
Write a Deaf Grandma program.
- Whatever you say to grandma (whatever you type in), she should respond with HUH?! SPEAK UP, SONNY! , unless you shout it (type in all capitals).
- If you shout, she can hear you (or at least she thinks so) and yells back, NO, NOT SINCE 1938! or other silly grandma phrases she has in her small repertoire.
- To make your program really believable, have grandma shout a different year each time; maybe any year at random between 1930 and 1950.
- You can't stop talking to grandma until you shout BYE. Except she doesn't want you to leave, so you have to shout BYE three times in a row.
- Make sure to test your program: if you shout BYE three times, but not in a row, you should still be talking to grandma.
- Hints
- Don't forget about chomp! 'BYE'with an Enter is not the same as 'BYE' without one!
- Try to think about what parts of your program should happen over and over again. All of those should be in your while loop.
(adapted from Chris Pine's "LearnToProgram" http://pine.fm/LearnToProgram/?Chapter=06)
5 minutes
When you are done, do the following
- Submit your time worked for each of the two assignments on the class google form (Found on the Assignments page).
- Submit your grandma program to us
- Name your file "FirstnameLastname.rb".
- Email the file to this Box folder's email address: [email protected]
- Home
- Assignments
- Resources
- Piazza
- Last Summer's Wiki-Curriculum
- Code Examples from Class are in this course repository