Skip to content
Line-for-line port of Rogue from C to Common Lisp
Common Lisp Other
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
bin
etc
.gitignore
Dockerfile
LICENSE
README.md
armor.lisp
chase.lisp
cl-rogue.asd
command.lisp
daemon.lisp
daemons.lisp
fight.lisp
init.lisp
io.lisp
load.lisp
main.lisp
misc.lisp
monsters.lisp
move.lisp
newlevel.lisp
options.lisp
pack.lisp
package.lisp
passages.lisp
potions.lisp
rings.lisp
rip.lisp
rogue.lisp
rooms.lisp
save.lisp
scrolls.lisp
status
sticks.lisp
things.lisp
vers.lisp
weapons.lisp
wizard.lisp

README.md

CL-ROGUE

This is a nearly line-for-line port of Rogue v3.6.2 from C to Common Lisp. The goal of this exercise was to see how easy it would be to write idiomatic 1980s-era C, well-written but with lots of side-effects and stuff, in Common Lisp. In the process of porting the code, I gained an appreciation for the pragmatic elegance of the Rogue code base. It also showed me that it was possible to keep the code almost exactly the same across both languages (same variable names, same control flow), with only a few exceptions.

The source code is most likely here; see also version 5.4.4.

Dependencies

Quicklisp

CL-ROGUE is a lot easier to get running with Quicklisp; so it is highly recommended you set that up first.

Curses Library

Make sure you've installed ncurses. For example on Ubuntu 18.04 you'd execute:

sudo apt-get install -y libncurses5-dev

Presently CL-ROGUE also depends on the CL-CHARMS Common Lisp library which wraps ncurses. The older CL-NCURSES package no longer works reliably on all platforms.

SBCL

Only SBCL v1.4.5 has been tested recently; other versions of Common Lisp might work but they haven't been tested.

Running

Locally

Once you've ensured you have the above dependencies, you should be able to execute the following commands in a screen-oriented terminal:

(pushnew (merge-pathnames "src/cl-rogue/" (user-homedir-pathname)) asdf:*central-registry*)
(asdf:operate 'asdf:load-op 'cl-rogue)
(cl-rogue:rogue)

Note: you should substitute in something else for "src/cl-rogue" if that's not where you put it.

Note: ignore warnings that look like this:

WARNING: Unable to load ncurses.

Despite the dire-sounding nature of the warning, curses seems to work just fine.

Using Docker

Using the Dockerfile in the cl-rogue directory, you should be able to do the following:

cd cl-rogue
docker build -t cl-rogue .
docker run -i -t cl-rogue
You can’t perform that action at this time.