Scottkit is born! Only seven and a half years late!

Those of you who have been reading this blog since 2nd March 2010 — just three days after the blog was born — might remember the fourth post I ever made here: Learning a language vs. learning a culture, on my switching from Perl to Ruby. Way back then, I wrote about “ScottKit — my first non-trivial Ruby program”. Here it is!

Back in 2010, I wrote about ScottKit as follows:

… a toolkit for messing with Scott Adams format Adventure games — simple two-word-parser interactive fiction of the kind that was popular in the 1980s and which, for me at least, has never lost its charm. […] The big gap is the documentation for the source language — it doesn’t really exist. I’ll try to fix that in the next day or so; I’ll post about ScottKit when it’s ready for the attention.

“The next day or so” turned out to take seven and a half years, but it’s finally out! If you have Ruby on your system, it should be trivial to install and run:

mike@sauropod:~$ sudo gem install scottkit
Fetching: scottkit-1.0.0.gem (100%)
Successfully installed scottkit-1.0.0
1 gem installed
Installing ri documentation for scottkit-1.0.0...
Installing RDoc documentation for scottkit-1.0.0...

mike@sauropod:~$ scottkit
/usr/local/bin/scottkit: No data-file specified
Usage: /usr/local/bin/scottkit [options] []
-c, --compile                    Compile instead of loading
-d, --decompile                  Decompile instead of playing
-p, --play-from-source           Compile and play from source
-w, --wizard                     Wizard mode (enabled debugging commands)
-l, --load-game FILE             Load a previously saved game
-f, --read-file FILE             Read initial commands from file
-e, --echo                       Echo input commands to output
-s, --random-seed VAL            Set random seed for repeatability
-b, --bug-tolerant               Copy with out-of-range locations, etc.
-z, --sleep-at-end               Sleep for a long time after program ends
-W, --no-wait                    Do not wait on pause actions or death
-T, --show-tokens                Show lexical tokens as they are read
-R, --show-random                Show rolls of the random dice
-P, --show-parse                 Show results of parsing verb/noun
-C, --show-conditions            Show conditions being evaluated
-I, --show-instructions          Show instructions being executed

But what does it actually do? It compiles, decompiles and runs adventure games. It works with files in two formats:

ScottKit runs in three basic modes: it can play a Scott Adams TRS-80 format game, which is what you see in the screenshot above; it can decompile such a game into ScottKit-format source code; and it can compile source code into a playable game. As a convenient shortcut, there’s also a mode that can compile from source in-memory, and execute the game directly, so you needn’t bother with compiled files at all if you don’t want to:

mike@sauropod:/var/lib/gems/1.9.1/doc/scottkit-1.0.0$ scottkit -p /var/lib/gems/1.9.1/gems/scottkit-1.0.0/data/crystal/crystal.sck
/var/lib/gems/1.9.1/gems/scottkit-1.0.0/lib/scottkit/game.rb:251: warning: assigned but unused variable - _UNUSED_dark_flag
ScottKit, a Scott Adams game toolkit in Ruby.
Release 1.0, (C) 2010 Mike Taylor <>
Distributed under the GNU software license

I'm in a small wooden hut.
Obvious exits: East.
I can also see: Sign, Axe, Single match

Written by Mike Taylor, starting Monday 10th April 2001
This is a demo for the "ScottKit" adventure system

Your task is to find the six crown jewels of the
kingdom and store them in this hut.  They are:
a platinum chain, a gold crown, a silver medallion
a bronze sceptre, a zinc goblet and a tin stoat.
Tell me what to do ?

I conventionally use the suffix .sck (ScottKit) for the source files and .sao (Scott Adams Object-code) for the compiled games. So the four modes listed above are are used as follows:

  • scottkit game.sao
  • scottkit -d game.sao > game.sck
  • scottkit -c game.sck > game.sao
  • scottkit -p game.sck

More about ScottKit in future posts. But for now, if you’re so inclined, go and take a look at the code; and if you like games, install and run it. It comes with a bunch of games (Scott Adams’s, Brian Haworths, a small one of mine and some tutorial games) which you can play, or decompile and mess around with.

Next time: how to build and run adventure games with ScottKit.

4 responses to “Scottkit is born! Only seven and a half years late!

  1. Pingback: Learning a language vs. learning a culture | The Reinvigorated Programmer

  2. One word .. AWESOME.

    Years ago, I started a simialr project; its such a simple format, and yet quite effective; so I disassembled the games, and picked apart ScottFree to see what it was up to .. I ‘wrote’ a combined interpreter for Palm OS and such, that just included wrapped up modules of frotz, scottfree, magnetic scrolls interp, etc, .. which I ended up rewriting and all that.

    Good times :)

  3. Nice, Jeff!

    I hope you’ll have a play with ScottFree. First, I want to see what games you make with it; and second, I need the inevitable bug-reports! (You can report them with comments here, or on the GitHub issue-tracker.)

  4. Pingback: Building adventure games with ScottKit | The Reinvigorated Programmer

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.