SI 413 Fall 2021 / Project


This is the archived website of SI 413 from the Fall 2021 semester. Feel free to browse around; you may also find more recent offerings at my teaching page.

Ruby

Created by Yukihiro Matsumoto in 1995. Part scripting language, part object-oriented, part functional, Ruby is a modern language with something to offer to everyone. It is in interpreted language (interpreter written in C) and has a significant standard library.

Useful Links

  • The Ruby homepage contains just about everything you would need, including many links to useful documentation and tutorials.
  • Wikipedia page
  • 99 bottles of beer program (from here):
    def bottles(beer, wall = false)
      "#{beer>0 ? beer : "no more"} bottle#{"s" if beer!=1} of beer#{" on the wall" if wall}"
    end
     
    99.downto(0) do |remaining|
      puts "#{bottles(remaining,true).capitalize}, #{bottles(remaining)}."
      if remaining==0
        print "Go to the store and buy some more"
        remaining=100
      else
        print "Take one down, pass it around"
      end
      puts ", #{bottles(remaining-1,true)}.\n\n"
    end

Tools

We will use the standard Ruby interpreter (written in C) version 2.7.

Everything you need is already installed on CS department lab machines.

To install on your virtual machine, follow these steps:

  1. Run sudo apt install -y ruby
  2. That's it!

How I will run your code

The programs you submit should be in a single file called proj.rb, for either part of the project. I will test your code by running the following commands using the software available in the lab environment or using the instructions above:

ruby proj.rb

Phase 1 Requirements

For this language, you need to implement modifications B, C, D, F, G, H, I, and J. See the Phase 1 page for details on what this means.

Phase 2

See the Phase 2 Page for the list of suggested problems. Of the ones listed, I recommend the following as being most well-suited for ruby:

  1. Matrix Calculator
  2. Image Creator
  3. Game Scheduler
  4. TODO list
  5. Game with hidden agenda
  6. Guess the language
  7. Find the missing digits
  8. Sports Ticker
  9. Rock, Paper, Scissors
  10. Music Maker
  11. ??? (you choose!)