HW#5 --- last modified November 22 2021 21:18:26.

Solution set.

Due date: Dec 6

Files to be submitted:
  Hw5.zip

Purpose: To gain more experience with functional program and with logic programming.

Related Course Outcomes:

The main course outcomes covered by this assignment are:

CLO11 -- Produce programs in a functional programming language.

Description:

For this homework you will write two text-based adventure games - one in Scheme and one in Prolog. As a model for what a text based adventure game is, check out the Wikipedia page for Zork and maybe try to Play Zork Online. The actual subject matter of the text based adventure game you write is up to you (have fun!), however, your programs must meet the following constraints that the grader will use for grading:

  1. You should have a readme.txt file indicating team mates on your project. It should also indicate where in your programs you satisfy the remaining criteria.
  2. Name your Scheme program adventure1.scm and your Prolog program adventure2.P. The Prolog program should be a sequel to the Scheme program. The grader will use Chez-Scheme to test your Scheme program and SWI-Prolog to grade your Prolog program. Programs will be launched from a terminal window using the following commands respectively:
    chez adventure1.scm
    swipl adventure2.pl
    
    It is expected that when launched your programs will display information about the location the play starts off at.
  3. Call places in your adventure programs Locations. Locations in your Scheme program should be modeled using classes implemented via closures and message passing as was shown in class.
  4. Each adventure program should have at least 5 Locations.
  5. Your Locations should have a notion of state. For example, if you move an object at the Location and come back it should stay moved.
  6. You should have a notion of a Player which also has a state.
  7. Your Scheme program should make non-trivial use of streams to model I/O somewhere in your program.
  8. Your Scheme program should be able to save and load the current game state, with the commands: save name_of_some_file and load name_of_some_file.
  9. Your Prolog program should make non-trivial use of Definite Clause Grammars.
  10. Your Prolog program should be able to save and load the current game state, with the commands: save name_of_some_file and load name_of_some_file.
Point Breakdown
Items 1-10 (1pt each) 10pts
Total 10pts