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.

Befunge

This is a two-dimensional programming language that was invented by Chris Pressey in 1993. Similar to brainfuck, every character in the program represents a single command. But unlike most other languages, the Befunge interpreter doesn't just read in the input as a series of commands and then execute them. Instead, a befunge program is more like a map, and the interpreter navigates this map according to the instructions... in the program itself!

Important: We are using the Befunge 93 standard for this project. Do not use any features that only exist in later revisions like Befunge 98. (Befunge 93 is simpler, so I think this will make your life easier. If you really want to use some Befunge 98, come talk to me about it!)

Useful Links

  • This page on esolangs gives a bit of history as well as the language definition and some examples.
  • Befunge in your browser. This is actually pretty neat because you can see the program as it gets interpreted.
  • Wikipedia page
  • 99 bottles of beer program.
    Actually, I think that one's pretty difficult to follow, so I wrote my own. Try it!
    56+9*>:1            >                        v
                           v"bottles of beer"0<   <
                        0  :                  .
                        :  #                  |:\<
                        ,  ,      v"no more "0<
                        ,  |      >:#,_$$         ^
         |:,+55,"."_" ,"^  $
         @ >:#,_$1-^       :
           ^" on the wall"0_".",55+,           v
             v"Take one down, pass it around, "<
             >:#,_$ 1- :2                        ^
        

Tools

The interpreter we are using is cfunge. We will use the most recent version from github.

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. Download the interpreter from github by running
    git clone https://github.com/VorpalBlade/cfunge.git
  2. cd cfunge to that directory and run:
    mkdir build
    cd build
    cmake ..
    make
    sudo make install
      

How I will run your code

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

cfunge -s 93 proj.bef

For this language, you only need to implement modification A. See the Phase 1 page for details on what this means.

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. Vending Machine
  3. Frequency count
  4. Rock, Paper, Scissors
  5. ??? (you choose!)