SI 413 Fall 2023 / Project


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

GolfScript

GolfScript is a language created with a specific purpose, but that purpose is more entertainment than actual utility: writing programs using as few characters as possible. It is used in "Code Golf" competitions where you try to solve a programming challenge using a program that's as small as possible.

Despite the seeming uselessness, there are actually some interesting aspects. Like many virtual machine languages, it's stack-based, which often means you don't need to use variables or function names explicitly. The language also is pretty simple without too many built-in functions, so it shouldn't be too hard to learn the rules (though it might be hard to use them effectively).

Useful Links

Tools

The GolfScript reference interpreter is just a Ruby program, available by clicking "download" on the GolfScript homepage.

Everything you need is already installed on CS department lab machines in the /courses/roche/413/bin folder, which should be in your PATH.

To install on your virtual machine, follow these steps:

  1. Install ruby:
    sudo apt install ruby
  2. Download the golfscript interpreter into your bin folder and make it executable:
    mkdir -p ~/bin
    curl 'http://www.golfscript.com/golfscript/golfscript.rb' -o ~/bin/golfscript.rb
    chmod +x ~/bin/golfscript.rb

How I will run your code

The programs you submit should be in a single file called proj.gs, 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:

golfscript.rb proj.gs

Phase 1 Requirements

For this language, you need to implement modifications A,B,C,D,E,F,G,H, and I. 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 LANGUAGE:

  1. Compiler
  2. Make
  3. Matrix Calculator
  4. Image Creator
  5. Game Scheduler
  6. Hangman
  7. TODO list
  8. Vending Machine
  9. Game with hidden agenda
  10. Frequency count
  11. Guess the language
  12. Find the missing digits
  13. Sports Ticker
  14. Rock, Paper, Scissors
  15. ??? (you choose!)