├── .gitignore ├── .travis.yml ├── .yardopts ├── ChangeLog.md ├── GPL-2.txt ├── Gemfile ├── README.md ├── Rakefile ├── VERSION ├── bin ├── md5ruby └── scottkit ├── docs ├── .gitignore ├── Makefile ├── notes │ ├── Definition-saved-game.txt │ ├── Definition-scottfree-1.14.txt │ ├── Definition.txt │ ├── adventureland-maze │ ├── continue-action │ └── release-procedure.md ├── reference.md ├── scottkit.md └── tutorial.md ├── games ├── .gitignore ├── adams │ ├── .gitignore │ ├── AdamsGames.zip │ └── Makefile ├── crystal │ ├── crystal.map │ ├── crystal.sck │ └── crystal.solution ├── dan-and-matt │ ├── dan-and-matt.sck │ └── dan-and-matt.solution ├── howarth │ ├── .gitignore │ ├── Makefile │ └── mysterious.tar.gz ├── nosferatu │ ├── .gitignore │ ├── Makefile │ ├── README │ ├── TODO │ ├── nosferatu.map │ ├── nosferatu.regression │ ├── nosferatu.sck │ ├── nosferatu.sol │ └── nosferatu.transcript ├── test │ ├── Makefile │ ├── adams │ │ ├── Makefile │ │ ├── adv01.solution │ │ ├── adv01.transcript │ │ ├── adv01.transcript.md5 │ │ ├── adv02.solution │ │ ├── adv02.transcript │ │ ├── adv02.transcript.md5 │ │ ├── adv04.solution │ │ ├── adv04.transcript │ │ └── adv04.transcript.md5 │ ├── crystal.decompile │ ├── crystal.sao │ ├── crystal.save-file │ ├── crystal.save-script │ ├── crystal.sck │ ├── crystal.solution │ ├── crystal.transcript │ ├── t6.pretty-print │ ├── t6.sck │ ├── t7.sao │ ├── t7.solution │ └── t7.transcript └── tutorial │ ├── Makefile │ ├── t1.map │ ├── t1.sck │ ├── t2.map │ ├── t2.sck │ ├── t3.map │ ├── t3.sck │ ├── t4.map │ ├── t4.sck │ ├── t5.map │ ├── t5.sck │ ├── t6.map │ ├── t6.sck │ ├── t7.map │ ├── t7.sck │ └── tutorial.source.md ├── lib └── scottkit │ ├── compile.rb │ ├── decompile.rb │ ├── game.rb │ ├── play.rb │ └── withio.rb ├── scottkit.gemspec └── test ├── test_canonicalise.rb ├── test_compile.rb ├── test_decompile.rb ├── test_play.rb ├── test_playadams.rb ├── test_save.rb └── withio_test.rb /.gitignore: -------------------------------------------------------------------------------- 1 | doc 2 | scottkit-*.gem 3 | syslib 4 | .yardoc 5 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | dist: trusty 2 | language: ruby 3 | rvm: 4 | - 2.0 5 | - 2.1 6 | - 2.2 7 | - 2.3 8 | - 2.4 9 | cache: bundler 10 | -------------------------------------------------------------------------------- /.yardopts: -------------------------------------------------------------------------------- 1 | --no-private bin/scottkit lib/**/.rb - ChangeLog.md GPL-2.txt docs/notes/Definition.txt docs/notes/Definition-saved-game.txt docs/reference.md 2 | -------------------------------------------------------------------------------- /ChangeLog.md: -------------------------------------------------------------------------------- 1 | # Revision history for Ruby gem ScottKit 2 | 3 | ## 1.7.0 (IN PROGRESS) 4 | 5 | * Add Unix-style [manual-page](docs/scottkit.md) for the top-level `scottkit` program. Fixes #18. 6 | * Do not test a random roll when occurrences have probability 100% (and so do not emit debugging output). Fixes #26. 7 | * More concise (single-line) format for :show_conditions output. Fixes #25. 8 | * Coherently indent output from -R, -C and -I, yielding and integrated debugging log. Fixes #27. 9 | * Fully support 32 flags by separating NCOUNTERS out from NFLAGS. Fixes #28. 10 | * Remove TODOs from the end of change-log: they are now all in the issue-tracker. 11 | * The GET action no longer automatically outputs "O.K.", bringing it in line with the behaviour of classic interpreters. Fixes #34. 12 | 13 | ## 1.6.0 (Wed Oct 25 00:19:29 BST 2017) 14 | 15 | * Emit "Your light is growing dim" message every five turns when less than 25 left. 16 | * When moving into a dark room, the description is no longer displayed before "It's too dark" message. Fixes #7. 17 | * Use a saved, non-moving copy of `t6.sck` in regression-tests. Avoids pointless failures when I work on the tutorials. 18 | * Do not omit scottkit.gemspec from git repo. Fixes #9. 19 | * Add support for Travis CI. Fixes #12. 20 | * Refactor main play loop to facilitate external driver code. Fixes #8. 21 | * Move all documentation into new `docs` directory. Fixes #17. 22 | * Rename `data` directory to `games`, and adjust test-suite etc. accordingly. Fixes #20. 23 | 24 | ## 1.5.0 (Fri Oct 20 00:38:57 BST 2017) 25 | 26 | * Improvements to _Nosferatu_. This game is now as close as I can make it to the 1982 original, including bug-compatibility for mis-spellings and the behaviour of water. 27 | * Minor improvements to tutorial map 4 and subsequent. 28 | * Add '--teleport' command-line option, which generates `teleport ROOM` actions for every room. For use in game development and debugging. Fixes #4. 29 | * Add '--superget' command-line option, which generates `sg ITEM` actions for every item. For use in game development and debugging. Fixes #5. 30 | * The `refill_lamp` action now works correctly. It seems it never did work, but I didn't notice because my walkthroughs of _Adventureland_ were too efficient to require lamp-refilling! 31 | 32 | ## 1.4.0 (Tue Oct 17 00:52:09 BST 2017) 33 | 34 | * Fix v1.3.0 bug: hasty implementation of lint meant compilation would fail if no lint option was provided. Now works correctly again. 35 | * Play mode no longer crashes on an empty line of input 36 | * Add support for opcode 84 `print_noun` (without newline). 37 | * Remove ScottKit version number from startup message in play mode, as it messes up regression tests. It's in the usage message now. 38 | * New file, `bin/md5ruby`: needed for regenerating regresssion expectations, since the `md5` program on MacOS produces different results from Ruby's MD5 digest when given non-ASCII input. Use this for regenerating `data/test/adams/*.md5` 39 | * The reimplementation of _Nosferatu_ is now complete in that it is possible to play the game through to a successful completion. However, it's not ready for release, as many incorrect actions still need to be handled gracefully. 40 | 41 | ## 1.3.0 (Mon Oct 16 20:27:43 BST 2017) 42 | 43 | * Support `--lint` (`-L`) command-line option. Fixes #1. 44 | Argument is a string of characters: 45 | * `e` -- check for rooms with no exits (traps) 46 | * `E` -- check for rooms with only one exit (dead ends) 47 | 48 | ## 1.2.0 (Mon Oct 16 15:11:44 BST 2017) 49 | 50 | * Create initial tutorial, exactly equivalent to that of Games::ScottAdams. 51 | * Use the special name `_` for the unused variable representing the redundant dark-flag part of save-files. This avoids an unused-variable warning when running under certain older versions of Ruby. 52 | * Top-level README links to the tutorial, reference manual and sequence of blog-posts. 53 | * Add new game, [`data/nosferatu`](data/nosferatu), ported from the Games::ScottAdams reimplementation of the 1982 VIC-20 BASIC game. This is incomplete. 54 | * Escape sequences for newline (`\n`) and tab (`\t`) are interpreted in printed strings. 55 | * Add discussion of the `print` action to the reference guide. 56 | 57 | ## 1.1.0 (Thu Oct 12 21:59:28 BST 2017) 58 | 59 | * Documentation fix: correctly name the `present` condition (was `accessible`). 60 | * Documentation fix: correctly name _twelve_ actions. (Thanks to Brian Jones for spotting the first of these.) 61 | * `moveto` -> `goto` 62 | * `print_noun_nl` -> `println_noun` 63 | * `nl` -> `println` 64 | * `clear_screen` -> `clear` 65 | * `set_0` -> `set_flag0` 66 | * `clear_0` -> `clear_flag0` 67 | * `decrease_counter` -> `dec_counter` 68 | * `add_counter` _nu`mber_ -> add_to_counter _number_` 69 | * `subtract_counter` -> subtract_from_counter` 70 | * `swap_loc_default` -> `swap_room` 71 | * `swap_loc` -> swap_specific_room` 72 | * `special` -> draw` 73 | 74 | ## 1.0.0 (Wed Oct 11 21:45:27 BST 2017) 75 | 76 | * Finish translating reference guide from POD to MarkDown. 77 | * Update reference guide to describe ScottKit format rather then Games::ScottAdams format. 78 | * Fix handling of darkness when playing games. 79 | * Support unquoted "carried" and "at" in conditions 80 | 81 | ## 0.4.0 (Mon Mar 1 22:20:09 GMT 2010) 82 | 83 | * Move towards using YARD for documentation instead of Rdoc. This 84 | includes changes to things like the format of the Changes file. Far 85 | from perfect so far: for example, plain-text documentation like 86 | `doc/Definition` gets mangled. 87 | 88 | ## 0.3.0 (February 28, 2010) 89 | 90 | * Move ScottKit out of its sub-siubdirectory in the 9Gb `mike` 91 | git module into its own git module. 92 | * Move repository hosting to github. 93 | * Arrange for formatted documentation to appear at 94 | [http://rdoc.info/projects/MikeTaylor/scottkit](http://rdoc.info/projects/MikeTaylor/scottkit) 95 | 96 | ## 0.2.0 (February 28, 2010) 97 | 98 | * Add `-z` option to sleep after finishing - useful when running in a 99 | DOS Shell under Windows, so that error messages can be seen. 100 | * Add facility to load a game while playing, using `#load` 101 | 102 | ## 0.1.0 (February 28, 2010) 103 | 104 | * Add `-p` option to compile and play a game from source. 105 | 106 | ## 0.0.0 (February 28, 2010) 107 | 108 | * Initial release. 109 | 110 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | source "https://rubygems.org" 3 | 4 | gem "rake", "~> 12.0" 5 | gem "jeweler", "~> 2.0" 6 | gem "test-unit", "~> 3.2" 7 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ScottKit - a toolkit for Scott Adams-style adventure games 2 | ========================================================== 3 | 4 | **Homepage**: [http://rdoc.info/projects/MikeTaylor/scottkit](http://rdoc.info/projects/MikeTaylor/scottkit) 5 | **Git**: [http://github.com/MikeTaylor/scottkit](http://github.com/MikeTaylor/scottkit) 6 | **Author**: Mike Taylor 7 | **Copyright**: 2009-2010, 2017 8 | **License**: GNU GPL, version 2 - see file GPL-2 9 | 10 | 11 | Synopsis 12 | -------- 13 | 14 | This is a Ruby program to compile, decompile and run adventure games 15 | in Scott Adams format, including those created by the great man 16 | himself. ScottKit's good for nostalgia freaks wanting to relive the 17 | classic games of the 1980s, but also as a tool for creating small, 18 | concise, new games. 19 | 20 | It was intially written as an exercise in Ruby rather than with any 21 | great expectation that it would be useful, but it turns out to work 22 | pretty well as a tight, clean environment for games programming: if 23 | Inform 7 is like the Ruby of adventure games, ScottKit is like C. For 24 | a big project, you definitely want Inform 7; but I've found that there 25 | is a distinctive appeal to ScottKit. Apart from anything else, it 26 | makes a good domain-specific "little language" for teaching my sons 27 | how to program. 28 | 29 | 30 | Running ScottKit 31 | ---------------- 32 | 33 | The main three modes of running are: 34 | 35 | $ scottkit -c game.sck > game.sao # compile 36 | $ scottkit game.sao # play the game; or use scottfree game.sao 37 | $ scottkit -d game.sao # decompile - useful for cheating 38 | 39 | And there's a handy short-cut combining compilation and play: 40 | 41 | $ scottkit -p game.sck # compile to memory, and play immediately 42 | 43 | Other command-line arguments enable wizard commands, load saved games, 44 | set random seeds and enable various kinds of debugging output: run 45 | `scottkit -h` for details. 46 | 47 | 48 | Testing 49 | ------- 50 | 51 | Unit testing can be done as follows: 52 | 53 | $ ruby -I lib -rrake/rake_test_loader test/test_* 54 | Loaded suite test/test_canonicalise 55 | Started 56 | ........... 57 | Finished in 0.769568 seconds. 58 | 59 | 11 tests, 37 assertions, 0 failures, 0 errors, 0 skips 60 | 61 | 62 | Game format 63 | ----------- 64 | 65 | The file [`docs/notes/Definition-scottfree-1.14.txt`](docs/notes/Definition-scottfree-1.14.txt) is copied from the 66 | ScottFree package, which contains another interpreter for Scott Adams 67 | games. I got this file from release 1.14-9 of ScottFree. 68 | [`docs/notes/Definition.txt`](docs/notes/Definition.txt) is my modified version of this file, since the 69 | original had several mistakes. [`docs/notes/Definition-saved-game.txt`](docs/notes/Definition-saved-game.txt) is 70 | my own analysis of the format of saved games from ScottFree. (Saved 71 | games from ScottFree and ScottKit can be freely interchanged.) 72 | 73 | 74 | Games 75 | ----- 76 | 77 | The directory [`games`](games) contains game files: 78 | 79 | * `adams` - Scott Adams's classic games (see Makefile for details) 80 | * `howarth` - Brian Howarth's games (see Makefile for details) 81 | * `test` - games files used by unit-test suite 82 | * `tutorial` - tiny game used in ScottKit tutorial 83 | * `crystal` - Crystal of Chaos, a game written to exercise ScottKit 84 | * `dan-and-matt` - game written by my two eldest sons 85 | * `nosferatu` -- a partial reimplementation of my 1982 VIC-20 BASIC game 86 | 87 | I have verified that ScottKit can be used to play and win Scott 88 | Adams's games #1, 2, and 4: *Adventureland*, *Pirate Adventure* and 89 | *Voodoo Castle*. I welcome reports of its being used to play and win 90 | other games, or failing that, reports of how it fails. 91 | 92 | 93 | 94 | Bug tolerance 95 | ------------- 96 | 97 | The `-b` (`--bug-tolerant`) option is needed for Scott Adams Adventure 98 | 14b (*Buckaroo Banzai*), which places one item (the jug of jet fuel) 99 | in room 50 of 36. None of Scott's own games is so sloppy. 100 | 101 | 102 | Documentation 103 | ------------- 104 | 105 | * [ScottKit Tutorial](docs/tutorial.md) 106 | * [The ScottKit format reference manual](docs/reference.md) 107 | * A series of blog-posts about ScottKit: 108 | * [Scottkit is born! Only seven and a half years late!](https://reprog.wordpress.com/2017/10/12/scottkit-is-born-only-seven-and-a-half-years-late/) 109 | * [Building adventure games with ScottKit](https://reprog.wordpress.com/2017/10/13/building-adventure-games-with-scottkit/) 110 | * [Rooms and items in ScottKit](https://reprog.wordpress.com/2017/10/14/rooms-and-items-in-scottkit/) 111 | * [Actions in ScottKit](https://reprog.wordpress.com/2017/10/16/actions-in-scottkit/) 112 | * [Occurrences (or daemons) in ScottKit](https://reprog.wordpress.com/2017/10/17/occurrences-or-daemons-in-scottkit/) 113 | * [Darkness and light in ScottKit](https://reprog.wordpress.com/2017/10/21/darkness-and-light-in-scottkit/) 114 | * [Boilerplate for ScottKit games: standard actions](https://reprog.wordpress.com/2017/10/25/boilerplate-for-scottkit-games-standard-actions/) 115 | 116 | -------------------------------------------------------------------------------- /Rakefile: -------------------------------------------------------------------------------- 1 | require 'rubygems' 2 | require 'rake' 3 | 4 | begin 5 | require 'jeweler' 6 | Jeweler::Tasks.new do |gem| 7 | gem.name = "scottkit" 8 | gem.license = 'GPL-2.0' 9 | gem.summary = "Toolkit for Scott Adams-format adventure games" 10 | gem.description = "ScottKit is a toolkit for compiling, decompiling and playing adventure games in the Scott Adams format." 11 | gem.email = "mike@miketaylor.org.uk" 12 | gem.homepage = "http://github.com/MikeTaylor/scottkit" 13 | gem.author = "Mike Taylor" 14 | # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings 15 | # No version, date or files -- I guess jeweler takes care of those 16 | end 17 | Jeweler::GemcutterTasks.new 18 | rescue LoadError 19 | puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler" 20 | end 21 | 22 | require 'rake/testtask' 23 | Rake::TestTask.new(:test) do |test| 24 | test.libs << 'lib' << 'test' 25 | test.pattern = 'test/**/test_*.rb' 26 | test.verbose = true 27 | end 28 | 29 | begin 30 | require 'rcov/rcovtask' 31 | Rcov::RcovTask.new do |test| 32 | test.libs << 'test' 33 | test.pattern = 'test/**/test_*.rb' 34 | test.verbose = true 35 | end 36 | rescue LoadError 37 | task :rcov do 38 | abort "RCov is not available. In order to run rcov, you must: sudo gem install spicycode-rcov" 39 | end 40 | end 41 | 42 | task :default => :test 43 | 44 | require 'rdoc/task' 45 | Rake::RDocTask.new do |rdoc| 46 | version = File.exist?('VERSION') ? File.read('VERSION') : "" 47 | 48 | rdoc.rdoc_dir = 'rdoc' 49 | rdoc.title = "scottkit #{version}" 50 | rdoc.rdoc_files.include('README*') 51 | rdoc.rdoc_files.include('lib/**/*.rb') 52 | end 53 | 54 | task :regenerate do 55 | sh "cd games/test && make rebuild" 56 | sh "cd games/test/adams && make rebuild" 57 | end 58 | -------------------------------------------------------------------------------- /VERSION: -------------------------------------------------------------------------------- 1 | 1.6.0 -------------------------------------------------------------------------------- /bin/md5ruby: -------------------------------------------------------------------------------- 1 | #!/usr/local/bin/ruby -w 2 | 3 | # It seems we need this because the md5 program on MacOS produces 4 | # different results from Ruby's MD5 digest when given non-ASCII input. 5 | 6 | require 'digest/md5' 7 | 8 | file = File.open(ARGV[0], "rb") 9 | contents = file.read 10 | puts Digest::MD5.hexdigest(contents) 11 | -------------------------------------------------------------------------------- /bin/scottkit: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | $VERBOSE = true 3 | 4 | # Command-line driver for the ScottKit toolkit, allowing Scott 5 | # Adams-format adventure games to be compiled, decompiled and played. 6 | # The three basic modes are invoked as follows: 7 | # scottkit -c game.sck > game.sao # compile 8 | # scottkit game.sao # play the game; or use scottfree game.sao 9 | # scottkit -d game.sao # decompile -- useful for cheating 10 | # And the --play-from-source shortcut does not need an object file: 11 | # scottkit -p game.sck 12 | # 13 | # Other command-line arguments enable wizard commands, load saved 14 | # games, set random seeds and enable various kinds of debugging 15 | # output: run scottkit -h for details. 16 | 17 | require 'optparse' 18 | require 'stringio' 19 | require 'scottkit/game' 20 | require 'scottkit/withio' 21 | 22 | 23 | def play(game) 24 | # Decompile (and discard result) to get entity names resolved in 25 | # right order. This ensures that debugging output that uses these 26 | # names will use them in the same way as decompiler output. 27 | dummy = StringIO.new 28 | game.decompile(dummy) 29 | game.play 30 | end 31 | 32 | 33 | mode = :play 34 | options = {} 35 | sleep_at_end = false 36 | 37 | opts = OptionParser.new do |x| 38 | x.banner = "Usage: #$0 [options] [] 39 | (ScottKit version 1.5.0)" 40 | x.on("-c", "--compile", "Compile instead of loading") { 41 | mode = :compile 42 | } 43 | x.on("-d", "--decompile", "Decompile instead of playing") { 44 | mode = :decompile 45 | } 46 | x.on("-p", "--play-from-source", "Compile and play from source") { 47 | mode = :play_from_source 48 | } 49 | x.on("-t", "--teleport", "Generate teleporting actions (for debugging)") { 50 | options[:teleport] = true 51 | } 52 | x.on("-g", "--superget", "Generate superget actions (for debugging)") { 53 | options[:superget] = true 54 | } 55 | x.on("-w", "--wizard", "Wizard mode (enable debugging commands)") { 56 | options[:wizard_mode] = true 57 | } 58 | x.on("-l", "--load-game FILE", "Load a previously saved game") { |file| 59 | options[:restore_file] = file 60 | } 61 | x.on("-f", "--read-file FILE", "Read initial commands from file") { |file| 62 | options[:read_file] = file 63 | } 64 | x.on("-e", "--echo", "Echo input commands to output") { 65 | options[:echo_input] = true 66 | } 67 | x.on("-s", "--random-seed NUM", "Set random seed for repeatability") { |val| 68 | options[:random_seed] = Integer(val) 69 | } 70 | x.on("-L", "--lint STR", "Lint options: a string of the following: 71 | e Ensure rooms all have at least one way out (no traps) 72 | E Ensure rooms all have at least two ways in/out (no dead ends)") { |val| 73 | options[:lint] = val; 74 | } 75 | x.on("-b", "--bug-tolerant", "Cope with out-of-range locations, etc.") { 76 | options[:bug_tolerant] = true 77 | } 78 | x.on("-z", "--sleep-at-end", "Sleep for a long time after program ends") { 79 | sleep_at_end = true 80 | } 81 | x.on("-W", "--no-wait", "Do not wait on pause actions or death") { 82 | options[:no_wait] = true 83 | } 84 | x.on("-T", "--show-tokens", "Show lexical tokens as they are read") { 85 | options[:show_tokens] = true 86 | } 87 | x.on("-R", "--show-random", "Show rolls of the random dice") { 88 | options[:show_random] = true 89 | } 90 | x.on("-P", "--show-parse", "Show results of parsing verb/noun") { 91 | options[:show_parse] = true 92 | } 93 | x.on("-C", "--show-conditions", "Show conditions being evaluated") { 94 | options[:show_conditions] = true 95 | } 96 | x.on("-I", "--show-instructions", "Show instructions being executed") { 97 | options[:show_instructions] = true 98 | } 99 | end 100 | 101 | begin 102 | opts.parse!(ARGV) 103 | raise "#$0: No data-file specified" if ARGV.size != 1 104 | rescue 105 | $stderr.puts $!, opts 106 | exit 2 107 | end 108 | 109 | exitval = 0 110 | game = ScottKit::Game.new(options) 111 | case mode 112 | when :play_from_source 113 | f = StringIO.new 114 | withIO(nil, f) do 115 | if !game.compile_to_stdout(ARGV[0]) 116 | $stderr.puts "#$0: compilation failed: not playing" 117 | exitval = 1 118 | end 119 | end 120 | if exitval == 0 121 | game.load(f.string) 122 | play(game) 123 | end 124 | when :compile 125 | if !game.compile_to_stdout(ARGV[0]) 126 | $stderr.puts "#$0: compilation failed" 127 | exitval = 1 128 | end 129 | when :decompile 130 | game.load(IO.read(ARGV[0])) 131 | f = StringIO.new 132 | game.decompile(f) 133 | print f.string 134 | when :play 135 | game.load(IO.read(ARGV[0])) 136 | play(game) 137 | end 138 | 139 | if sleep_at_end 140 | sleep 9999 141 | end 142 | exit exitval 143 | -------------------------------------------------------------------------------- /docs/.gitignore: -------------------------------------------------------------------------------- 1 | man1 2 | -------------------------------------------------------------------------------- /docs/Makefile: -------------------------------------------------------------------------------- 1 | TARGET = man1/scottkit.1 2 | 3 | $(TARGET): scottkit.md Makefile 4 | test -d man1 || mkdir man1 5 | (echo '% SCOTTKIT(1)'; sed -n '/^##/,$$p' $<) | sed 's/^#//;/^#/y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/' | pandoc -s -t man > $@ 6 | 7 | show: $(TARGET) 8 | man -M . scottkit 9 | 10 | clean: 11 | rm -f $(TARGET) 12 | 13 | .PHONY: show 14 | -------------------------------------------------------------------------------- /docs/notes/Definition-saved-game.txt: -------------------------------------------------------------------------------- 1 | ScottFree saved-game format, determined from source and a sample: 2 | 3 | counter0 roomsaved0 4 | ... 5 | counter15 roomsaved15 6 | bitflags(as bigendian number) dark(redundant) loc counter savedroom lightleft 7 | item0.location 8 | ... 9 | itemNitems.location 10 | -------------------------------------------------------------------------------- /docs/notes/Definition-scottfree-1.14.txt: -------------------------------------------------------------------------------- 1 | Game 2 | 3 | A game consists of a header of 14 values each apparently 16 bit 4 | 5 | 0 Unknown 6 | 1 Number of items 7 | 2 Number of actions 8 | 3 Number of Nouns and Verbs (one list is padded) 9 | 4 Number of rooms 10 | 5 Maximum a player can carry 11 | 6 Starting Room 12 | 7 Total Treasures (*) 13 | 8 Word Length (only seen 3,4 or 5) 14 | 9 Time light source lasts. This counts down every time item 9 is 15 | in game. Brian Howarths games allow -1 for never run down. When 16 | it runs out the light item (9) is dumped in room 0 and a look 17 | done. Messages vary between interpreters and include things 18 | like 'Your light is flickering and dying' as well as 19 | 'Light runs out in %d turns'. 20 | 10 Number of Messages 21 | 11 Room you must put treasure in to score points. Not all games use 22 | the treasure system for scoring 23 | 12 Unknown 24 | 25 | All the number of something values are the last item to be read counting 26 | from 0. Thus 3 messages, means messages 0, 1, 2 and 3. 27 | 28 | (*) This can be calculated in game. What happens if the number is wrong 29 | I don't know. I've found no games that it occurs in. 30 | 31 | A game has 16 (maybe more) binary flags, and 8 (maybe more counters). A few 32 | later games seem to have 2 (maybe more) values to store location numbers in 33 | temporarily - eg Yoho spell in Claymorgue. 34 | 35 | Following the header is a list of game actions. Each is of the form 36 | 37 | 150*verb+noun 38 | 5 repeats of condition+20*value 39 | 150*action1+action2 40 | 150*action3+action4 41 | 42 | Conditions 43 | 44 | 0 Parameter 45 | 1 Item carried 46 | 2 Item in room with player 47 | 3 Item carried or in room with player 48 | 4 In room 49 | 5 Item not in room with player 50 | 6 Item not carried 51 | 7 Not in room 52 | 8 BitFlag is set. 53 | 9 BitFlag is cleared 54 | 10 Something carried (arg unused) 55 | 11 Nothing carried (arg unused) 56 | 12 Item not carried nor in room with player 57 | 13 Item is in game [not in room 0] 58 | 14 Item is not in game [in room 0] 59 | 15 CurrentCounter <= 60 | 16 CurrentCounter >= 61 | 17 Object still in initial room 62 | 18 Object not in initial room 63 | 19 CurrentCounter = 64 | 65 | Actions 66 | 67 | 0 Does nothing 68 | 1-51 Print message 0-50. Some drivers add a space some add a newline. 69 | 52 Get item . Checks if you can carry it first 70 | 53 Drops item 71 | 54 Moves to room 72 | 55 Item is removed from the game (put in room 0) 73 | 56 The darkness flag is set 74 | 57 The darkness flag is cleared 75 | 58 Bitflag is set 76 | 59 The same as 55 (it seems - I'm cautious about this) 77 | 60 BitFlag is cleared 78 | 61 Death. Dark flag cleared, player moved to last room 79 | 62 Item put in room 80 | 63 Game over. 81 | 64 Describe room 82 | 65 Score 83 | 66 Inventory 84 | 67 BitFlag 0 is set 85 | 68 BitFlag 0 is cleared 86 | 69 Refill lamp (?) 87 | 70 Screen is cleared. This varies by driver from no effect upwards 88 | 71 Saves the game. Choices of filename etc depend on the driver alone. 89 | 72 Swap item and item locations 90 | 73 Continue with next line (the next line starts verb 0 noun 0) 91 | 74 Take item - no check is done too see if it can be carried. 92 | 75 Put item with item - Not certain seems to do this 93 | from examination of Claymorgue 94 | 76 Look (same as 64 ?? - check) 95 | 77 Decrement current counter. Will not go below 0 96 | 78 Print current counter value. Some drivers only cope with 0-99 97 | apparently 98 | 79 Set current counter value 99 | 80 Swap location with current location-swap flag 100 | 81 Select a counter. Current counter is swapped with backup counter 101 | 102 | 82 Add to current counter 103 | 83 Subtract from current counter 104 | 84 Echo noun player typed without CR 105 | 85 Echo the noun the player typed 106 | 86 CR 107 | 87 Swap current location value with backup location-swap value 108 | 88 Wait 2 seconds 109 | 89 SAGA - draw picture (actually , as each 110 | Look() draws picture automatically) 111 | Older spectrum driver - crashes 112 | Spectrum Seas of Blood - seems to start Fighting Fantasy combat mode 113 | 90-101 Unused 114 | 102+ Print message 51-99 115 | 116 | 117 | This is followed by the words with verbs and nouns interleaved. A word with 118 | a * at the beginning is a synonym for the word above. 119 | Verb 1 is GO, verb 10 is GET, verb 18 is DROP (always). 120 | Nouns 1-6 are directions. 121 | 122 | This is followed by the rooms. Each room is 6 exits (north south east west 123 | up down) followed by a text string. 124 | 125 | Then come the messages, stored as a list of strings. 126 | 127 | Next come the items in the format item text then location. Item text may 128 | end with /TEXT/. This text is not printed but means that an automatic 129 | get/drop will be done for 'GET/DROP TEXT' on this item. Item names beginning 130 | with '*' are treasures. The '*' is printed. If you put all treasures in the 131 | treasure room (in the header) and 'SCORE' the game finishes with a well done 132 | message. Item location -1 is the inventory (255 on C64 and Spectrum tape 133 | games) and 0 means not in play in every game I've looked at. The lamp (always 134 | object 9) behaviour supports this belief. 135 | 136 | A set of strings follow this. In order they match to each line of verb/noun 137 | actions, and are comments. The Spectrum and C64 tape system where the 138 | database is compiled into the program has no comments. 139 | 140 | Finally three values follow which are version, adventure number and an 141 | unknown magic number. 142 | 143 | -------------------------------------------------------------------------------- /docs/notes/Definition.txt: -------------------------------------------------------------------------------- 1 | Game 2 | 3 | A game consists of a header of 12 values each apparently 16 bit 4 | 5 | 0 Unknown 6 | 1 Number of items 7 | 2 Number of actions 8 | 3 Number of Nouns and Verbs (one list is padded) 9 | 4 Number of rooms 10 | 5 Maximum a player can carry 11 | 6 Starting Room 12 | 7 Total Treasures (*) 13 | 8 Word Length (only seen 3,4 or 5) 14 | 9 Time light source lasts. This counts down every time item 9 is 15 | in game. Brian Howarths games allow -1 for never run down. When 16 | it runs out the light item (9) is dumped in room 0 and a look 17 | done. Messages vary between interpreters and include things 18 | like 'Your light is flickering and dying' as well as 19 | 'Light runs out in %d turns'. 20 | 10 Number of Messages 21 | 11 Room you must put treasure in to score points. Not all games use 22 | the treasure system for scoring 23 | 24 | All the number of something values are the last item to be read counting 25 | from 0. Thus 3 messages, means messages 0, 1, 2 and 3. 26 | 27 | (*) This can be calculated in game. What happens if the number is wrong 28 | I don't know. I've found no games that it occurs in. 29 | 30 | A game has 16 (maybe more) binary flags, and 8 (maybe more counters). A few 31 | later games seem to have 2 (maybe more) values to store location numbers in 32 | temporarily - eg Yoho spell in Claymorgue. Flag 15 indicates whether 33 | it is dark, and flag 16 seems to get set when the lamp runs out. No 34 | other flag has an intrinsic meaning. 35 | 36 | Following the header is a list of game actions. Each is of the form 37 | 38 | 150*verb+noun 39 | 5 repeats of condition+20*value 40 | 150*action1+action2 41 | 150*action3+action4 42 | 43 | Conditions 44 | 45 | 0 is a parameter to one of the following actions 46 | 1 Item carried 47 | 2 Item in room with player 48 | 3 Item carried or in room with player 49 | 4 In room 50 | 5 Item not in room with player 51 | 6 Item not carried 52 | 7 Not in room 53 | 8 BitFlag is set. 54 | 9 BitFlag is cleared 55 | 10 Something carried (arg unused) 56 | 11 Nothing carried (arg unused) 57 | 12 Item not carried nor in room with player 58 | 13 Item is in game [not in room 0] 59 | 14 Item is not in game [in room 0] 60 | 15 CurrentCounter <= 61 | 16 CurrentCounter > 62 | 17 Object still in initial room (arg unused) 63 | 18 Object not in initial room (arg unused) 64 | 19 CurrentCounter = 65 | 66 | Actions. s are taken from the values provided by 67 | pseudo-conditionals with op-code 0 in the same action. 68 | 69 | 0 Does nothing 70 | 1-51 Print message 1-51. Some drivers add a space some add a newline. 71 | It does not seem to be possible to print message 0 72 | 52 Get item . Checks if you can carry it first 73 | 53 Drops item 74 | 54 Moves to room 75 | 55 Item is removed from the game (put in room 0) 76 | 56 The darkness flag is set 77 | 57 The darkness flag is cleared 78 | 58 Bitflag is set 79 | 59 The same as 55 (it seems - I'm cautious about this) 80 | 60 BitFlag is cleared 81 | 61 Death. Dark flag cleared, player moved to last room 82 | 62 Item put in room 83 | 63 Game over. 84 | 64 Describe room 85 | 65 Score 86 | 66 Inventory 87 | 67 BitFlag 0 is set 88 | 68 BitFlag 0 is cleared 89 | 69 Refill lamp (reset its time to live) and put it in player's inventory 90 | 70 Screen is cleared. This varies by driver from no effect upwards 91 | 71 Saves the game. Choices of filename etc depend on the driver alone. 92 | 72 Swap item and item locations 93 | 73 Continue: when finished with the current action, proceed to 94 | attempt all subsequent actions that have both noun and verb 95 | equal to 0 (subject to their conditions being satisfied). 96 | 74 Take item - no check is done too see if it can be carried. 97 | 75 Put item with item - Not certain seems to do this 98 | from examination of Claymorgue 99 | 76 Look (same as 64 ?? - check) 100 | 77 Decrement current counter. Will not go below 0 101 | 78 Print current counter value. Some drivers only cope with 0-99 102 | apparently 103 | 79 Set current counter value to 104 | 80 Swap location with current location-swap flag 105 | 81 Select a counter. Current counter is swapped with backup counter 106 | 107 | 82 Add to current counter 108 | 83 Subtract from current counter 109 | 84 Echo noun player typed without CR 110 | 85 Echo the noun the player typed 111 | 86 CR 112 | 87 Swap current location value with backup location-swap value 113 | 88 Wait 2 seconds 114 | 89 SAGA - draw picture (actually , as each 115 | Look() draws picture automatically) 116 | Older spectrum driver - crashes 117 | Spectrum Seas of Blood - seems to start Fighting Fantasy combat mode 118 | 90-101 Unused 119 | 102+ Print message 52-99 120 | 121 | 122 | This is followed by the words with verbs and nouns interleaved. A word with 123 | a * at the beginning is a synonym for the word above. 124 | Verb 1 is GO, verb 10 is GET, verb 18 is DROP (always). 125 | Nouns 1-6 are directions. 126 | 127 | This is followed by the rooms. Each room is 6 exits (north south east west 128 | up down) followed by a text string. 129 | 130 | Then come the messages, stored as a list of strings. 131 | 132 | Next come the items in the format item text then location. Item text may 133 | end with /TEXT/. This text is not printed but means that an automatic 134 | get/drop will be done for 'GET/DROP TEXT' on this item. Item names beginning 135 | with '*' are treasures. The '*' is printed. If you put all treasures in the 136 | treasure room (in the header) and 'SCORE' the game finishes with a well done 137 | message. Item location -1 is the inventory (255 on C64 and Spectrum tape 138 | games) and 0 means not in play in every game I've looked at. The lamp (always 139 | object 9) behaviour supports this belief. 140 | 141 | A set of strings follow this. In order they match to each line of verb/noun 142 | actions, and are comments. The Spectrum and C64 tape system where the 143 | database is compiled into the program has no comments. 144 | 145 | Finally three values follow which are version, adventure number and an 146 | unknown magic number. 147 | 148 | -------------------------------------------------------------------------------- /docs/notes/adventureland-maze: -------------------------------------------------------------------------------- 1 | Location Marker Exits 2 | N S E W U D 3 | ------------------------------------------------------------------------------- 4 | Cavern N/A N/A N/A N/A N/A SIGN 5 | SIGN sign WU NEWU NEWU -- -- WU 6 | NEWU SIGN -- WU SIGN WU -- 7 | WU -- -- -- SCRATCH SIGN -- 8 | SCRATCH scratchings ARROW SIGN WU SUD SUD ARROW 9 | SUD -- ARROW -- -- SCRATCH ARROW 10 | ARROW arrow, *rug* ARROW SIGN SIGN NEWU SCRATCH LAVA 11 | LAVA lava, *net* -- -- -- -- ARROW -- 12 | 13 | From cavern to lava: 14 | d 15 | d 16 | w 17 | d 18 | get rug 19 | d 20 | get net 21 | 22 | From lava, just SAY AWAY twice while carrying the rug. 23 | -------------------------------------------------------------------------------- /docs/notes/continue-action: -------------------------------------------------------------------------------- 1 | How the "continue" action works. By inspection of Adventureland, 2 | there is only one instance of it there: 3 | 4 | action DRO WAT when carried bottle and at room1 { 5 | print "Sizzle..." 6 | continue 7 | swap bottle bottle1 8 | } 9 | 10 | occur when here FIRESTONE { 11 | swap now FIRESTONE 12 | } 13 | 14 | This is illuminating. First, continue doesn't have to be the last 15 | instruction in an action: so it doesn't mean "proceed with the next 16 | action", it means "note that when you're done with this action that 17 | you may continue to the next". Second, note that the second action 18 | has a condition which must be met, so the continue also doesn't mean 19 | "actually do the next action", but "evaluate whether the next action 20 | should be done". (That's why the continue is used here: the second 21 | set of instructions should be executed only if the second condition is 22 | true as well as the first.) The probability associated with follow-on 23 | actions is ignored, though (and is probably always zero, to prevent 24 | those actions firing in other circumstances). 25 | 26 | Because conditions are still checked for actions reached by continue, 27 | we can not fold actions linked by continue into a single long action 28 | with multiple instructions, as tempting as that sounds. 29 | 30 | -- 31 | 32 | More: it's apparent from Voodoo Castle that a continue action means 33 | not just to attempt the next action, but ALL subsequent actions that 34 | have verb and noun both equal to zero. Here is the decompilation of 35 | the code for examining the Count: 36 | 37 | action LOO COF when here Coffin1 38 | print "A sign here says:" 39 | print "Count Cristo's been CURSED! [...]" 40 | continue 41 | print "There's a man here" 42 | 43 | occur 0% when !exists foot 44 | print "He's wearing a rabbit's foot" 45 | 46 | occur 0% when !exists ring 47 | print "Wearing a sapphire ring" 48 | 49 | At the start of the game, the rabbit's foot exists (elsewhere) and the 50 | ring does not, so the first occur does not fire but the second does. 51 | 52 | -------------------------------------------------------------------------------- /docs/notes/release-procedure.md: -------------------------------------------------------------------------------- 1 | * Ensure everyting is committed. 2 | * Finalise `Changelog.md`, setting the date for the new release. 3 | * Commit `Changelog.md` 4 | * Run `rake version:bump:minor` 5 | * Run `rake release` 6 | -------------------------------------------------------------------------------- /docs/scottkit.md: -------------------------------------------------------------------------------- 1 | # The `scottkit` program 2 | 3 | The document describes the program `scottkit` that invokes the Ruby Gem of the same name to compile, decompile and play adventure games. It is in the form of a Unix manual page. See [below](#see-also) for documentation of the various file formats. 4 | 5 | 6 | * [Name](#name) 7 | * [Synopsis](#synopsis) 8 | * [Description](#description) 9 | * [Mode options](#mode-options) 10 | * [Compilation options](#compilation-options) 11 | * [Play options](#play-options) 12 | * [Debugging options](#debugging-options) 13 | * [Examples](#examples) 14 | * [Diagnostics](#diagnostics) 15 | * [Author](#author) 16 | * [Licence](#licence) 17 | * [See also](#see-also) 18 | * [Bugs](#bugs) 19 | 20 | ## Name 21 | 22 | **scottkit** -- compile, decompile and play Scott Adams-format adventure games 23 | 24 | ## Synopsis 25 | 26 | **scottkit** 27 | [**-cdptgwebzWTRPCI**] 28 | [**-l** _savefile_] 29 | [**-r** _transcript_] 30 | [**-s** _seed_] 31 | [**-L** _lintopts_] 32 | _gamefile_ 33 | 34 | ## Description 35 | 36 | ScottKit compiles, decompiles and runs adventure games. It works with files in two formats: 37 | 38 | * Scott Adams TRS-80 format, which has become the canonical format for distributing games built for the Scott Adams engine. You can, for example, download all Adams’s own games, and play them using either ScottKit or the ScottFree interpreter. 39 | * A source format of my own devising, which makes it easy to create such games. 40 | 41 | ScottKit runs in three basic modes: it can play a Scott Adams TRS-80 format game, which is the default; 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. 42 | 43 | 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: 44 | 45 | scottkit game.sao 46 | scottkit -d game.sao > game.sck 47 | scottkit -c game.sck > game.sao 48 | scottkit -p game.sck 49 | 50 | 51 | The following options are supported, The mode options control which of the four different fundamental modes *scottkit* runs in; the compilation options affect how source-code compiles, and are ignored in play and decompile modes; the play options affect how games are played, and are ignored in compile and decompile modes. 52 | 53 | ### Mode options 54 | 55 | * (no option) [default] 56 | Treat _gamefile_ as compiled code, and play the game, accepting commands on standard input and emitting text on standard output. 57 | 58 | * **-c**, **--compile** 59 | Treat _gamefile_ as source code and compile it, emitting a compiled file on standard output. Any errors or warnings are printed on standard error. 60 | 61 | * **-d**, **--decompile** 62 | Treat _gamefile_ as compiled code and decompile it, emitting a source file on standard output. This is useful for inspecting games supplied in compiled form -- for example, to figure out how to safely wake the dragon in _Adventureland_. The output is suitable for feeding to **scottkit -c**. 63 | 64 | * **-p**, **--play-from-source** 65 | Treat _gamefile_ as source code, compile it to memory, and play the game immediately. Both compilation and play options are respected. 66 | 67 | ### Compilation options 68 | 69 | * **-t**, **--teleport** 70 | In addition to the actions specified in the source file, generates teleporting actions which can be used during development to allow easy access to difficult-to-reach parts of the map. An action TELEPORT _ROOM_ is generated for each room in the game. _ROOM_ is the name that the room is assigned in the source file, which may not be the same as its user-visible description. Note that if multiple rooms have names that are identical in the first few letters (e.g. MEADOW1, MEADOW2), then teleport actions for the rooms will be indistinguishable, and teleporting to the first of these locations only will be supported. 71 | 72 | * **-g**, **--superget** 73 | In addition to the actions specified in the source file, generates superget actions which can be used during development to allow easy access to difficult-to-reach items. An action SG _ITEM_ is generated for each item in the game. _ITEM_ is the name that the item is assigned in the source file, which may not be the same as its user-visible description. Note that if multiple items have names that are identical in the first few letters (e.g. LAMPLIT, LAMPEMPTY), then superget actions for the items will be indistinguishable, and supergetting the first of these items only will be supported. 74 | 75 | * **-L** _string_, **--lint** _string_ 76 | Lint: warn about questionable constructions in the source file. The _string_ consists of a sequence of lint options. At present, the following lint options are supported: 77 | * **e** 78 | Report rooms that do not have at least one way out (i.e. rooms that are traps). 79 | * **E** 80 | Report rooms that do not have at least two ways out (i.e. rooms that are dead ends). 81 | 82 | ### Play options 83 | 84 | * **-s** _number_, **--random-seed** _number_ 85 | Set the random seed to specified _number_, allowing a game to be played repeatably even if it contains random elements. Two runs of the same game using the same random seem will result in the same random events, whereas if no seed is specific then each run will generate different random numbers. 86 | 87 | * **-l** _file_, **--load-game** _file_ 88 | Load a previously saved game from the named _file_, allowing the player to continue from where the previous session was saved. (It is also possible to load a saved game from within ScottKit, using the special command **#LOAD** _filename_.) 89 | 90 | * **-f** _file_, **--read-file** _file_ 91 | Read the initial set of player commands from the named _file_, with control reverting to the player once the contents of the file have been exhausted. This is useful when creating walkthroughs, as they can be incrementally extended with the results of the user's experiments. Note that the effects of a given set of commands are only predictable when run using the same random seed on each run (see **-s** above). 92 | 93 | * **-e**, **--echo** 94 | Echo input commands to output. This is useful when feeding input to a game and capturing the output as a transcript. 95 | 96 | * **-W**, **--no-wait** 97 | Do not wait on pause actions or death. This is generally not a good idea when playing a game interactively, but allows automated run-throughs (with **-f**, see above) to proceed very quickly. 98 | 99 | * **-z**, **--sleep-at-end** 100 | Sleep for a long time after program ends. This is useful when running in a DOS Shell under Windows, so that error messages can be seen before the window closes after the program exits. 101 | 102 | * **-b**, **--bug-tolerant** 103 | Tolerate out-of-range room-numbers as the locations of items, and also compile such room-names using special names of the form `_ROOM`_number_. (This is not necessary when dealing with well-formed games, but _Buckaroo Banzai_ is not well-formed.) 104 | 105 | * **-w**, **--wizard** 106 | Wizard mode: enables debugging verbs. These can be typed during game-play to manipulate the world in ways not allowed for by the code of the game. 107 | 108 | * **#GO** -- "teleport": the noun is a room number, and the player immediately moves to the specified room.. 109 | 110 | * **#SG** -- "superget". the noun is an item number, and the specified item is added to the player's inventory irrespective of whether it is present or any other condition. 111 | 112 | * **#WHERE** -- locates an item. The noun is an item number, and the number of the room that contains that item is printed. Can be used with #GO to move to the room containing a specified item. 113 | 114 | * **#SET** -- sets a debugging flag. Acceptable nouns are: 115 | 116 | * **p** -- shows the result of parsing commands, as though **--show-tokens** had been specified. 117 | * **r** -- shows the result of random rolls, as though **--show-random** had been specified. 118 | * **c** -- shows the conditions of actions and occurrences as they are evaluated, as though **--show-conditions** had been specified. 119 | * **i** -- shows the instructions that are executed, as though **--show-instructions** had been specified. 120 | 121 | * **#CLEAR** -- clears a debugging flag. The same nouns are supported as for #SET. 122 | 123 | The #GO, #SG and #WHERE commands work only in terms of room and item _numbers_, not names, because they take effect only at run-time when they are working with a compiled game. Only the source file knows the names of room and items. That is why the **--teleport** and **--superget** compilation options are provided: because they take effect at compile-time, they support use of room and item names. 124 | 125 | ### Debugging options 126 | 127 | * **-T**, **--show-tokens** 128 | Show lexical tokens as they are read. This is the only debugging option that affects compile-time behaviour, and so has no corresponding run-time #SET wizard-mode command. 129 | 130 | * **-P**, **--show-parse** 131 | Show the results of parsing the verb and noun out of user input. The index numbers of the verb and noun within the compiled game is emitted. 132 | 133 | * **-R**, **--show-random** 134 | Show rolls of the random dice. This happens whenever an occurrence with less than a 100% chance of happening occurs. 135 | 136 | * **-C**, **--show-conditions** 137 | Show the conditions of actions and occurrences as they are evaluated, together with the result of their evaluation. 138 | 139 | * **-I**, **--show-instructions** 140 | Show instructions before they are executed. 141 | 142 | ## Examples 143 | 144 | In the follow short but complete transcript, we: 145 | * Create the source file, **trivial.sck**, for a game. 146 | * Compile it into a game file, **trivial.sao**. 147 | * Look at the compiled form of the game. 148 | * Play the game 149 | * Decompile the game file back to source. 150 | 151 | ``` 152 | $ cat > trivial.sck 153 | room chamber "beautifully decorated chamber" 154 | exit north cave 155 | room cave "dingy cave" 156 | exit south chamber 157 | $ scottkit -c trivial.sck > trivial.sao 158 | $ cat trivial.sao | fmt | grep . 159 | 0 -1 -1 18 2 -1 1 0 3 -1 0 1 160 | "AUT" "ANY" "GO" "NOR" "" "SOU" "" "EAS" "" "WES" "" "UP" "" "DOW" 161 | "" "" "" "" "" "" "GET" "" "" "" "" "" "" "" "" "" "" "" "" "" "" 162 | "" "DRO" "" 163 | 0 0 0 0 0 0 "" 2 0 0 0 0 0 "beautifully decorated chamber" 0 1 0 0 164 | 0 0 "dingy cave" 165 | "" 166 | 0 0 0 167 | $ 168 | $ scottkit trivial.sao 169 | ScottKit, a Scott Adams game toolkit in Ruby. 170 | (C) 2010-2017 Mike Taylor 171 | Distributed under the GNU GPL version 2 license, 172 | 173 | I'm in a beautifully decorated chamber 174 | Obvious exits: North. 175 | 176 | Tell me what to do ? n 177 | 178 | I'm in a dingy cave 179 | Obvious exits: South. 180 | 181 | Tell me what to do ? ^D 182 | $ scottkit -d trivial.sao 183 | # 3 rooms, 0 items, 0 actions 184 | # 1 messages, 0 treasures, 19 verbs/nouns 185 | ident 0 186 | version 0 187 | wordlen 3 188 | maxload -1 189 | lighttime -1 190 | unknown1 0 191 | unknown2 0 192 | start chamber 193 | treasury chamber 194 | 195 | room chamber "beautifully decorated chamber" 196 | exit north cave 197 | 198 | room cave "dingy cave" 199 | exit south chamber 200 | 201 | $ 202 | ``` 203 | 204 | ## Diagnostics 205 | 206 | Exits with status: 207 | 208 | * 0 if all is well 209 | * 1 if compilation fails 210 | * 2 if the command-line is invalid 211 | 212 | ## Author 213 | 214 | Mike Taylor `` 215 | 216 | ## Licence 217 | 218 | All code and documentation is furnished under the 219 | [GNU General Public License, version 2](../GPL-2.txt). 220 | 221 | Note that the Scott Adams and Brian Haworth adventure games are _not_ incuded under this licence. Although they are freely available for download, all rights are reserved to their respective copyright holders. 222 | 223 | ## See also 224 | 225 | * [The source code](https://github.com/MikeTaylor/scottkit) 226 | * [The reference guide for the ScottKit source language](reference.md) 227 | * [The ScottKit tutorial](tutorial.md) 228 | * [Description of the compiled format](notes/Definition.txt) 229 | * [Description of saved-game format](notes/Definition-saved-game.txt) 230 | * [ScottFree](https://packages.debian.org/stable/scottfree), another interpreter for adventure games in Scott Adams compiled format 231 | 232 | ## Bugs 233 | 234 | See 235 | [the issue tracker](https://github.com/MikeTaylor/scottkit/issues) 236 | and the TODOs list at the end of 237 | [the change-log](https://github.com/MikeTaylor/scottkit/blob/master/ChangeLog.md). 238 | 239 | -------------------------------------------------------------------------------- /games/.gitignore: -------------------------------------------------------------------------------- 1 | dan-and-matt.sao 2 | -------------------------------------------------------------------------------- /games/adams/.gitignore: -------------------------------------------------------------------------------- 1 | *.dat 2 | *.sck 3 | 0readme.txt 4 | -------------------------------------------------------------------------------- /games/adams/AdamsGames.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MikeTaylor/scottkit/460deaf8d8411379c9a6855f85c7420b6894465c/games/adams/AdamsGames.zip -------------------------------------------------------------------------------- /games/adams/Makefile: -------------------------------------------------------------------------------- 1 | # This Makefile fetches an archive of Scott Adams's games from a 2 | # well-known location and unpacks it; make clean removes the unpacked 3 | # file and make realclean also removes the downloaded archive. I 4 | # don't want to include the Adams games in the ScottKit distribution, 5 | # as they are still under copyright and not really mine to distribute. 6 | 7 | adv01.dat: AdamsGames.zip 8 | unzip -o AdamsGames.zip 9 | 10 | AdamsGames.zip: 11 | wget -nv http://ifmirror.russotto.net/if-archive/scott-adams/games/scottfree/AdamsGames.zip 12 | 13 | clean: 14 | rm -f 0readme.txt *.dat 15 | 16 | realclean: clean 17 | rm -f AdamsGames.zip 18 | 19 | -------------------------------------------------------------------------------- /games/crystal/crystal.map: -------------------------------------------------------------------------------- 1 | Crystal of Chaos 2 | ================ 3 | 4 | Mike Taylor 5 | Started Monday 9th April 2001 6 | 7 | 8 | Empty Room 9 | | 10 | = 11 | | 12 | Passage 13 | [oak door -> oak, entrance] 14 | = 15 | | 16 | Tunnel 17 | [plywood door -> plywood, passage] 18 | = 19 | | 20 | Swamp-----------Outcrop 21 | [cypress, mud, [balsa door -> balsa, tunnel] 22 | |oil, gas, | 23 | |chiggers] | 24 | | | 25 | Hut-------------Clearing--------Glade--->CLIMB, [beech] [nest, honey, bees] 27 | match] | | 28 | | | 29 | Forest----------Forest2 30 | [bear] [pool] 31 | | vGO POOL, ^Up 32 | | | 33 | Forest Path On pool 34 | [vase] | 35 | ______/(why here?!) | 36 | / | 37 | Inside vase In Pool 38 | [key] [inflow] 39 | vGO INFLOW 40 | | 41 | River1 42 | | 43 | | 44 | | 45 | River2 46 | | 47 | | 48 | | 49 | River3 50 | | 51 | | 52 | | 53 | River4 54 | | 55 | | 56 | | 57 | River Chamber 58 | [*stoat*] 59 | | 60 | | 61 | Cell-----||-----Prison----------Central Ch.-----Junction--------Control Room 62 | [goblin] [iron door, | [red button, 63 | =bronze door] | blue button, 64 | | | lever] 65 | Cell2 Steel Room 66 | [steel rope] | 67 | | 68 | | 69 | Chasm Hall 70 | 71 | -- 72 | 73 | Can hold breath for four moves: 74 | GO POOL 75 | GO INFLOW 76 | DROP VASE 77 | GO VASE (at river2) 78 | (BREATHE; HOLD BREATH) 79 | LEAVE VASE 80 | S 81 | S 82 | S 83 | And if you don't do the vase-breathing trick, it gets you: 84 | GO POOL 85 | GO INFLOW 86 | S 87 | S 88 | as far as river3, which is where we need to see the first glow of light 89 | 90 | -- 91 | 92 | Another underwater-movement puzzle: 93 | 94 | Pool1 Pool2 95 | \ \ 96 | (^Up, vDown) (^Up, vDown) 97 | / / 98 | Bottom1---------Bottom2 99 | 100 | You can only swim down from Pool to Bottom while carrying a 101 | brick as ballast, but then you can only swim back up if you're NOT 102 | carrying it. That's fine for going through once in one direction, but 103 | you can't get back. The trick is to tie a rope to the brick, swim 104 | down, go east or west as necessary, drop the brick and swim up while 105 | still carrying the rope. Then when you're out of the pool, you can 106 | pull the rope to bring the brick back up. 107 | 108 | --- 109 | 110 | single-location maze 111 | "win game" spell 112 | 113 | --- 114 | 115 | giant frogs bars your way. kiss => turns to prince 116 | 117 | --- 118 | 119 | "The stoat was broken into five pieces. We were going to scatter them 120 | across the kingdom, but we never go around to it, so they're all in 121 | this cupboard." 122 | 123 | But you'll need some glue 124 | 125 | And it turns out to be two-part epoxy 126 | 127 | -------------------------------------------------------------------------------- /games/crystal/crystal.sck: -------------------------------------------------------------------------------- 1 | # Modified from crystal.sac v1.7 (2006-11-11) from Games::ScottAdams 2 | 3 | # crystal.sck -- Scott Adams source file for _Crystal of Chaos_ 4 | 5 | # ---------------------------------------------------------------------------- 6 | # Global configuration 7 | 8 | ident 18400 9 | version 1 10 | wordlen 3 11 | maxload 5 12 | start hut 13 | treasury hut 14 | 15 | # Standard synonyms 16 | verbgroup go enter follow run walk 17 | verbgroup take get 18 | verbgroup leave drop 19 | verbgroup cut chop 20 | verbgroup batter ram 21 | 22 | # ---------------------------------------------------------------------------- 23 | # Infrastructure actions (I don't think any game would ever omit these) 24 | 25 | action inventory: inventory 26 | action take inventory: inventory 27 | action score: score 28 | action save game: save_game 29 | action look: look 30 | 31 | # The path is dark; nowhere else is 32 | occur when "at" path and !flag 15 33 | set_dark 34 | look 35 | 36 | occur when !at path and flag 15 37 | clear_dark 38 | look 39 | 40 | occur when !flag 1 41 | set_flag 1 42 | print "Welcome to `CRYSTAL OF CHAOS`" 43 | print "Written by Mike Taylor, starting Monday 10th April 2001" 44 | print "This is a demo for the `ScottKit` adventure system" 45 | print "" 46 | print "Your task is to find the six crown jewels of the" 47 | print "kingdom and store them in this hut. They are:" 48 | print "a platinum chain, a gold crown, a silver medallion" 49 | print "a bronze sceptre, a zinc goblet and a tin stoat." 50 | 51 | 52 | # ---------------------------------------------------------------------------- 53 | # Use of flags 54 | # flag 1: Set forever once welcome message has been printed. 55 | # flag 2: True immediately after balsa wood is lit. 56 | # flag 3: True immediately after plywood is lit. 57 | # flag 4: True immediately after oak is lit. 58 | # flag 5: True while under water. 59 | # flag 6: Set true forever when first in the treasure clearing. 60 | # flag 7: True if all treasures but the stoat have been stored. 61 | # flag 8: True once the missing stoat message has been printed. 62 | # 63 | # Use of saved locations 64 | # location 1: when in vase, contains room player was in before. 65 | # 66 | # Use of counters: 67 | # counter 1: number of turns remaining to hold breath 68 | 69 | # ---------------------------------------------------------------------------- 70 | # Preamble actions (must fire after body actions) 71 | 72 | occur when "at" clearing and !flag 6 73 | set_flag 6 74 | print "Oh, there they are. That wasn't as hard as I expected." 75 | 76 | # Check whether we have stored all treasures except the stoat 77 | occur when "at" hut 78 | set_flag 7 79 | #print "setting flag 7 (in hut)" 80 | 81 | occur when !here chain 82 | clear_flag 7 83 | #print "clearing flag 7 (no chain)" 84 | 85 | occur when !here crown 86 | clear_flag 7 87 | #print "clearing flag 7 (no crown)" 88 | 89 | occur when !here medallion 90 | clear_flag 7 91 | #print "clearing flag 7 (no medallion)" 92 | 93 | occur when !here sceptre 94 | clear_flag 7 95 | #print "clearing flag 7 (no sceptre)" 96 | 97 | occur when !here goblet 98 | clear_flag 7 99 | #print "clearing flag 7 (no goblet)" 100 | 101 | occur when flag 7 and !flag 8 102 | set_flag 8 103 | print "Ah, looks like I'm still missing the stoat." 104 | ### This message appears even if the stoat is already stored. 105 | 106 | # Check whether we're under water ... 107 | occur when "at" pool set_flag 5 108 | occur when "at" river1 set_flag 5 109 | occur when "at" river2 set_flag 5 110 | occur when "at" river3 set_flag 5 111 | occur when "at" river4 set_flag 5 112 | 113 | # ... or whether we've just emerged from under water 114 | occur when "at" forest2 clear_flag 5 115 | occur when "at" chamber clear_flag 5 116 | occur when "at" vase clear_flag 5 117 | occur when "at" dead clear_flag 5 118 | 119 | occur when counter_eq 1 120 | print "I have to breathe NOW!" 121 | 122 | occur when counter_gt 0 123 | dec_counter 124 | 125 | occur when counter_gt 0 126 | print "I can only hold my breath for" 127 | print_counter 128 | print "more turns." 129 | 130 | occur when counter_eq 0 and flag 5 131 | print "I can't breathe ..." 132 | pause 133 | clear_flag 5 134 | die 135 | comment "Death due to lack of breath" 136 | 137 | # We'd like the next three occurs to go after the action for LIGHT 138 | # BALSA below. But that doesn't work, because although any number of 139 | # occurs may fire on a given turn, action-and-occur processing stops 140 | # immediately after the first successful action. (I determined this 141 | # by experiment: I couldn't determine the intent of the scottfree 142 | # source to save my life.) Instead, we do these occur's at the very 143 | # start of the _next_ turn -- which from the player's perspective is 144 | # indistinguishable from the end of the previous one. 145 | 146 | occur when flag 2 and here plywood 147 | print "The plywood also catches fire and burns quickly." 148 | destroy plywood 149 | set_flag 3 150 | 151 | occur when flag 3 and here oak 152 | print "The oak catches, and becomes a roaring fire." 153 | print "Smoke pours upwards." 154 | destroy oak 155 | drop fire 156 | set_flag 4 157 | 158 | occur when flag 4 and "at" glade 159 | destroy bees 160 | put drowsy_bees beech 161 | 162 | occur 163 | clear_flag 2 164 | clear_flag 3 165 | clear_flag 4 166 | comment "Fire-building must happen all in one go" 167 | 168 | action chop when !present axe 169 | print "I can't chop anything without an axe." 170 | 171 | action ram when !present trunk 172 | print "I don't have a battering ram." 173 | 174 | action light when !present match 175 | print "I don't have anything to light it with." 176 | 177 | 178 | # ---------------------------------------------------------------------------- 179 | # Rooms, Items and associated Actions 180 | 181 | room hut "small wooden hut." 182 | exit east clearing 183 | 184 | item sign "Sign" 185 | 186 | action read sign when present sign 187 | print "It says - `Leave *TREASURES* here, then say: SCORE`" 188 | 189 | item axe "Axe" 190 | called axe 191 | noungroup axe ax 192 | 193 | item match "Single match" 194 | called match 195 | 196 | room clearing "clearing. There's a small hut to the west." 197 | exit north swamp 198 | exit east glade 199 | exit south forest 200 | exit west hut 201 | 202 | item chain "*Platinum chain*" 203 | called chain 204 | 205 | item crown "*Gold crown*" 206 | called crown 207 | 208 | item medallion "*Silver medallion*" 209 | called medallion 210 | 211 | item sceptre "*Bronze sceptre*" 212 | called sceptre 213 | 214 | item goblet "*Zinc goblet*" 215 | called goblet 216 | 217 | room glade "glade" 218 | exit west clearing 219 | exit north outcrop 220 | exit south forest2 221 | 222 | item beech "Beech tree" 223 | 224 | action climb tree when here beech 225 | goto beech 226 | look2 227 | 228 | room beech "the top of a beech tree" 229 | exit down glade 230 | 231 | item nest "Bees' nest" 232 | 233 | item honey "Wild honey" 234 | called honey 235 | 236 | action get honey when here bees 237 | print "No! Bees would sting me!" 238 | 239 | item bees "Killer bees" 240 | 241 | item drowsy_bees "Drowsy bees" 242 | nowhere 243 | 244 | action help when here bees 245 | print "Smoke 'em out!" 246 | 247 | room swamp "dismal swamp" 248 | exit east outcrop 249 | exit south clearing 250 | 251 | item cypress "Cypress tree" 252 | 253 | action chop tree when here cypress 254 | print "TIMBER!" 255 | swap cypress trunk 256 | drop stump 257 | look2 258 | 259 | item stump "-SOLID- stump" 260 | nowhere 261 | 262 | action examine stump when here stump 263 | print "There's nothing there all right! Maybe I should forget it?" 264 | 265 | item trunk "Trunk of cypress tree" 266 | called trunk 267 | nowhere 268 | 269 | item mud "Evil smelling mud" 270 | called mud 271 | 272 | item gas "Swamp gas" 273 | 274 | item slime "Patches of `OILY` slime" 275 | called oil 276 | 277 | item chiggers "Chiggers" 278 | called chiggers 279 | 280 | room outcrop "rocky area by an outcrop" 281 | exit west swamp 282 | exit south glade 283 | 284 | item bdoor "Balsa-wood door set into the rock" 285 | 286 | item lamp "Old-fashioned brass lamp" 287 | called lamp 288 | lightsource lamp 289 | 290 | action open door when here bdoor 291 | print "It's locked." 292 | 293 | verbgroup kick smash break 294 | 295 | action kick door when here bdoor 296 | swap bdoor tunnel 297 | drop balsa 298 | print "It splinters easily." 299 | print "There's a tunnel beyond." 300 | look2 301 | 302 | action chop door when here bdoor 303 | swap bdoor tunnel 304 | print "CRUNCH! It's smashed to smithereens!" 305 | print "There's a tunnel beyond." 306 | look2 307 | comment "no balsa wood" 308 | 309 | action ram door when here bdoor 310 | destroy bdoor 311 | drop tunnel 312 | print "DOOSH! It's absolutely annihilated!" 313 | print "There's a tunnel beyond." 314 | look2 315 | comment "no balsa wood" 316 | 317 | item balsa "Balsa wood" 318 | called balsa 319 | nowhere 320 | 321 | item tunnel "Tunnel disappears into the rock" 322 | nowhere 323 | 324 | action go tunnel when here tunnel 325 | goto tunnel 326 | look2 327 | 328 | room tunnel "dingy north-south tunnel" 329 | exit south outcrop 330 | 331 | item pdoor "Plywood door blocks the way north" 332 | 333 | action open door when here pdoor 334 | print "It's also locked." 335 | 336 | action kick door when here pdoor 337 | print "Ouch!" 338 | 339 | action chop door when here pdoor 340 | swap pdoor passage 341 | drop plywood 342 | print "CRUNCH!" 343 | print "There's a passage beyond." 344 | look2 345 | 346 | action ram door when here pdoor 347 | swap pdoor passage 348 | print "DOOSH! It's absolutely annihilated!" 349 | print "There's a passage beyond." 350 | look2 351 | comment "no plywood" 352 | 353 | item plywood "Plywood" 354 | called plywood 355 | nowhere 356 | 357 | item passage "Passage disappears into the rock" 358 | nowhere 359 | 360 | action go passage when here passage 361 | goto passage 362 | look2 363 | 364 | room passage "gloomy north-south passage" 365 | exit south tunnel 366 | 367 | item odoor "Oak door blocks the way north" 368 | 369 | action open door when here odoor 370 | print "OF COURSE it's locked!" 371 | 372 | action kick door when here odoor 373 | print "Ouch!" 374 | 375 | action chop door when here odoor 376 | print "It's too solid for the axe to make much impression." 377 | 378 | action ram door when here odoor 379 | swap odoor entrance 380 | drop oak 381 | print "DOOSH!" 382 | print "There's an entrance beyond." 383 | look2 384 | 385 | item oak "Oak" 386 | called oak 387 | nowhere 388 | 389 | item entrance "Entrance to the north" 390 | nowhere 391 | 392 | action go entrance when here entrance 393 | goto empty 394 | look2 395 | 396 | room empty "empty room" 397 | exit south passage 398 | 399 | item fire "Blazing hot fire" 400 | nowhere 401 | 402 | action light plywood when "carried" plywood 403 | print "Not while I'm carrying it!" 404 | 405 | action light plywood when here plywood 406 | print "I can't get it to catch fire." 407 | print "My match goes out." 408 | destroy match 409 | 410 | action light oak when here oak 411 | print "There's no way it will catch fire." 412 | print "My match goes out." 413 | destroy match 414 | 415 | action light oak when "carried" oak 416 | print "Not while I'm carrying it!" 417 | 418 | action light balsa when "carried" balsa 419 | print "Not while I'm carrying it!" 420 | 421 | action light balsa when here balsa 422 | print "OK. It burns up very quickly." 423 | print "My match goes out." 424 | destroy match 425 | destroy balsa 426 | set_flag 2 427 | 428 | room forest "forest" 429 | exit north clearing 430 | exit east forest2 431 | 432 | item path "Path leads south into the forest" 433 | 434 | action go path when here bear 435 | print "Bear won't let me" 436 | 437 | action go path when "at" forest 438 | goto path 439 | look2 440 | 441 | item bear "Very thin black bear" 442 | 443 | action give honey when here bear and present honey 444 | destroy bear 445 | destroy honey 446 | drop sleeping 447 | print "Bear eats the honey and falls asleep." 448 | 449 | item sleeping "Sleeping bear" 450 | nowhere 451 | 452 | room path "overgrown path in a dark forest" 453 | exit north forest 454 | 455 | item vase "Huge vase" 456 | called vase 457 | 458 | action examine vase when present vase 459 | print "It's bigger than I am." 460 | 461 | action go vase when here vase 462 | swap_specific_room 1 463 | goto vase 464 | look2 465 | 466 | action leave vase when "at" vase 467 | swap_specific_room 1 468 | look2 469 | 470 | action get out when "at" vase 471 | swap_specific_room 1 472 | look2 473 | 474 | room vase "*I'm INSIDE a huge vase!" 475 | 476 | item key "Iron key" 477 | called key 478 | 479 | room forest2 "forest" 480 | exit north glade 481 | exit west forest 482 | 483 | item pool "Bubbling pool" 484 | 485 | action go pool when here pool 486 | goto onpool 487 | look2 488 | 489 | action hold breath when counter_gt 0 490 | print "I'm already holding my breath!" 491 | 492 | action hold breath 493 | set_counter 6 494 | print "OK" 495 | 496 | room onpool "bubbling pool, treading water" 497 | exit north forest2 498 | exit down pool 499 | 500 | room pool "bubbling pool, just below the water level" 501 | exit up onpool 502 | exit south river1 503 | 504 | item inflow "inflow from the south" 505 | 506 | action go inflow when here inflow 507 | goto river1 508 | look2 509 | 510 | room river1 "*I'm swimming in an underground river. 511 | Light pours from the north." 512 | exit north pool 513 | exit south river2 514 | 515 | room river2 "*I'm swimming in an underground river. 516 | There's a faint glimmer of light to the north." 517 | exit north river1 518 | exit south river3 519 | 520 | room river3 "*I'm swimming in an underground river. 521 | There's a faint glimmer of light to the south." 522 | exit north river2 523 | exit south river4 524 | 525 | room river4 "*I'm swimming in an underground river. 526 | Light pours from the south." 527 | exit north river3 528 | exit south chamber 529 | 530 | room chamber "brightly lit underground chamber. 531 | An underground river disappears into the north wall." 532 | exit north river4 533 | # exit south central 534 | 535 | item stoat "*Tin stoat*" 536 | called stoat 537 | 538 | room central "central underground chamber. Passages leave in all directions." 539 | exit north chamber 540 | exit west prison 541 | exit east junction 542 | 543 | room prison "prison in an undergound complex. Doors lead to prison cells" 544 | exit east central 545 | 546 | item idoor "Iron door leads south" 547 | 548 | item brdoor "Bronze door leads west" 549 | 550 | action knock door when "at" prison 551 | print "Which door? Use `knock iron` or `knock bronze`." 552 | 553 | action knock iron when here idoor 554 | print "Nothing happens." 555 | 556 | action knock bronze when here brdoor 557 | print "Nothing seems to happen." 558 | 559 | room cell1 "dirty prison cell with muddy straw on the ground" 560 | exit east prison 561 | exit north hut 562 | 563 | item goblin "small goblin" 564 | 565 | room junction "junction between an east-west passage and one that leads south" 566 | exit west central 567 | exit east control 568 | exit south steel 569 | 570 | room control "control room filled with humming, crackling machinery" 571 | exit west junction 572 | 573 | item red "Red button" 574 | 575 | item blue "Blue button" 576 | 577 | item level "Lever" 578 | 579 | room steel "square room with a steel floor" 580 | exit north junction 581 | exit south chasm 582 | 583 | room chasm "vast hall which is split by a deep chasm running from east to west" 584 | exit north steel 585 | 586 | room dead "*I'm dead. Great. Try again." 587 | exit east hut 588 | 589 | 590 | # ---------------------------------------------------------------------------- 591 | # Postamble actions (must fire after body actions) 592 | 593 | action help: 594 | print "You'll have to figure it out for yourself." 595 | 596 | action examine: 597 | print "It looks like a pretty average" 598 | println_noun 599 | 600 | action wait: 601 | print "OK" 602 | 603 | -------------------------------------------------------------------------------- /games/crystal/crystal.solution: -------------------------------------------------------------------------------- 1 | read sign 2 | east 3 | get chain 4 | get crown 5 | get medallion 6 | get sceptre 7 | get goblet 8 | west 9 | drop chain 10 | drop crown 11 | drop medallion 12 | drop sceptre 13 | drop goblet 14 | get axe 15 | get match 16 | east 17 | north 18 | chop tree 19 | get trunk 20 | east 21 | kick door 22 | go tunnel 23 | chop door 24 | go passage 25 | ram door 26 | go entrance 27 | drop trunk 28 | drop axe 29 | south 30 | get oak 31 | south 32 | get plywood 33 | south 34 | get balsa 35 | south 36 | climb tree 37 | get honey 38 | down 39 | drop oak 40 | drop plywood 41 | drop balsa 42 | light balsa 43 | climb tree 44 | get honey 45 | down 46 | north 47 | get lamp 48 | west 49 | south 50 | south 51 | follow path 52 | give honey 53 | follow path 54 | get vase 55 | north 56 | east 57 | examine vase 58 | go pool 59 | hold breath 60 | down 61 | go inflow 62 | south 63 | drop vase 64 | go vase 65 | get key 66 | hold breath 67 | get out 68 | south 69 | south 70 | south 71 | get stoat 72 | hold breath 73 | north 74 | north 75 | north 76 | go vase 77 | wait 78 | hold breath 79 | get out 80 | north 81 | north 82 | up 83 | north 84 | north 85 | west 86 | west 87 | drop stoat 88 | score 89 | -------------------------------------------------------------------------------- /games/dan-and-matt/dan-and-matt.sck: -------------------------------------------------------------------------------- 1 | # Map 2 | # 3 | # Chamber---------Dungeon----||---Disneyland 4 | # | 5 | # | 6 | # | 7 | # Lair 8 | # | 9 | # = 10 | # | 11 | # Legoland 12 | 13 | # flag 1: cheeseburger has been eaten 14 | # flag 2: potion has been drunk 15 | # flag 3: initialisation done 16 | # flag 4: first entry to Disneyland 17 | 18 | occur when !flag 3 19 | set_counter 3 20 | set_flag 3 21 | print "Welcome to Dan and Matt's game" 22 | 23 | room chamber "square chamber. Leave treasure here to score points." 24 | exit east dungeon 25 | 26 | item box box 27 | 28 | action examine box when here box and !exists pistol 29 | print "You notice it contains a pistol, which you take out." 30 | drop pistol 31 | 32 | action open box when here box and !exists pistol 33 | print "It contains a pistol, which you take out." 34 | drop pistol 35 | 36 | action examine box when here box 37 | print "It's empty now." 38 | 39 | item pistol "pistol" called pistol 40 | nowhere 41 | 42 | noungroup pistol gun 43 | 44 | room dungeon "gloomy dungeon" 45 | exit west chamber 46 | exit south lair 47 | 48 | item bullets "bullets" called bullets 49 | 50 | action examine bullets when present bullets 51 | print "There are" 52 | print_counter 53 | print "bullets left" 54 | 55 | item xyz "pink cheeseburger" called cheeseburger 56 | 57 | action examine cheeseburger when here xyz 58 | print "This pink cheeseburger looks as if it has been eaten before." 59 | 60 | action eat cheeseburger when present xyz 61 | destroy xyz 62 | print "Om nom nom." 63 | set_flag 1 64 | 65 | item fireplace fireplace 66 | 67 | action eat fireplace when here fireplace and !flag 2 68 | print "Your mouth is now on fire." 69 | game_over 70 | 71 | action eat fireplace when here fireplace and flag 2 72 | print "Your mouth is invulnerable and the fire is tasty!" 73 | print "You find something" 74 | swap lollipop fireplace 75 | look 76 | 77 | item lollipop "*golden lollipop*" called lollipop 78 | nowhere 79 | 80 | action eat lollipop when present lollipop 81 | print "I'd better not." 82 | 83 | item door "heavy stone door" 84 | 85 | action open door when here door and !flag 1 86 | print "You're too weak to move it." 87 | 88 | action open door when here door and flag 1 89 | print "Energised by the cheeseburger, you manage to shift it" 90 | destroy door 91 | drop opendoor 92 | 93 | item opendoor "wide open stone door" 94 | nowhere 95 | 96 | room dis "*I'm in Disneyland" 97 | exit west dungeon 98 | 99 | action go door when here opendoor 100 | goto dis 101 | look 102 | 103 | item bloke "funny-looking bloke with toothbrush moustache" 104 | 105 | item deadbloke "funny-looking dead bloke" nowhere called bloke 106 | 107 | # Because there are so many conditions on this action, most of the 108 | # condition slots that would hold instruction parameters are already 109 | # filled, and so the argument to the swap instruction won't fit, so we 110 | # need to move them in to the next action (which we of course code as 111 | # "occur 0%") and use a continue instruction. 112 | # 113 | action shoot bloke when "carried" pistol and "carried" bullets and counter_gt 0 114 | print "He curls up and dies, dropping a potion." 115 | drop potion 116 | dec_counter 117 | continue 118 | 119 | occur 0% 120 | swap bloke deadbloke 121 | 122 | occur when "at" dis and !flag 4 123 | print "Bloke says: 'Welcome to Disneyland!'" 124 | set_flag 4 125 | 126 | item potion "potion of invulnerability" called potion 127 | nowhere 128 | 129 | action drink potion when present potion 130 | print "Yum, that tasted of boiled fish-heads." 131 | swap potion bottle 132 | set_flag 2 133 | 134 | item bottle "empty potion bottle" nowhere 135 | 136 | room lair "dragon's lair" 137 | exit north dungeon 138 | 139 | item passage "passage leads south" 140 | 141 | item dragon "huge golden dragon" 142 | 143 | occur when "carried" pistol and "carried" bullets and counter_gt 0 144 | and here dragon 145 | print "The dragon doesn't like the look of my weapon: he eats me!" 146 | game_over 147 | 148 | action go passage when here dragon 149 | print "I can't get past the dragon!" 150 | 151 | action shoot dragon when "carried" pistol and "carried" bullets and counter_gt 0 152 | print "The dragon is very slightly irritated ... just enough to eat me." 153 | game_over 154 | 155 | action give bloke when present deadbloke and present dragon 156 | destroy deadbloke 157 | print "The dragon eats the dead bloke and falls asleep." 158 | swap dragon sleepingdragon 159 | 160 | item sleepingdragon "peacefully snoring dragon" nowhere 161 | 162 | item sign "sign stuck in the ground" 163 | at dungeon 164 | 165 | action examine sign when here sign 166 | print "'Do not take weapons south!'" 167 | 168 | action go passage when here passage and !here dragon 169 | goto legoland 170 | look 171 | 172 | room legoland "*I'm in Legoland!" 173 | exit north lair 174 | 175 | item brick "*golden brick*" called brick 176 | 177 | action score: score 178 | action look: look 179 | action inventory: inventory 180 | action save game: save_game 181 | action quit: game_over 182 | -------------------------------------------------------------------------------- /games/dan-and-matt/dan-and-matt.solution: -------------------------------------------------------------------------------- 1 | examine box 2 | get gun 3 | examine box 4 | east 5 | examine sign 6 | get bullets 7 | examine bullets 8 | open door 9 | eat cheeseburger 10 | open door 11 | shoot bloke 12 | drink potion 13 | eat fire 14 | get lollipop 15 | west 16 | drop lollipop 17 | score 18 | east 19 | go door 20 | get bloke 21 | west 22 | drop gun 23 | south 24 | go passage 25 | give bloke 26 | go passage 27 | get brick 28 | north 29 | north 30 | west 31 | drop brick 32 | score 33 | -------------------------------------------------------------------------------- /games/howarth/.gitignore: -------------------------------------------------------------------------------- 1 | ReadMe.txt 2 | *.dat 3 | -------------------------------------------------------------------------------- /games/howarth/Makefile: -------------------------------------------------------------------------------- 1 | # See comments for ../adams/Makefile 2 | 3 | 1_baton.dat: mysterious.tar.gz 4 | tar xzf mysterious.tar.gz 5 | 6 | mysterious.tar.gz: 7 | wget -nv http://ifmirror.russotto.net/if-archive/scott-adams/games/scottfree/mysterious.tar.gz 8 | 9 | clean: 10 | rm -f ReadMe.txt *.dat 11 | 12 | realclean: clean 13 | rm -f mysterious.tar.gz 14 | 15 | -------------------------------------------------------------------------------- /games/howarth/mysterious.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MikeTaylor/scottkit/460deaf8d8411379c9a6855f85c7420b6894465c/games/howarth/mysterious.tar.gz -------------------------------------------------------------------------------- /games/nosferatu/.gitignore: -------------------------------------------------------------------------------- 1 | nosferatu.sao 2 | -------------------------------------------------------------------------------- /games/nosferatu/Makefile: -------------------------------------------------------------------------------- 1 | test: nosferatu.sao 2 | scottkit -W -e $< < nosferatu.sol | diff nosferatu.transcript - 3 | 4 | nosferatu.sao: nosferatu.sck 5 | scottkit -c $< > $@ 6 | diff nosferatu.regression $@ 7 | 8 | rebuild: 9 | scottkit -c nosferatu.sck > nosferatu.regression 10 | scottkit -W -e nosferatu.sao < nosferatu.sol > nosferatu.transcript 11 | 12 | clean: 13 | rm -f nosferatu.sao 14 | 15 | -------------------------------------------------------------------------------- /games/nosferatu/README: -------------------------------------------------------------------------------- 1 | This is a re-implementation of my 1982 game _Nosferatu_: 2 | http://www.miketaylor.org.uk/tech/advent/nos/ 3 | 4 | It was originally written in lovingly hand-crafted BASIC for the 5 | VIC-20 with 8k expansion, and marketed by Terminal Software. 6 | 7 | To play the VIC-20 original in an emulator: 8 | $ xvic -memory 8k -autostart ~/web/new/comp/tech/advent/nos/NOSFERAT.TAP 9 | 10 | Known bugs: 11 | * "wait" always summons bus. 12 | * "climb ladder" always works as a teleport 13 | * The end of the game has not been coded 14 | -------------------------------------------------------------------------------- /games/nosferatu/TODO: -------------------------------------------------------------------------------- 1 | Things still to be done, based on my analysis of the BASIC code: 2 | $HOME/web/new/comp/tech/advent/nos/basic-notes 3 | 4 | To do: 5 | 1 OK Handle "quit" command 6 | 2 OK Handle "scream" command: "Yaaaagh!", then nothing happens 7 | 3 OK Dropping water: "It soaks away." Then the water is gone for good 8 | 4 OK "open door" at shed results in "My key won't fit!" 9 | 5 OK Drinking whisky makes me stronger for 6 turns, then: "I feel weaker." 10 | 6 OK "I've already done it!" for sarcophagus already open 11 | 7 OK "I've already done it!" for whisky already drunk 12 | 8 OK "I've already done it!" for thicket already chopped 13 | 9 OK "I've already done it!" for hole already dug 14 | 10 OK "It's locked!" when opening either door without key 15 | 11 OK "He doesn't want it." when giving something other than coins 16 | 12 OK "Time passes..." pause "Nothing happens." for wait 17 | 13 OK "Nothing happens" when saying anything 18 | 14 OK "It bounces off." when thowing the axe at the wrong thing 19 | 15 OK GO BUS when it's not present: "It's not here." 20 | 16 OK CLIMB LADDER when it's not present: "It's not here." 21 | 17 OK GET SHARK: "He doesn't seem to be too keen on that idea: He's eating me!" 22 | 18 OK CHOP TREE: "What's the point?" 23 | 19 OK TIE anything but rope: I can't tie a NOUN 24 | 20 OK TO anything but rail: I can't tie a rope to a NOUN 25 | 21 OK CLIMB anything but ladder and rope: I can't climb a NOUN 26 | 22 OK READ anything other than a book: I can't read a NOUN 27 | 23 OK OPEN anything but door or sarcophagus: I can't open a NOUN 28 | 24 OK DRINK anything but whisky (even water): I can't drink a NOUN 29 | 25 OK THROW anything but the axe: I can't throw a NOUN 30 | 26 OK CHOP anything but tree or thicket: I can't chop a NOUN 31 | 27 NO DIG anything but hole: I can't dig a NOUN 32 | 28 OK TIE ROPE if not carried: I don't have it. 33 | 29 OK GIVE COINS if not carried: I don't have it. 34 | 30 NO READ any book if not carried: I don't have it. 35 | 31 OK DRINK WHISKY if not carried: I don't have it. 36 | 32 OK THROW AXE if not carried: I don't have it. 37 | 33 OK LIGHT LAMP if not carried: I don't have it. 38 | 34 OK GET ROPE when it's tied: "It's tied to a rail!" 39 | 35 OK GET WATER when without the empty bottle: "I need a container." 40 | 36 OK TO anything when without rope: "I haven't got a rope." 41 | 37 OK AT anything when without axe: "I need an ax." 42 | 38 OK LIGHT anything without match: "First I need a match." 43 | 39 OK After failed LIGHT, another try: "Using a SPENT match?" 44 | 40 OK LIGHT anything other than lamp: "It won't burn." 45 | 41 OK DIG without spade: "I'll need a spade." 46 | 47 | Can't be done: 48 | Climbing rope carrying more than one item, fall and die 49 | If on bridge carrying more than one item, fall and die 50 | If carrying 4 or more objects, the ladder breaks 51 | 52 | -------------------------------------------------------------------------------- /games/nosferatu/nosferatu.map: -------------------------------------------------------------------------------- 1 | Nosferatu -- originally for VIC-20, now for "sac" 2 | ================================================= 3 | 4 | 13:On Bus 5 | \ 6 | ^GIVE COINS 7 | / 8 | 21:Dingy Hut 11:Bus Stop 9 | [spade] [(bus)] 10 | | | 11 | | | 12 | 20:Lawn 15:Shed 10:Graveyard 12:Witch's Cave 13 | | [bottle] [grave] /[witch->lamp] 14 | | | | \__GO GRAVE_/ 15 | | | | 16 | 29:Chasm---||---27:Thicket------22:W. Pond 19:On Bridge 16:E. Pond------14:Yard---||----8:Washroom--||--9:Mortuary 17 | [fountain] | | | | | 18 | | | | | | | 19 | | | | | | | 20 | 28:Ledge---||---26:By Thicket---23:Field--------18:Junction-----17:Swamp---||---33:Grove 7:Kitchen 21 | | |\ | 22 | | | \____________ | __CLIMB ROPE_ 23 | | | \ | / \ 24 | 25:Pit----------24:Forest GO HOLE 1:Coffin--------2:Rat-ridden----5:Balcony 6:Ledge 25 | / | | 26 | ____________/ | | 27 | / | | 28 | 30:Entrance-----31:Cavern---||--32:Chamber 3:Chamber-------4:Library 29 | [stalactite, [count, 30 | passage] statue] 31 | 32 | Other objects listed on paper map 33 | --------------------------------- 34 | 35 | Crucifix engraved: Blackbeard woz ere 36 | Ladder 37 | Axe 38 | Lamp 39 | Rope 40 | Coins 41 | Water of Life 42 | 43 | Other notes on paper map 44 | ------------------------ 45 | 46 | On Bridge: ">1 Object carried => fall" 47 | Between Swamp and Junction: "Some sort of Barrier" 48 | Forest: "needs ladder" (to climb out of pit?) 49 | By thicket: "JUMP" 50 | Field of Grass: "DIG HERE. GO HOL" 51 | Entrance: "SEMIDARK" 52 | Cavern: "NEED LAMP / OR BREAK NECK" 53 | Cavern: "Throw Axe. At Stalactite. It shatters, see passage" 54 | Balcony: "Tie Rope, to Balcony. Climb Rope" 55 | Washroom: "Locked doors" 56 | Cave: "GIVE WATER (IN BOTTLE) => GET LAMP" 57 | Bus stop: "WAIT: GIVE COINS" 58 | Chamber: "Count sleeps on altar" 59 | Chamber: "GO PASSAGE. SAY 'S$'" 60 | -------------------------------------------------------------------------------- /games/nosferatu/nosferatu.regression: -------------------------------------------------------------------------------- 1 | 19540 2 | 56 3 | 113 4 | 47 5 | 33 6 | 5 7 | 2 8 | 1 9 | 3 10 | 999 11 | 75 12 | 1 13 | 14 | 750 0 0 0 0 0 9900 0 15 | 1507 0 0 0 0 0 9900 0 16 | 1050 0 0 0 0 0 9750 0 17 | 1208 0 0 0 0 0 10650 0 18 | 100 29 20 0 0 0 8701 373 19 | 0 0 0 0 0 0 454 823 20 | 0 0 0 0 0 0 986 1050 21 | 1359 652 0 0 0 0 1200 0 22 | 100 644 309 0 0 0 8464 0 23 | 100 624 308 0 0 0 8614 0 24 | 100 1082 86 0 0 0 1413 0 25 | 1510 1082 0 0 0 0 1413 0 26 | 1961 352 0 0 0 0 1500 0 27 | 1961 60 0 0 0 0 1708 0 28 | 1950 0 0 0 0 0 1885 0 29 | 2112 341 68 124 60 340 9055 10950 30 | 0 160 0 0 0 0 7963 9600 31 | 2100 341 68 60 0 0 9014 12750 32 | 2100 346 68 0 0 0 2250 0 33 | 1511 162 0 0 0 0 2400 0 34 | 2261 162 140 0 0 0 8164 0 35 | 2261 144 221 0 0 0 2613 0 36 | 2261 144 120 0 0 0 8164 0 37 | 2413 203 302 300 320 0 10813 9600 38 | 2413 302 0 0 0 0 2700 0 39 | 2413 203 602 0 0 0 2850 0 40 | 2413 602 0 0 0 0 2700 0 41 | 163 322 300 0 0 0 8164 0 42 | 164 382 260 0 0 0 8164 0 43 | 3150 244 425 0 0 0 3088 3223 44 | 0 420 0 0 0 0 8014 0 45 | 165 422 280 0 0 0 8164 0 46 | 165 0 0 0 0 0 3300 0 47 | 2716 442 941 940 1000 0 8303 10950 48 | 0 440 480 0 0 0 10823 9600 49 | 2717 941 965 940 0 0 3655 0 50 | 3318 522 772 0 0 0 1500 0 51 | 3318 522 100 0 0 0 3808 0 52 | 3300 522 0 0 0 0 3900 0 53 | 100 108 1121 0 0 0 4078 4413 54 | 100 108 1126 0 0 0 4563 0 55 | 1359 683 680 700 0 0 10831 9600 56 | 1359 703 0 0 0 0 4800 0 57 | 169 702 620 0 0 0 8164 0 58 | 2270 565 0 0 0 0 3300 0 59 | 2270 624 500 560 0 0 8153 9600 60 | 2270 524 500 560 0 0 8153 9600 61 | 2270 0 0 0 0 0 4950 0 62 | 2250 0 0 0 0 0 5185 0 63 | 3450 544 580 0 0 0 8164 0 64 | 3450 584 540 0 0 0 8164 0 65 | 1517 283 942 280 1000 940 5322 11100 66 | 1517 942 0 0 0 0 5400 0 67 | 3617 941 940 1000 280 0 5305 10800 68 | 3771 546 0 0 0 0 1500 0 69 | 3771 40 0 0 0 0 5608 0 70 | 3750 0 0 0 0 0 5785 0 71 | 3913 541 48 602 40 540 9053 10950 72 | 0 600 620 0 0 0 10839 9600 73 | 163 622 440 0 0 0 8164 0 74 | 3923 541 48 1042 40 540 9053 10950 75 | 0 1040 1060 0 0 0 10839 9600 76 | 3900 541 48 40 540 0 9053 1990 77 | 3900 546 48 0 0 0 6150 0 78 | 174 1062 660 0 0 0 8164 0 79 | 4075 1082 0 20 0 0 1992 6512 80 | 4226 40 0 0 0 0 6654 9600 81 | 4377 0 0 0 0 0 6750 0 82 | 4378 104 0 0 0 0 6986 13247 83 | 4379 103 0 0 0 0 7200 0 84 | 4380 123 0 0 0 0 7350 0 85 | 4358 143 0 0 0 0 7500 0 86 | 4350 0 0 0 0 0 7735 0 87 | 4531 263 0 0 0 0 2052 15523 88 | 0 260 280 80 140 0 10858 11850 89 | 4531 283 0 0 0 0 4800 0 90 | 4531 0 0 0 0 0 1500 0 91 | 4500 0 0 0 0 0 15685 0 92 | 100 36 0 0 0 0 11550 0 93 | 100 39 80 0 0 0 11655 9000 94 | 2432 22 93 0 0 0 4800 0 95 | 2432 22 88 40 80 0 15953 8014 96 | 2432 22 0 0 0 0 16050 0 97 | 2400 0 0 0 0 0 16285 0 98 | 1533 42 40 60 0 0 16405 8014 99 | 1534 62 0 0 0 0 16500 0 100 | 4685 541 802 800 820 0 10873 0 101 | 0 840 860 0 0 0 10835 9600 102 | 4685 822 0 0 0 0 4800 0 103 | 4685 541 0 0 0 0 4950 0 104 | 4686 541 722 0 0 0 16650 0 105 | 4650 546 0 0 0 0 6150 0 106 | 4650 0 0 0 0 0 16885 0 107 | 185 822 600 0 0 0 8164 0 108 | 159 462 220 0 0 0 8164 0 109 | 187 1022 640 0 0 0 8164 0 110 | 4950 923 0 0 0 0 16950 0 111 | 4950 912 0 0 0 0 17100 0 112 | 4988 492 0 0 0 0 1500 0 113 | 4988 480 180 900 920 0 10872 5314 114 | 4950 900 920 0 0 0 10915 0 115 | 5139 1082 0 0 0 0 2035 12973 116 | 0 1080 0 0 0 0 17455 9600 117 | 5100 0 0 0 0 0 2035 17550 118 | 5250 0 0 0 0 0 17700 0 119 | 5400 0 0 0 0 0 17935 0 120 | 3150 0 0 0 0 0 3088 18000 121 | 3450 0 0 0 0 0 18150 0 122 | 1359 0 0 0 0 0 18300 0 123 | 1350 0 0 0 0 0 18450 0 124 | 5550 0 0 0 0 0 9600 0 125 | 5850 0 0 0 0 0 9450 0 126 | 6150 0 0 0 0 0 2074 18000 127 | 1540 582 0 0 0 0 18813 0 128 | 129 | "AUT" "ANY" 130 | "GO" "NOR" 131 | "*ENT" "SOU" 132 | "*WAL" "EAS" 133 | "*RUN" "WES" 134 | "INV" "UP" 135 | "*I" "DOW" 136 | "SCO" "INV" 137 | "SAV" "GAM" 138 | "DIG" "HOL" 139 | "TAK" "BLO" 140 | "*GET" "ROP" 141 | "*G" "RAI" 142 | "TIE" "DOO" 143 | "TO" "GRA" 144 | "CLI" "BUS" 145 | "OPE" "BOT" 146 | "*UNL" "WAT" 147 | "DRO" "COI" 148 | "*LEA" "PIT" 149 | "*D" "LAD" 150 | "WAI" "AXE" 151 | "GIV" "*AX" 152 | "JUM" "STA" 153 | "POU" "ENT" 154 | "THR" "COU" 155 | "AT" "COF" 156 | "KIL" "BOO" 157 | "TEL" "LIB" 158 | "REA" "ATL" 159 | "DRI" "MAG" 160 | "CHO" "WHI" 161 | "*CUT" "SAR" 162 | "LIG" "BOD" 163 | "SAY" "DUS" 164 | "HEL" "THI" 165 | "EXA" "TRE" 166 | "LOO" "TUN" 167 | "*L" "LAM" 168 | "QUI" "OVY" 169 | "*Q" "SHA" 170 | "SCR" "CRO" 171 | "" "KEY" 172 | "" "KIP" 173 | "" "MAL" 174 | "" "SPA" 175 | "" "STI" 176 | "" "MAT" 177 | 178 | 0 0 0 0 0 0 "" 179 | 0 0 0 0 0 0 "hidden treasury." 180 | 0 0 3 0 0 0 "tall, satin-lined wooden box." 181 | 8 4 6 2 0 0 "*I'm in an empty room." 182 | 3 0 5 0 0 0 "dark crypt." 183 | 6 0 0 4 0 0 "*I'm in the library." 184 | 0 5 0 3 0 0 "*I'm on a balcony overlooking a tall cliff." 185 | 0 0 0 0 0 0 "*I'm on a narrow ledge high up on a cliff." 186 | 9 3 0 0 0 0 "*I'm in the kitchen." 187 | 0 8 10 0 0 0 "*I'm in the washroom." 188 | 11 0 0 9 0 0 "*I'm in the mortuary." 189 | 12 10 0 0 0 0 "desolate windswept graveyard." 190 | 0 11 0 0 0 0 "*I'm by a bus-stop." 191 | 0 0 0 0 0 0 "dark gloomy cave." 192 | 0 12 0 0 0 0 "*I'm on a double-decker bus." 193 | 16 0 9 17 0 0 "rather dark yard." 194 | 0 15 0 0 0 0 "dark shed." 195 | 0 18 15 0 0 0 "*I'm by a fishpond ..." 196 | 17 0 0 19 0 0 "damp swamp." 197 | 20 0 18 24 0 0 "*I'm on a track. To my North is a bridge over a pond." 198 | 21 19 0 0 0 0 "*I'm on a very flimsy bridge..." 199 | 22 20 0 0 0 0 "*I'm on a lawn to the North of a pond." 200 | 0 21 0 0 0 0 "small hut." 201 | 0 24 0 28 0 0 "*I'm west of a pond." 202 | 23 25 19 27 0 0 "sunny field." 203 | 24 25 25 26 0 0 "*I'm in an oak-forest." 204 | 0 0 0 0 0 0 "*I'm at the bottom of a disused cesspit." 205 | 28 26 24 0 0 0 "*I'm north of a rather smelly hole." 206 | 0 27 23 0 0 0 "*I'm at the top of a cliff." 207 | 30 0 0 0 0 0 "*I'm on a narrow ledge, East of a chasm." 208 | 0 29 28 0 0 0 "*I'm at the edge of a deep chasm." 209 | 0 0 0 0 0 0 "*I'm at the bottom of a deep hole." 210 | 0 31 0 0 0 0 "subterranean cavern." 211 | 0 32 0 0 0 0 "cavern where the count sleeps." 212 | 213 | "" 214 | "Welcome to `NOSFERATU`, by Mike Taylor." 215 | " Original VIC-20 BASIC version, 1982" 216 | " Translation to Games::ScottAdams starting Sunday 25th November 2001" 217 | " Translation to ScottKit starting Saturday 14 October 2017" 218 | "This is a demo for the `ScottKit` adventure system --" 219 | "See https://github.com/MikeTaylor/scottkit/" 220 | "Your task: kill the evil count Nosferatu and return home with his bloodstone." 221 | "I'll need a spade." 222 | "Nosferatu rises from his altar, and bites my neck!" 223 | "I don't have it." 224 | "To what (eg. to key)" 225 | "I can't tie a" 226 | "OK." 227 | "I can't tie a rope to a" 228 | "I haven't got a rope." 229 | "It's tied to a rail!" 230 | "I'm too heavy: 231 | I fall!" 232 | "It's locked!" 233 | "My key won't fit!" 234 | "Time passes..." 235 | "A bus arrives!" 236 | "It's not here." 237 | "The witch drinks the water, rejuvenates, drops something, and disappears!" 238 | "It soaks away." 239 | "He takes them, the bus starts, and I'm home" 240 | "He doesn't want it." 241 | "with Nosferatu's Bloodstone." 242 | "* Congratulations *" 243 | "You win!" 244 | "without Nosferatu's Bloodstone." 245 | "I break through to an underground chamber!" 246 | "I've already done it!" 247 | "not now." 248 | "I can't climb a" 249 | "OK" 250 | "I need a container." 251 | "At what (eg. at bus)" 252 | "I can't throw a" 253 | "It shatters!" 254 | "It bounces off." 255 | "I need an ax." 256 | "I punch him and he crumbles to dust." 257 | "Huh! That was easier than I expected!" 258 | ">Fzing!<" 259 | "Which one?" 260 | "OK, but it'll take a while." 261 | "That was boring! It was in Transylvanian!" 262 | "The book says: 263 | 264 | Near the forest is a disused cess-pit." 265 | "The book says: 266 | 267 | Magic word is: 'OVYEZ'" 268 | "The book says: 269 | 270 | Bored with this game already, huh?" 271 | "I can't read a" 272 | "Burp! It's good!" 273 | "I feel stronger." 274 | "I can't drink a" 275 | "I feel weaker." 276 | "I find something!" 277 | "The lid's too heavy!" 278 | "I can't open a" 279 | "It turns to dust!" 280 | "It slips through my fingers" 281 | "What's the point?" 282 | "I can't chop a" 283 | "Using a SPENT match?" 284 | "First I need a match." 285 | "It won't burn." 286 | "Nosferatu vanishes in a cloud of smoke!" 287 | "Nothing happens" 288 | "You'll have to figure it out for yourself." 289 | "It looks like a pretty average" 290 | "Nothing happens." 291 | "Wheee!" 292 | "I find nothing." 293 | "I can only dig a hole" 294 | "`Yaaaagh!`" 295 | "He doesn't seem to be too keen on that idea: He's eating me!" 296 | 297 | "*treasure* (you shouldn't be able to see this)" 0 298 | "stone Sarcophagus" 4 299 | "decomposing Body" 0 300 | "pile of Dust" 0 301 | "wooden Cross/CRO/" 0 302 | "transylvanian Atlas/ATL/" 5 303 | "book of Magic/MAG/" 5 304 | "book of Games/GAM/" 5 305 | "rope tied to rail" 0 306 | "lit Lamp/LAM/" 0 307 | "brass Key/KEY/" 7 308 | "scarlet Kipper/KIP/" 7 309 | "hanging Rope" 7 310 | "bottle of Whisky/WHI/" 8 311 | "empty whisky Bottle/BOT/" 0 312 | "locked Door" 9 313 | "wide open Door" 0 314 | "long Rope/ROP/" 9 315 | "7-pound Mallet/MAL/" 10 316 | "newely dug open Grave" 11 317 | "tombstone engraved: BEWARE THE WITCH" 11 318 | "large red no. 29 Bus" 0 319 | "wrinkled old Witch" 13 320 | "Hole (above me)" 13 321 | "old Lamp/LAM/" 0 322 | "balcony Rail" 6 323 | "bus Conductor" 14 324 | "sharp Axe/AXE/" 15 325 | "tall Ladder/LAD/" 16 326 | "maneating Shark!/SHA/" 17 327 | "hut with locked Door" 21 328 | "hut with smashed Door" 0 329 | "garden Spade/SPA/" 22 330 | "sharp wooden Stick/STI/" 22 331 | "crusifix engraved on the ground" 24 332 | "Pit in the ground" 0 333 | "oak-Trees" 25 334 | "Sign says: 'TREES ARE RESERVED FOR COFFINS'" 25 335 | "golden Coins/COI/" 26 336 | "brick Wall" 27 337 | "inpenetrable Thicket" 28 338 | "mutilated thicket" 0 339 | "Sign here says: 'EXA NO FO TROHS'" 28 340 | "SHORT OF AN AXE' is written backwards on a Sign nearby'" 0 341 | "brick Wall" 29 342 | "safety Match/MAT/" 29 343 | "spent Match/MAT/" 0 344 | "Water of youth/WAT/" 30 345 | "Fountain of youth" 30 346 | "Hole in thicket" 30 347 | "whisky Bottle/BOT/" 0 348 | "secret Tunnel" 31 349 | "Stalactites hanging from the ceiling" 32 350 | "entrance to cave" 0 351 | "the count Nosferatu" 33 352 | "stone Altar" 33 353 | "giant *BLOODSTONE*/BLO/" 33 354 | 355 | "" 356 | "" 357 | "" 358 | "" 359 | "" 360 | "cont" 361 | "cont" 362 | "" 363 | "everywhere inside the cavern is dark" 364 | "everywhere outside the bottom of the pit is light" 365 | "" 366 | "" 367 | "" 368 | "" 369 | "" 370 | "" 371 | "" 372 | "" 373 | "" 374 | "" 375 | "" 376 | "We would rather this happen carrying more than one object, but this is near enough." 377 | "" 378 | "In the original, this created a new exit leading west, but we can't do that in the Scott Adams engine. Instead, the player must GO DOOR." 379 | "" 380 | "" 381 | "" 382 | "" 383 | "" 384 | "" 385 | "cont" 386 | "" 387 | "" 388 | "" 389 | "" 390 | "" 391 | "" 392 | "" 393 | "" 394 | "" 395 | "" 396 | "" 397 | "" 398 | "" 399 | "" 400 | "" 401 | "" 402 | "" 403 | "" 404 | "" 405 | "" 406 | "" 407 | "" 408 | "" 409 | "" 410 | "" 411 | "" 412 | "" 413 | "" 414 | "" 415 | "" 416 | "" 417 | "" 418 | "For some reason, the original uses 'ax' here rather then 'axe'." 419 | "" 420 | "" 421 | "" 422 | "" 423 | "" 424 | "" 425 | "" 426 | "" 427 | "" 428 | "" 429 | "cont" 430 | "" 431 | "" 432 | "" 433 | "" 434 | "" 435 | "" 436 | "" 437 | "" 438 | "" 439 | "" 440 | "" 441 | "" 442 | "" 443 | "" 444 | "" 445 | "" 446 | "" 447 | "" 448 | "" 449 | "" 450 | "" 451 | "" 452 | "" 453 | "" 454 | "We only really want to look if it was previously dark. Can do this with flags." 455 | "" 456 | "" 457 | "cont" 458 | "" 459 | "" 460 | "" 461 | "" 462 | "" 463 | "" 464 | "" 465 | "" 466 | "" 467 | "" 468 | "" 469 | 470 | 1 471 | 18401 472 | 0 473 | -------------------------------------------------------------------------------- /games/nosferatu/nosferatu.sol: -------------------------------------------------------------------------------- 1 | e 2 | s 3 | e 4 | get magic 5 | read magic Magic word is: 'OVYEZ' 6 | drop magic 7 | n 8 | w 9 | n 10 | n 11 | get rope 12 | s 13 | s 14 | e 15 | tie rope 16 | to rail 17 | climb rope 18 | get key (The scarlet kipper is a red herring) 19 | climb rope 20 | w 21 | n 22 | get whisky 23 | s 24 | s 25 | drink whisky (Otherwise the lid is too heavy to move) 26 | open sarcophagus 27 | get cross (Carrying this stops the Count killing me) 28 | n 29 | n 30 | n 31 | open door 32 | drop key 33 | go door (Just "w" in the original, where a new exit opens) 34 | get axe 35 | n 36 | get ladder 37 | s 38 | w 39 | s 40 | w 41 | drop bottle 42 | drop ladder 43 | drop cross 44 | n 45 | n 46 | throw axe 47 | at door 48 | go door (Just "n" in the original, where a new exit opens) 49 | get spade 50 | s 51 | s 52 | s 53 | drop spade 54 | n 55 | n 56 | get axe 57 | s 58 | s 59 | get bottle 60 | w 61 | n 62 | w 63 | chop thicket 64 | go thicket (Just "w" in the original, where a new exit opens) 65 | get water 66 | s 67 | get match 68 | n 69 | e 70 | s 71 | e 72 | e 73 | e 74 | n 75 | e 76 | e 77 | e 78 | n 79 | go grave 80 | drop bottle 81 | get lamp 82 | go hole 83 | s 84 | w 85 | go door (Just "w" in the original, where a new exit opens) 86 | w 87 | s 88 | w 89 | get spade 90 | get ladder 91 | w 92 | dig hole 93 | drop spade 94 | e 95 | get cross 96 | w 97 | go pit 98 | drop ladder 99 | go tunnel 100 | light lamp 101 | drop match 102 | throw axe 103 | at stalactite 104 | go entrance (Just "n" in the original, where a new exit opens) 105 | say ovyez 106 | get bloodstone 107 | s 108 | s 109 | climb ladder 110 | get ladder 111 | w 112 | drop ladder 113 | drop lamp 114 | get coins 115 | climb ladder 116 | n 117 | e 118 | e 119 | n 120 | e 121 | e 122 | e 123 | n 124 | n 125 | wait 126 | go bus 127 | give coins 128 | -------------------------------------------------------------------------------- /games/test/Makefile: -------------------------------------------------------------------------------- 1 | # This rebuilds the files used for regression testing 2 | # Do this ONLY WHEN SURE that the software is correct 3 | 4 | RUN = ruby -I ../../lib ../../bin/scottkit 5 | 6 | **default**: 7 | @echo "Use 'make rebuild' if you are SURE that the software is correct" 8 | 9 | rebuild: 10 | $(RUN) -e -s 12368 -W -f crystal.solution crystal.sao > crystal.transcript 11 | $(RUN) -e -s 12368 -W -f t7.solution t7.sao > t7.transcript 12 | 13 | .PHONY: rebuild 14 | -------------------------------------------------------------------------------- /games/test/adams/Makefile: -------------------------------------------------------------------------------- 1 | # This rebuilds the files used for regression testing 2 | # Do this ONLY WHEN SURE that the software is correct 3 | 4 | RUN = ruby -I ../../../lib ../../../bin/scottkit 5 | 6 | **default**: 7 | @echo "Use 'make rebuild' if you are SURE that the software is correct" 8 | 9 | rebuild: 10 | for i in 01 02 04; do \ 11 | $(RUN) -e -s 12368 -W ../../adams/adv$$i.dat < adv$$i.solution > adv$$i.transcript; \ 12 | ruby ../../../bin/md5ruby adv$$i.transcript > adv$$i.transcript.md5; \ 13 | done 14 | -------------------------------------------------------------------------------- /games/test/adams/adv01.solution: -------------------------------------------------------------------------------- 1 | xyz 2 | jump 3 | help 4 | climb tree 5 | climb tree 6 | down 7 | go 8 | get 9 | drop 10 | get xyz 11 | get dragon 12 | e 13 | get dragon 14 | east 15 | get axe 16 | go south 17 | go hole 18 | get flint 19 | up 20 | w 21 | climb tree 22 | read web 23 | get key 24 | d 25 | chop tree 26 | go stump 27 | score 28 | Tell me what to do ? 29 | rub lamp 30 | rub lamp 31 | score 32 | get bottle 33 | u 34 | get mud 35 | go stump 36 | drop axe 37 | d 38 | go hole 39 | open door 40 | go hall 41 | up 42 | up 43 | get rubies 44 | up 45 | drop rubies 46 | score 47 | get lamp 48 | down 49 | go hole 50 | go hall 51 | light lamp 52 | down 53 | west 54 | east 55 | n 56 | n 57 | get honey 58 | drink water 59 | get bees 60 | make hole 61 | s 62 | s 63 | u 64 | u 65 | unlight lamp 66 | u 67 | u 68 | drop honey 69 | drop key 70 | u 71 | drop mud 72 | n 73 | drop bees 74 | drop bees 75 | get eggs 76 | e 77 | get water 78 | s 79 | w 80 | w 81 | get fruit 82 | e 83 | go stump 84 | drop eggs 85 | drop fruit 86 | score 87 | d 88 | go hall 89 | light lamp 90 | go hole 91 | d 92 | go hall 93 | d 94 | s 95 | get bladder 96 | n 97 | u 98 | u 99 | unlight lamp 100 | u 101 | u 102 | u 103 | get gas 104 | go stump 105 | d 106 | go hole 107 | light lamp 108 | go hall 109 | d 110 | s 111 | u 112 | drop bladder 113 | light gas 114 | go hole 115 | jump 116 | scream 117 | go throne 118 | get crown 119 | w 120 | get mirror 121 | jump 122 | w 123 | get bricks 124 | d 125 | n 126 | u 127 | u 128 | unlight lamp 129 | u 130 | u 131 | drop crown 132 | score 133 | down 134 | go hol 135 | light lamp 136 | drop flint 137 | go hal 138 | d 139 | d 140 | d 141 | w 142 | d 143 | get rug 144 | d 145 | get net 146 | build dam 147 | drop bricks 148 | pour water 149 | get firestone 150 | say away 151 | say away 152 | unlight lamp 153 | s 154 | go stump 155 | drop rug 156 | drop mirror 157 | drop firestone 158 | u 159 | e 160 | n 161 | get water 162 | catch fish 163 | s 164 | w 165 | take mud 166 | drop mud 167 | go stump 168 | drop fish 169 | drop net 170 | get axe 171 | drop bottle 172 | drop lamp 173 | u 174 | n 175 | e 176 | n 177 | say bunyon 178 | swim 179 | s 180 | w 181 | w 182 | get ox 183 | e 184 | go stump 185 | drop ox 186 | score 187 | -------------------------------------------------------------------------------- /games/test/adams/adv01.transcript.md5: -------------------------------------------------------------------------------- 1 | fe30e5d53d2afa5c6923dacc79bbee52 2 | -------------------------------------------------------------------------------- /games/test/adams/adv02.solution: -------------------------------------------------------------------------------- 1 | get bottle 2 | get sneakers 3 | get crackers 4 | climb stairs 5 | get book 6 | examine book 7 | open book 8 | look 9 | examine flyer 10 | read flyer 11 | read book 12 | go passage 13 | east 14 | get torch 15 | examine bag 16 | open bag 17 | look 18 | get matches 19 | say yoho 20 | say yoho 21 | drop book 22 | drop crackers 23 | east 24 | go shack 25 | give rum 26 | west 27 | east 28 | follow path 29 | go crack 30 | go shed 31 | get hammer 32 | get wings 33 | north 34 | get sails 35 | go crack 36 | unlight torch 37 | down 38 | west 39 | west 40 | drop sails 41 | drop wings 42 | drop torch 43 | drop matches 44 | get book 45 | say yoho 46 | go window 47 | down 48 | get rug 49 | get nails 50 | get rug 51 | drop rug 52 | get keys 53 | climb stairs 54 | go passage 55 | east 56 | get bottle 57 | say yoho 58 | say yoho 59 | drop book 60 | drop sneakers 61 | drop hammer 62 | drop nails 63 | open book 64 | read note 65 | east 66 | go shack 67 | unlock chest 68 | examine chest 69 | get plans 70 | read plans 71 | get chest 72 | west 73 | west 74 | drop chest 75 | drop plans 76 | get wings 77 | go lagoon 78 | north 79 | get water 80 | get fish 81 | south 82 | south 83 | drop wings 84 | get torch 85 | get matches 86 | east 87 | east 88 | go cave 89 | light torch 90 | down 91 | drop fish 92 | unlock door 93 | go hall 94 | east 95 | go shed 96 | get shovel 97 | north 98 | get lumber 99 | west 100 | go pit 101 | up 102 | west 103 | unlight torch 104 | west 105 | west 106 | drop lumber 107 | drop bottle 108 | drop keys 109 | get wings 110 | go lagoon 111 | look 112 | dig 113 | get anchor 114 | south 115 | drop anchor 116 | build ship 117 | get book 118 | get keys 119 | go ship 120 | drop book 121 | drop torch 122 | drop matches 123 | drop keys 124 | drop shovel 125 | drop wings 126 | go shore 127 | east 128 | get mongoose 129 | west 130 | get chest 131 | get plans 132 | get hammer 133 | get bottle 134 | get sneakers 135 | go ship 136 | drop mongoose 137 | drop chest 138 | drop plans 139 | drop hammer 140 | drop bottle 141 | drop sneakers 142 | go shore 143 | get sack 144 | get parrot 145 | get sand 146 | get note 147 | go ship 148 | sail ship 149 | weight anchor 150 | set sail 151 | get book 152 | get sneakers 153 | say yoho 154 | go window 155 | go passage 156 | east 157 | wake pirate 158 | say yoho 159 | say yoho 160 | go ship 161 | examine chest 162 | examine map 163 | read map 164 | set sail 165 | go shore 166 | drop book 167 | go ship 168 | set sail 169 | wait 170 | set sail 171 | get shovel 172 | get map 173 | drop note 174 | drop sneakers 175 | get mongoose 176 | go shore 177 | south 178 | east 179 | pace 30 180 | dig 181 | examine box 182 | open box 183 | go monastery 184 | drop mongoose 185 | wait 186 | drop parrot 187 | get dubloons 188 | get parrot 189 | west 190 | west 191 | north 192 | go ship 193 | drop dubloons 194 | get hammer 195 | go shore 196 | south 197 | east 198 | open box 199 | look 200 | get stamps 201 | west 202 | north 203 | drop hammer 204 | dig 205 | get rum 206 | give rum 207 | dig 208 | south 209 | wake pirate 210 | north 211 | go ship 212 | set sail 213 | get dubloons 214 | drop sand 215 | get sneakers 216 | go shore 217 | drop shovel 218 | get book 219 | say yoho 220 | go window 221 | down 222 | drop stamps 223 | score 224 | drop dubloons 225 | score 226 | -------------------------------------------------------------------------------- /games/test/adams/adv02.transcript.md5: -------------------------------------------------------------------------------- 1 | df94ca5b8132fbef602e40fe2779f9bb 2 | -------------------------------------------------------------------------------- /games/test/adams/adv04.solution: -------------------------------------------------------------------------------- 1 | open coffin 2 | examine coffin 3 | get ring 4 | north 5 | south 6 | west 7 | west 8 | go fireplace 9 | listen 10 | get idol 11 | examine idol 12 | open flue 13 | listen 14 | go chimney 15 | rub idol 16 | clean idol 17 | listen 18 | down 19 | south 20 | east 21 | east 22 | get knife 23 | wave ring 24 | look 25 | drop ring 26 | west 27 | south 28 | get glass 29 | south 30 | north 31 | west 32 | get shovel 33 | south 34 | go door 35 | east 36 | get shield 37 | get sword 38 | get armor 39 | west 40 | north 41 | east 42 | east 43 | examine kettle 44 | get soup 45 | move kettle 46 | go hole 47 | get foot 48 | up 49 | north 50 | get heads 51 | drop heads 52 | drop sword 53 | look 54 | open safe 55 | east 56 | east 57 | get bag 58 | examine chemicals 59 | mix chemicals 60 | examine chemicals 61 | drink chemicals 62 | west 63 | west 64 | south 65 | west 66 | climb stairs 67 | examine statue 68 | down 69 | west 70 | south 71 | go door 72 | examine grave 73 | get clover 74 | dig grave 75 | drop shovel 76 | get saw 77 | east 78 | north 79 | go cell 80 | examine leaflet 81 | read leaflet 82 | summon medium 83 | open door 84 | saw 85 | east 86 | north 87 | drop foot 88 | on man 89 | north 90 | go window 91 | examine doll 92 | get pins 93 | get doll 94 | south 95 | south 96 | drop doll 97 | drop clover 98 | drop idol 99 | east 100 | go chute 101 | go crack 102 | examine plaque 103 | read plaque 104 | get plaque 105 | go chute 106 | go hole 107 | get ball 108 | summon medium 109 | examine ball 110 | west 111 | west 112 | go fireplace 113 | go chimney 114 | read plaque 115 | drop glass 116 | down 117 | south 118 | east 119 | south 120 | east 121 | north 122 | dial 38 123 | dial 33 124 | look 125 | examine safe 126 | get hammer 127 | south 128 | west 129 | north 130 | get idol 131 | west 132 | go fireplace 133 | go chimney 134 | get boards 135 | get nails 136 | get boards 137 | drop nails 138 | drop boards 139 | drop hammer 140 | look 141 | get gratin 142 | saw grating 143 | drop saw 144 | drop grating 145 | push button 146 | listen 147 | help sweep 148 | pull sweep 149 | push sweep 150 | read paper 151 | drop paper 152 | down 153 | down 154 | south 155 | east 156 | south 157 | climb stairs 158 | say zap 159 | listen 160 | down 161 | east 162 | north 163 | east 164 | east 165 | get bag 166 | west 167 | west 168 | south 169 | west 170 | north 171 | east 172 | go chute 173 | wave bag 174 | look 175 | go crack 176 | examine bag 177 | get book 178 | read book 179 | read page 180 | south 181 | go hol 182 | look ball 183 | west 184 | get stick 185 | circle coffin 186 | wave stick 187 | yell chant 188 | -------------------------------------------------------------------------------- /games/test/adams/adv04.transcript.md5: -------------------------------------------------------------------------------- 1 | 9f95d85f7f784c11edff92d3dbf5de0e 2 | -------------------------------------------------------------------------------- /games/test/crystal.decompile: -------------------------------------------------------------------------------- 1 | # 28 rooms, 45 items, 88 actions 2 | # 54 messages, 6 treasures, 43 verbs/nouns 3 | ident 18400 4 | version 1 5 | wordlen 3 6 | maxload 5 7 | lighttime 100 8 | unknown1 0 9 | unknown2 0 10 | start hut 11 | treasury hut 12 | 13 | verbgroup GO ENT FOL RUN WAL 14 | verbgroup TAK GET 15 | verbgroup BAT RAM 16 | verbgroup LEA DRO 17 | verbgroup KIC SMA BRE 18 | 19 | noungroup AXE AX 20 | 21 | room hut "small wooden hut." 22 | exit east "west" 23 | 24 | room "west" "clearing. There's a small hut to the west." 25 | exit north swamp 26 | exit south forest 27 | exit east glade 28 | exit west hut 29 | 30 | room glade "glade" 31 | exit north outcrop 32 | exit south forest1 33 | exit west "west" 34 | 35 | room tree "the top of a beech tree" 36 | exit down glade 37 | 38 | room swamp "dismal swamp" 39 | exit south "west" 40 | exit east outcrop 41 | 42 | room outcrop "rocky area by an outcrop" 43 | exit south glade 44 | exit west swamp 45 | 46 | room tunnel "dingy north-south tunnel" 47 | exit south outcrop 48 | 49 | room passage "gloomy north-south passage" 50 | exit south tunnel 51 | 52 | room "room" "empty room" 53 | exit south passage 54 | 55 | room forest "forest" 56 | exit north "west" 57 | exit east forest1 58 | 59 | room forest2 "overgrown path in a dark forest" 60 | exit north forest 61 | 62 | room vase "*I'm INSIDE a huge vase!" 63 | 64 | room forest1 "forest" 65 | exit north glade 66 | exit west forest 67 | 68 | room level "bubbling pool, just below the water level" 69 | exit up forest1 70 | 71 | room "north" "*I'm swimming in an underground river. 72 | Light pours from the north." 73 | exit north level 74 | exit south north1 75 | 76 | room north1 "*I'm swimming in an underground river. 77 | There's a faint glimmer of light to the north." 78 | exit north "north" 79 | exit south "south" 80 | 81 | room "south" "*I'm swimming in an underground river. 82 | There's a faint glimmer of light to the south." 83 | exit north north1 84 | exit south south1 85 | 86 | room south1 "*I'm swimming in an underground river. 87 | Light pours from the south." 88 | exit north "south" 89 | exit south wall 90 | 91 | room wall "brightly lit underground chamber. 92 | An underground river disappears into the north wall." 93 | exit north south1 94 | 95 | room directions "central underground chamber. Passages leave in all directions." 96 | exit north wall 97 | exit east south2 98 | exit west cells 99 | 100 | room cells "prison in an undergound complex. Doors lead to prison cells" 101 | exit east directions 102 | 103 | room ground "dirty prison cell with muddy straw on the ground" 104 | exit north hut 105 | exit east cells 106 | 107 | room south2 "junction between an east-west passage and one that leads south" 108 | exit south floor 109 | exit east machinery 110 | exit west directions 111 | 112 | room machinery "control room filled with humming, crackling machinery" 113 | exit west south2 114 | 115 | room floor "square room with a steel floor" 116 | exit north south2 117 | exit south west1 118 | 119 | room west1 "vast hall which is split by a deep chasm running from east to west" 120 | exit north floor 121 | 122 | room again "*I'm dead. Great. Try again." 123 | exit east hut 124 | 125 | item Sign "Sign" 126 | at hut 127 | 128 | item Axe "Axe" 129 | called AXE 130 | at hut 131 | 132 | item match "Single match" 133 | called MAT 134 | at hut 135 | 136 | item chain "*Platinum chain*" 137 | called CHA 138 | at "west" 139 | 140 | item crown "*Gold crown*" 141 | called CRO 142 | at "west" 143 | 144 | item medallion "*Silver medallion*" 145 | called MED 146 | at "west" 147 | 148 | item sceptre "*Bronze sceptre*" 149 | called SCE 150 | at "west" 151 | 152 | item goblet "*Zinc goblet*" 153 | called GOB 154 | at "west" 155 | 156 | item tree "Beech tree" 157 | at glade 158 | 159 | item lamp "Old-fashioned brass lamp" 160 | called LAM 161 | at outcrop 162 | 163 | item honey "Wild honey" 164 | called HON 165 | at tree 166 | 167 | item bees "Killer bees" 168 | at tree 169 | 170 | item bees1 "Drowsy bees" 171 | nowhere 172 | 173 | item tree1 "Cypress tree" 174 | at swamp 175 | 176 | item stump "-SOLID- stump" 177 | nowhere 178 | 179 | item tree2 "Trunk of cypress tree" 180 | called TRU 181 | nowhere 182 | 183 | item mud "Evil smelling mud" 184 | called MUD 185 | at swamp 186 | 187 | item gas "Swamp gas" 188 | at swamp 189 | 190 | item slime "Patches of `OILY` slime" 191 | called OIL 192 | at swamp 193 | 194 | item Chiggers "Chiggers" 195 | called CHI 196 | at swamp 197 | 198 | item rock "Balsa-wood door set into the rock" 199 | at outcrop 200 | 201 | item nest "Bees' nest" 202 | at tree 203 | 204 | item wood "Balsa wood" 205 | called BAL 206 | nowhere 207 | 208 | item rock1 "Tunnel disappears into the rock" 209 | nowhere 210 | 211 | item "north" "Plywood door blocks the way north" 212 | at tunnel 213 | 214 | item Plywood "Plywood" 215 | called PLY 216 | nowhere 217 | 218 | item rock2 "Passage disappears into the rock" 219 | nowhere 220 | 221 | item north1 "Oak door blocks the way north" 222 | at passage 223 | 224 | item Oak "Oak" 225 | called OAK 226 | nowhere 227 | 228 | item north2 "Entrance to the north" 229 | nowhere 230 | 231 | item fire "Blazing hot fire" 232 | nowhere 233 | 234 | item forest "Path leads south into the forest" 235 | at forest 236 | 237 | item bear "Very thin black bear" 238 | at forest 239 | 240 | item bear1 "Sleeping bear" 241 | nowhere 242 | 243 | item vase "Huge vase" 244 | called VAS 245 | at forest2 246 | 247 | item key "Iron key" 248 | called KEY 249 | at vase 250 | 251 | item pool "Bubbling pool" 252 | at forest1 253 | 254 | item "south" "inflow from the south" 255 | at level 256 | 257 | item stoat "*Tin stoat*" 258 | called STO 259 | at wall 260 | 261 | item south1 "Iron door leads south" 262 | at cells 263 | 264 | item "west" "Bronze door leads west" 265 | at cells 266 | 267 | item goblin "small goblin" 268 | at ground 269 | 270 | item button "Red button" 271 | at machinery 272 | 273 | item button1 "Blue button" 274 | at machinery 275 | 276 | item Lever "Lever" 277 | at machinery 278 | 279 | action INV: 280 | inventory 281 | 282 | action TAK INV 283 | inventory 284 | 285 | action SCO: 286 | score 287 | 288 | action SAV GAM 289 | save_game 290 | 291 | action LOO: 292 | look 293 | 294 | occur when at forest2 295 | set_dark 296 | 297 | occur when !at forest2 298 | clear_dark 299 | 300 | occur when !flag 1 301 | set_flag 1 302 | print "Welcome to `CRYSTAL OF CHAOS`" 303 | print "Written by Mike Taylor, starting Monday 10th April 2001" 304 | continue 305 | 306 | occur 0% 307 | print "This is a demo for the `ScottKit` adventure system" 308 | print "" 309 | print "Your task is to find the six crown jewels of the" 310 | continue 311 | comment "cont" 312 | 313 | occur 0% 314 | print "kingdom and store them in this hut. They are:" 315 | print "a platinum chain, a gold crown, a silver medallion" 316 | print "a bronze sceptre, a zinc goblet and a tin stoat." 317 | comment "cont" 318 | 319 | occur when at "west" and !flag 6 320 | set_flag 6 321 | print "Oh, there they are. That wasn't as hard as I expected." 322 | 323 | occur when at hut 324 | set_flag 7 325 | 326 | occur when !here chain 327 | clear_flag 7 328 | 329 | occur when !here crown 330 | clear_flag 7 331 | 332 | occur when !here medallion 333 | clear_flag 7 334 | 335 | occur when !here sceptre 336 | clear_flag 7 337 | 338 | occur when !here goblet 339 | clear_flag 7 340 | 341 | occur when flag 7 and !flag 8 342 | set_flag 8 343 | print "Ah, looks like I'm still missing the stoat." 344 | 345 | occur when at level 346 | set_flag 5 347 | 348 | occur when at "north" 349 | set_flag 5 350 | 351 | occur when at north1 352 | set_flag 5 353 | 354 | occur when at "south" 355 | set_flag 5 356 | 357 | occur when at south1 358 | set_flag 5 359 | 360 | occur when at forest1 361 | clear_flag 5 362 | 363 | occur when at wall 364 | clear_flag 5 365 | 366 | occur when at vase 367 | clear_flag 5 368 | 369 | occur when at again 370 | clear_flag 5 371 | 372 | occur when counter_eq 1 373 | print "I have to breathe NOW!" 374 | 375 | occur when counter_gt 0 376 | dec_counter 377 | 378 | occur when counter_gt 0 379 | print "I can only hold my breath for" 380 | print_counter 381 | print "more turns." 382 | 383 | occur when counter_eq 0 and flag 5 384 | print "I can't breathe ..." 385 | pause 386 | clear_flag 5 387 | die 388 | comment "Death due to lack of breath" 389 | 390 | occur when flag 2 and here Plywood 391 | print "The plywood also catches fire and burns quickly." 392 | destroy Plywood 393 | set_flag 3 394 | 395 | occur when flag 3 and here Oak 396 | print "The oak catches, and becomes a roaring fire." 397 | print "Smoke pours upwards." 398 | destroy Oak 399 | continue 400 | 401 | occur 0% 402 | drop fire 403 | set_flag 4 404 | comment "cont" 405 | 406 | occur when flag 4 and at glade 407 | destroy bees 408 | put bees1 tree 409 | 410 | occur 411 | clear_flag 2 412 | clear_flag 3 413 | clear_flag 4 414 | comment "Fire-building must happen all in one go" 415 | 416 | action CHO when !present Axe 417 | print "I can't chop anything without an axe." 418 | 419 | action BAT when !present tree2 420 | print "I don't have a battering ram." 421 | 422 | action LIG when !present match 423 | print "I don't have anything to light it with." 424 | 425 | action REA SIG when present Sign 426 | print "It says - `Leave *TREASURES* here, then say: SCORE`" 427 | 428 | action CLI TRE when here tree 429 | goto tree 430 | look2 431 | 432 | action TAK HON when here bees 433 | print "No! Bees would sting me!" 434 | 435 | action HEL when here bees 436 | print "Smoke 'em out!" 437 | 438 | action CHO TRE when here tree1 439 | print TIMBER! 440 | swap tree1 tree2 441 | drop stump 442 | look2 443 | 444 | action EXA STU when here stump 445 | print "There's nothing there all right! Maybe I should forget it?" 446 | 447 | action OPE DOO when here rock 448 | print "It's locked." 449 | 450 | action KIC DOO when here rock 451 | swap rock rock1 452 | drop wood 453 | print "It splinters easily." 454 | continue 455 | 456 | occur 0% 457 | print "There's a tunnel beyond." 458 | look2 459 | comment "cont" 460 | 461 | action CHO DOO when here rock 462 | swap rock rock1 463 | print "CRUNCH! It's smashed to smithereens!" 464 | print "There's a tunnel beyond." 465 | look2 466 | comment "no balsa wood" 467 | 468 | action BAT DOO when here rock 469 | destroy rock 470 | drop rock1 471 | print "DOOSH! It's absolutely annihilated!" 472 | continue 473 | comment "no balsa wood" 474 | 475 | occur 0% 476 | print "There's a tunnel beyond." 477 | look2 478 | comment "cont" 479 | 480 | action GO TUN when here rock1 481 | goto tunnel 482 | look2 483 | 484 | action OPE DOO when here "north" 485 | print "It's also locked." 486 | 487 | action KIC DOO when here "north" 488 | print Ouch! 489 | 490 | action CHO DOO when here "north" 491 | swap "north" rock2 492 | drop Plywood 493 | print CRUNCH! 494 | continue 495 | 496 | occur 0% 497 | print "There's a passage beyond." 498 | look2 499 | comment "cont" 500 | 501 | action BAT DOO when here "north" 502 | swap "north" rock2 503 | print "DOOSH! It's absolutely annihilated!" 504 | print "There's a passage beyond." 505 | look2 506 | comment "no plywood" 507 | 508 | action GO PAS when here rock2 509 | goto passage 510 | look2 511 | 512 | action OPE DOO when here north1 513 | print "OF COURSE it's locked!" 514 | 515 | action KIC DOO when here north1 516 | print Ouch! 517 | 518 | action CHO DOO when here north1 519 | print "It's too solid for the axe to make much impression." 520 | 521 | action BAT DOO when here north1 522 | swap north1 north2 523 | drop Oak 524 | print DOOSH! 525 | continue 526 | 527 | occur 0% 528 | print "There's an entrance beyond." 529 | look2 530 | comment "cont" 531 | 532 | action GO ENT when here north2 533 | goto "room" 534 | look2 535 | 536 | action LIG PLY when carried Plywood 537 | print "Not while I'm carrying it!" 538 | 539 | action LIG PLY when here Plywood 540 | print "I can't get it to catch fire." 541 | print "My match goes out." 542 | destroy match 543 | 544 | action LIG OAK when here Oak 545 | print "There's no way it will catch fire." 546 | print "My match goes out." 547 | destroy match 548 | 549 | action LIG OAK when carried Oak 550 | print "Not while I'm carrying it!" 551 | 552 | action LIG BAL when carried wood 553 | print "Not while I'm carrying it!" 554 | 555 | action LIG BAL when here wood 556 | print "OK. It burns up very quickly." 557 | print "My match goes out." 558 | destroy match 559 | continue 560 | 561 | occur 0% 562 | destroy wood 563 | set_flag 2 564 | comment "cont" 565 | 566 | action GO PAT when here bear 567 | print "Bear won't let me" 568 | 569 | action GO PAT when at forest 570 | goto forest2 571 | look2 572 | 573 | action GIV HON when here bear and present honey 574 | destroy bear 575 | destroy honey 576 | drop bear1 577 | print "Bear eats the honey and falls asleep." 578 | 579 | action EXA VAS when present vase 580 | print "It's bigger than I am." 581 | 582 | action GO VAS when here vase 583 | swap_specific_room 1 584 | goto vase 585 | look2 586 | 587 | action LEA VAS when at vase 588 | swap_specific_room 1 589 | look2 590 | 591 | action TAK OUT when at vase 592 | swap_specific_room 1 593 | look2 594 | 595 | action GO POO when here pool 596 | goto level 597 | look2 598 | 599 | action HOL BRE when counter_gt 0 600 | print "I'm already holding my breath!" 601 | 602 | action HOL BRE 603 | set_counter 6 604 | print OK 605 | 606 | action GO INF when here "south" 607 | goto "north" 608 | look2 609 | 610 | action KNO DOO when at cells 611 | print "Which door? Use `knock iron` or `knock bronze`." 612 | 613 | action KNO IRO when here south1 614 | print "Nothing happens." 615 | 616 | action KNO BRO when here "west" 617 | print "Nothing seems to happen." 618 | 619 | action HEL: 620 | print "You'll have to figure it out for yourself." 621 | 622 | action EXA: 623 | print "It looks like a pretty average" 624 | println_noun 625 | 626 | action WAI: 627 | print OK 628 | 629 | -------------------------------------------------------------------------------- /games/test/crystal.sao: -------------------------------------------------------------------------------- 1 | 0 2 | 44 3 | 87 4 | 42 5 | 27 6 | 5 7 | 1 8 | 6 9 | 3 10 | 100 11 | 53 12 | 1 13 | 14 | 900 0 0 0 0 0 9900 0 15 | 1507 0 0 0 0 0 9900 0 16 | 1050 0 0 0 0 0 9750 0 17 | 1208 0 0 0 0 0 10650 0 18 | 1350 0 0 0 0 0 9600 0 19 | 100 224 0 0 0 0 8400 0 20 | 100 227 0 0 0 0 8550 0 21 | 100 29 20 0 0 0 8701 373 22 | 0 0 0 0 0 0 454 823 23 | 0 0 0 0 0 0 907 1200 24 | 100 44 129 120 0 0 8709 0 25 | 100 24 140 0 0 0 8700 0 26 | 100 65 140 0 0 0 9000 0 27 | 100 85 140 0 0 0 9000 0 28 | 100 105 140 0 0 0 9000 0 29 | 100 125 140 0 0 0 9000 0 30 | 100 145 140 0 0 0 9000 0 31 | 100 148 169 160 0 0 8710 0 32 | 100 284 100 0 0 0 8700 0 33 | 100 304 100 0 0 0 8700 0 34 | 100 324 100 0 0 0 8700 0 35 | 100 344 100 0 0 0 8700 0 36 | 100 364 100 0 0 0 8700 0 37 | 100 264 100 0 0 0 9000 0 38 | 100 384 100 0 0 0 9000 0 39 | 100 244 100 0 0 0 9000 0 40 | 100 544 100 0 0 0 9000 0 41 | 100 39 0 0 0 0 1650 0 42 | 100 16 0 0 0 0 11550 0 43 | 100 16 0 0 0 0 1878 1950 44 | 100 19 108 100 0 0 2188 9061 45 | 100 48 502 500 60 0 2305 8700 46 | 100 68 562 560 0 0 2417 8323 47 | 0 600 80 0 0 0 8008 0 48 | 100 88 64 220 240 80 8312 0 49 | 100 40 60 80 0 0 9060 9000 50 | 1800 32 0 0 0 0 2700 0 51 | 1950 312 0 0 0 0 2850 0 52 | 2250 52 0 0 0 0 3000 0 53 | 2409 3 0 0 0 0 3150 0 54 | 2560 162 80 0 0 0 8176 0 55 | 1511 222 0 0 0 0 3300 0 56 | 3000 222 0 0 0 0 3450 0 57 | 1810 262 260 300 280 0 3672 8026 58 | 3162 282 0 0 0 0 3750 0 59 | 3313 402 0 0 0 0 3900 0 60 | 3463 402 400 460 440 0 10853 4123 61 | 0 0 0 0 0 0 4276 0 62 | 1813 402 400 460 0 0 10829 4276 63 | 1963 402 400 460 0 0 8303 4573 64 | 0 0 0 0 0 0 4276 0 65 | 164 462 140 0 0 0 8176 0 66 | 3313 482 0 0 0 0 4650 0 67 | 3463 482 0 0 0 0 4800 0 68 | 1813 482 480 520 500 0 10853 5023 69 | 0 0 0 0 0 0 5176 0 70 | 1963 482 480 520 0 0 10830 5176 71 | 165 522 160 0 0 0 8176 0 72 | 3313 542 0 0 0 0 5250 0 73 | 3463 542 0 0 0 0 4800 0 74 | 1813 542 0 0 0 0 5400 0 75 | 1963 542 540 580 560 0 10853 5623 76 | 0 0 0 0 0 0 5776 0 77 | 166 582 180 0 0 0 8176 0 78 | 2267 501 0 0 0 0 5850 0 79 | 2267 502 40 0 0 0 6041 8250 80 | 2268 562 40 0 0 0 6341 8250 81 | 2268 561 0 0 0 0 5850 0 82 | 2269 441 0 0 0 0 5850 0 83 | 2269 442 40 0 0 0 6491 8323 84 | 0 440 40 0 0 0 8308 0 85 | 170 642 0 0 0 0 6600 0 86 | 170 204 220 0 0 0 8176 0 87 | 3911 642 203 640 200 660 8305 7995 88 | 3171 683 0 0 0 0 6900 0 89 | 171 682 20 240 0 0 13104 11400 90 | 2721 244 20 0 0 0 13126 0 91 | 1522 244 20 0 0 0 13126 0 92 | 173 722 280 0 0 0 8176 0 93 | 4074 16 0 0 0 0 7050 0 94 | 4074 120 0 0 0 0 11898 0 95 | 175 742 300 0 0 0 8176 0 96 | 4213 424 0 0 0 0 7350 0 97 | 4226 782 0 0 0 0 7500 0 98 | 4227 802 0 0 0 0 7650 0 99 | 3000 0 0 0 0 0 15300 0 100 | 3150 0 0 0 0 0 15535 0 101 | 4350 0 0 0 0 0 7200 0 102 | 103 | "AUT" "ANY" 104 | "GO" "NOR" 105 | "*ENT" "SOU" 106 | "*FOL" "EAS" 107 | "*RUN" "WES" 108 | "*WAL" "UP" 109 | "INV" "DOW" 110 | "SCO" "INV" 111 | "SAV" "GAM" 112 | "LOO" "SIG" 113 | "TAK" "TRE" 114 | "*GET" "HON" 115 | "CHO" "STU" 116 | "BAT" "DOO" 117 | "*RAM" "TUN" 118 | "LIG" "PAS" 119 | "REA" "ENT" 120 | "CLI" "PLY" 121 | "LEA" "OAK" 122 | "*DRO" "BAL" 123 | "HEL" "PAT" 124 | "EXA" "VAS" 125 | "OPE" "OUT" 126 | "KIC" "POO" 127 | "*SMA" "BRE" 128 | "*BRE" "INF" 129 | "GIV" "IRO" 130 | "HOL" "BRO" 131 | "KNO" "AXE" 132 | "WAI" "*AX" 133 | "" "MAT" 134 | "" "CHA" 135 | "" "CRO" 136 | "" "MED" 137 | "" "SCE" 138 | "" "GOB" 139 | "" "LAM" 140 | "" "TRU" 141 | "" "MUD" 142 | "" "OIL" 143 | "" "CHI" 144 | "" "KEY" 145 | "" "STO" 146 | 147 | 0 0 0 0 0 0 "" 148 | 0 0 2 0 0 0 "small wooden hut." 149 | 5 10 3 1 0 0 "clearing. There's a small hut to the west." 150 | 6 13 0 2 0 0 "glade" 151 | 0 0 0 0 0 3 "the top of a beech tree" 152 | 0 2 6 0 0 0 "dismal swamp" 153 | 0 3 0 5 0 0 "rocky area by an outcrop" 154 | 0 6 0 0 0 0 "dingy north-south tunnel" 155 | 0 7 0 0 0 0 "gloomy north-south passage" 156 | 0 8 0 0 0 0 "empty room" 157 | 2 0 13 0 0 0 "forest" 158 | 10 0 0 0 0 0 "overgrown path in a dark forest" 159 | 0 0 0 0 0 0 "*I'm INSIDE a huge vase!" 160 | 3 0 0 10 0 0 "forest" 161 | 0 0 0 0 13 0 "bubbling pool, just below the water level" 162 | 14 16 0 0 0 0 "*I'm swimming in an underground river. 163 | Light pours from the north." 164 | 15 17 0 0 0 0 "*I'm swimming in an underground river. 165 | There's a faint glimmer of light to the north." 166 | 16 18 0 0 0 0 "*I'm swimming in an underground river. 167 | There's a faint glimmer of light to the south." 168 | 17 19 0 0 0 0 "*I'm swimming in an underground river. 169 | Light pours from the south." 170 | 18 0 0 0 0 0 "brightly lit underground chamber. 171 | An underground river disappears into the north wall." 172 | 19 0 23 21 0 0 "central underground chamber. Passages leave in all directions." 173 | 0 0 20 0 0 0 "prison in an undergound complex. Doors lead to prison cells" 174 | 1 0 21 0 0 0 "dirty prison cell with muddy straw on the ground" 175 | 0 25 24 20 0 0 "junction between an east-west passage and one that leads south" 176 | 0 0 0 23 0 0 "control room filled with humming, crackling machinery" 177 | 23 26 0 0 0 0 "square room with a steel floor" 178 | 25 0 0 0 0 0 "vast hall which is split by a deep chasm running from east to west" 179 | 0 0 1 0 0 0 "*I'm dead. Great. Try again." 180 | 181 | "" 182 | "Welcome to `CRYSTAL OF CHAOS`" 183 | "Written by Mike Taylor, starting Monday 10th April 2001" 184 | "This is a demo for the `ScottKit` adventure system" 185 | "" 186 | "Your task is to find the six crown jewels of the" 187 | "kingdom and store them in this hut. They are:" 188 | "a platinum chain, a gold crown, a silver medallion" 189 | "a bronze sceptre, a zinc goblet and a tin stoat." 190 | "Oh, there they are. That wasn't as hard as I expected." 191 | "Ah, looks like I'm still missing the stoat." 192 | "I have to breathe NOW!" 193 | "I can only hold my breath for" 194 | "more turns." 195 | "I can't breathe ..." 196 | "The plywood also catches fire and burns quickly." 197 | "The oak catches, and becomes a roaring fire." 198 | "Smoke pours upwards." 199 | "I can't chop anything without an axe." 200 | "I don't have a battering ram." 201 | "I don't have anything to light it with." 202 | "It says - `Leave *TREASURES* here, then say: SCORE`" 203 | "No! Bees would sting me!" 204 | "Smoke 'em out!" 205 | "TIMBER!" 206 | "There's nothing there all right! Maybe I should forget it?" 207 | "It's locked." 208 | "It splinters easily." 209 | "There's a tunnel beyond." 210 | "CRUNCH! It's smashed to smithereens!" 211 | "DOOSH! It's absolutely annihilated!" 212 | "It's also locked." 213 | "Ouch!" 214 | "CRUNCH!" 215 | "There's a passage beyond." 216 | "OF COURSE it's locked!" 217 | "It's too solid for the axe to make much impression." 218 | "DOOSH!" 219 | "There's an entrance beyond." 220 | "Not while I'm carrying it!" 221 | "I can't get it to catch fire." 222 | "My match goes out." 223 | "There's no way it will catch fire." 224 | "OK. It burns up very quickly." 225 | "Bear won't let me" 226 | "Bear eats the honey and falls asleep." 227 | "It's bigger than I am." 228 | "I'm already holding my breath!" 229 | "OK" 230 | "Which door? Use `knock iron` or `knock bronze`." 231 | "Nothing happens." 232 | "Nothing seems to happen." 233 | "You'll have to figure it out for yourself." 234 | "It looks like a pretty average" 235 | 236 | "Sign" 1 237 | "Axe/AXE/" 1 238 | "Single match/MAT/" 1 239 | "*Platinum chain*/CHA/" 2 240 | "*Gold crown*/CRO/" 2 241 | "*Silver medallion*/MED/" 2 242 | "*Bronze sceptre*/SCE/" 2 243 | "*Zinc goblet*/GOB/" 2 244 | "Beech tree" 3 245 | "Old-fashioned brass lamp/LAM/" 6 246 | "Wild honey/HON/" 4 247 | "Killer bees" 4 248 | "Drowsy bees" 0 249 | "Cypress tree" 5 250 | "-SOLID- stump" 0 251 | "Trunk of cypress tree/TRU/" 0 252 | "Evil smelling mud/MUD/" 5 253 | "Swamp gas" 5 254 | "Patches of `OILY` slime/OIL/" 5 255 | "Chiggers/CHI/" 5 256 | "Balsa-wood door set into the rock" 6 257 | "Bees' nest" 4 258 | "Balsa wood/BAL/" 0 259 | "Tunnel disappears into the rock" 0 260 | "Plywood door blocks the way north" 7 261 | "Plywood/PLY/" 0 262 | "Passage disappears into the rock" 0 263 | "Oak door blocks the way north" 8 264 | "Oak/OAK/" 0 265 | "Entrance to the north" 0 266 | "Blazing hot fire" 0 267 | "Path leads south into the forest" 10 268 | "Very thin black bear" 10 269 | "Sleeping bear" 0 270 | "Huge vase/VAS/" 11 271 | "Iron key/KEY/" 12 272 | "Bubbling pool" 13 273 | "inflow from the south" 14 274 | "*Tin stoat*/STO/" 19 275 | "Iron door leads south" 21 276 | "Bronze door leads west" 21 277 | "small goblin" 22 278 | "Red button" 24 279 | "Blue button" 24 280 | "Lever" 24 281 | 282 | "" 283 | "" 284 | "" 285 | "" 286 | "" 287 | "" 288 | "" 289 | "" 290 | "cont" 291 | "cont" 292 | "" 293 | "" 294 | "" 295 | "" 296 | "" 297 | "" 298 | "" 299 | "" 300 | "" 301 | "" 302 | "" 303 | "" 304 | "" 305 | "" 306 | "" 307 | "" 308 | "" 309 | "" 310 | "" 311 | "" 312 | "Death due to lack of breath" 313 | "" 314 | "" 315 | "cont" 316 | "" 317 | "Fire-building must happen all in one go" 318 | "" 319 | "" 320 | "" 321 | "" 322 | "" 323 | "" 324 | "" 325 | "" 326 | "" 327 | "" 328 | "" 329 | "cont" 330 | "no balsa wood" 331 | "no balsa wood" 332 | "cont" 333 | "" 334 | "" 335 | "" 336 | "" 337 | "cont" 338 | "no plywood" 339 | "" 340 | "" 341 | "" 342 | "" 343 | "" 344 | "cont" 345 | "" 346 | "" 347 | "" 348 | "" 349 | "" 350 | "" 351 | "" 352 | "cont" 353 | "" 354 | "" 355 | "" 356 | "" 357 | "" 358 | "" 359 | "" 360 | "" 361 | "" 362 | "" 363 | "" 364 | "" 365 | "" 366 | "" 367 | "" 368 | "" 369 | "" 370 | 371 | 1 372 | 18400 373 | 0 374 | -------------------------------------------------------------------------------- /games/test/crystal.save-file: -------------------------------------------------------------------------------- 1 | 0 0 2 | 0 0 3 | 0 0 4 | 0 0 5 | 0 0 6 | 0 0 7 | 0 0 8 | 0 0 9 | 0 0 10 | 0 0 11 | 0 0 12 | 0 0 13 | 0 0 14 | 0 0 15 | 0 0 16 | 0 0 17 | 322 0 3 0 0 61 18 | 1 19 | 9 20 | 0 21 | 1 22 | 1 23 | 1 24 | 1 25 | 1 26 | 3 27 | 6 28 | 4 29 | 0 30 | 4 31 | 0 32 | 5 33 | 9 34 | 5 35 | 5 36 | 5 37 | 5 38 | 0 39 | 4 40 | 0 41 | 6 42 | 0 43 | 0 44 | 7 45 | 0 46 | 0 47 | 8 48 | 3 49 | 10 50 | 10 51 | 0 52 | 11 53 | 12 54 | 13 55 | 14 56 | 19 57 | 21 58 | 21 59 | 22 60 | 24 61 | 24 62 | 24 63 | -------------------------------------------------------------------------------- /games/test/crystal.save-script: -------------------------------------------------------------------------------- 1 | read sign 2 | east 3 | get chain 4 | get crown 5 | get medallion 6 | get sceptre 7 | get goblet 8 | west 9 | drop chain 10 | drop crown 11 | drop medallion 12 | drop sceptre 13 | drop goblet 14 | get axe 15 | get match 16 | east 17 | north 18 | chop tree 19 | get trunk 20 | east 21 | kick door 22 | go tunnel 23 | chop door 24 | go passage 25 | ram door 26 | go entrance 27 | drop trunk 28 | drop axe 29 | south 30 | get oak 31 | south 32 | get plywood 33 | south 34 | get balsa 35 | south 36 | drop oak 37 | drop plywood 38 | drop balsa 39 | light balsa 40 | save game 41 | TMP 42 | -------------------------------------------------------------------------------- /games/test/crystal.sck: -------------------------------------------------------------------------------- 1 | # Modified from crystal.sac v1.7 (2006-11-11) from Games::ScottAdams 2 | 3 | # crystal.sck -- Scott Adams source file for _Crystal of Chaos_ 4 | 5 | # ---------------------------------------------------------------------------- 6 | # Global configuration 7 | 8 | ident 18400 9 | version 1 10 | wordlen 3 11 | maxload 5 12 | lighttime 100 13 | start hut 14 | treasury hut 15 | 16 | # Standard synonyms 17 | verbgroup go enter follow run walk 18 | verbgroup take get 19 | verbgroup leave drop 20 | #verbgroup cut chop ### currently causes a collision 21 | verbgroup batter ram 22 | 23 | # ---------------------------------------------------------------------------- 24 | # Infrastructure actions (I don't think any game would ever omit these) 25 | 26 | action inventory: inventory 27 | action take inventory: inventory 28 | action score: score 29 | action save game: save_game 30 | action look: look 31 | 32 | # The path is dark; nowhere else is 33 | occur when "at" path 34 | set_dark 35 | ###look # Hard to make this work right in a non-curses driver 36 | 37 | occur when !at path 38 | clear_dark 39 | ###look # Hard to make this work right in a non-curses driver 40 | 41 | occur when !flag 1 42 | set_flag 1 43 | print "Welcome to `CRYSTAL OF CHAOS`" 44 | print "Written by Mike Taylor, starting Monday 10th April 2001" 45 | print "This is a demo for the `ScottKit` adventure system" 46 | print "" 47 | print "Your task is to find the six crown jewels of the" 48 | print "kingdom and store them in this hut. They are:" 49 | print "a platinum chain, a gold crown, a silver medallion" 50 | print "a bronze sceptre, a zinc goblet and a tin stoat." 51 | 52 | 53 | # ---------------------------------------------------------------------------- 54 | # Use of flags 55 | # flag 1: Set forever once welcome message has been printed. 56 | # flag 2: True immediately after balsa wood is lit. 57 | # flag 3: True immediately after plywood is lit. 58 | # flag 4: True immediately after oak is lit. 59 | # flag 5: True while under water. 60 | # flag 6: Set true forever when first in the treasure clearing. 61 | # flag 7: True if all treasures but the stoat have been stored. 62 | # flag 8: True once the missing stoat message has been printed. 63 | # 64 | # Use of saved locations 65 | # location 1: when in vase, contains room player was in before. 66 | # 67 | # Use of counters: 68 | # counter 1: number of turns remaining to hold breath 69 | 70 | # ---------------------------------------------------------------------------- 71 | # Preamble actions (must fire after body actions) 72 | 73 | occur when "at" clearing and !flag 6 74 | set_flag 6 75 | print "Oh, there they are. That wasn't as hard as I expected." 76 | 77 | # Check whether we have stored all treasures except the stoat 78 | occur when "at" hut 79 | set_flag 7 80 | #print "setting flag 7 (in hut)" 81 | 82 | occur when !here chain 83 | clear_flag 7 84 | #print "clearing flag 7 (no chain)" 85 | 86 | occur when !here crown 87 | clear_flag 7 88 | #print "clearing flag 7 (no crown)" 89 | 90 | occur when !here medallion 91 | clear_flag 7 92 | #print "clearing flag 7 (no medallion)" 93 | 94 | occur when !here sceptre 95 | clear_flag 7 96 | #print "clearing flag 7 (no sceptre)" 97 | 98 | occur when !here goblet 99 | clear_flag 7 100 | #print "clearing flag 7 (no goblet)" 101 | 102 | occur when flag 7 and !flag 8 103 | set_flag 8 104 | print "Ah, looks like I'm still missing the stoat." 105 | ### This message appears even if the stoat is already stored. 106 | 107 | # Check whether we're under water ... 108 | occur when "at" pool set_flag 5 109 | occur when "at" river1 set_flag 5 110 | occur when "at" river2 set_flag 5 111 | occur when "at" river3 set_flag 5 112 | occur when "at" river4 set_flag 5 113 | 114 | # ... or whether we've just emerged from under water 115 | occur when "at" forest2 clear_flag 5 116 | occur when "at" chamber clear_flag 5 117 | occur when "at" vase clear_flag 5 118 | occur when "at" dead clear_flag 5 119 | 120 | occur when counter_eq 1 121 | print "I have to breathe NOW!" 122 | 123 | occur when counter_gt 0 124 | dec_counter 125 | 126 | occur when counter_gt 0 127 | print "I can only hold my breath for" 128 | print_counter 129 | print "more turns." 130 | 131 | occur when counter_eq 0 and flag 5 132 | print "I can't breathe ..." 133 | pause 134 | clear_flag 5 135 | die 136 | comment "Death due to lack of breath" 137 | 138 | # We'd like the next three occurs to go after the action for LIGHT 139 | # BALSA below. But that doesn't work, because although any number of 140 | # occurs may fire on a given turn, action-and-occur processing stops 141 | # immediately after the first successful action. (I determined this 142 | # by experiment: I couldn't determine the intent of the scottfree 143 | # source to save my life.) Instead, we do these occur's at the very 144 | # start of the _next_ turn -- which from the player's perspective is 145 | # indistinguishable from the end of the previous one. 146 | 147 | occur when flag 2 and here plywood 148 | print "The plywood also catches fire and burns quickly." 149 | destroy plywood 150 | set_flag 3 151 | 152 | occur when flag 3 and here oak 153 | print "The oak catches, and becomes a roaring fire." 154 | print "Smoke pours upwards." 155 | destroy oak 156 | drop fire 157 | set_flag 4 158 | 159 | occur when flag 4 and "at" glade 160 | destroy bees 161 | put drowsy_bees beech 162 | 163 | occur 164 | clear_flag 2 165 | clear_flag 3 166 | clear_flag 4 167 | comment "Fire-building must happen all in one go" 168 | 169 | action chop when !present axe 170 | print "I can't chop anything without an axe." 171 | 172 | action ram when !present trunk 173 | print "I don't have a battering ram." 174 | 175 | action light when !present match 176 | print "I don't have anything to light it with." 177 | 178 | 179 | # ---------------------------------------------------------------------------- 180 | # Rooms, Items and associated Actions 181 | 182 | room hut "small wooden hut." 183 | exit east clearing 184 | 185 | item sign "Sign" 186 | 187 | action read sign when present sign 188 | print "It says - `Leave *TREASURES* here, then say: SCORE`" 189 | 190 | item axe "Axe" 191 | called axe 192 | noungroup axe ax 193 | 194 | item match "Single match" 195 | called match 196 | 197 | room clearing "clearing. There's a small hut to the west." 198 | exit north swamp 199 | exit east glade 200 | exit south forest 201 | exit west hut 202 | 203 | item chain "*Platinum chain*" 204 | called chain 205 | 206 | item crown "*Gold crown*" 207 | called crown 208 | 209 | item medallion "*Silver medallion*" 210 | called medallion 211 | 212 | item sceptre "*Bronze sceptre*" 213 | called sceptre 214 | 215 | item goblet "*Zinc goblet*" 216 | called goblet 217 | 218 | room glade "glade" 219 | exit west clearing 220 | exit north outcrop 221 | exit south forest2 222 | 223 | item beech "Beech tree" 224 | 225 | action climb tree when here beech 226 | goto beech 227 | look2 228 | 229 | room beech "the top of a beech tree" 230 | exit down glade 231 | 232 | item nest "Bees' nest" 233 | 234 | item honey "Wild honey" 235 | called honey 236 | 237 | action get honey when here bees 238 | print "No! Bees would sting me!" 239 | 240 | item bees "Killer bees" 241 | 242 | item drowsy_bees "Drowsy bees" 243 | nowhere 244 | 245 | action help when here bees 246 | print "Smoke 'em out!" 247 | 248 | room swamp "dismal swamp" 249 | exit east outcrop 250 | exit south clearing 251 | 252 | item cypress "Cypress tree" 253 | 254 | action chop tree when here cypress 255 | print "TIMBER!" 256 | swap cypress trunk 257 | drop stump 258 | look2 259 | 260 | item stump "-SOLID- stump" 261 | nowhere 262 | 263 | action examine stump when here stump 264 | print "There's nothing there all right! Maybe I should forget it?" 265 | 266 | item trunk "Trunk of cypress tree" 267 | called trunk 268 | nowhere 269 | 270 | item mud "Evil smelling mud" 271 | called mud 272 | 273 | item gas "Swamp gas" 274 | 275 | item slime "Patches of `OILY` slime" 276 | called oil 277 | 278 | item chiggers "Chiggers" 279 | called chiggers 280 | 281 | room outcrop "rocky area by an outcrop" 282 | exit west swamp 283 | exit south glade 284 | 285 | item bdoor "Balsa-wood door set into the rock" 286 | 287 | item lamp "Old-fashioned brass lamp" 288 | called lamp 289 | lightsource lamp 290 | 291 | action open door when here bdoor 292 | print "It's locked." 293 | 294 | verbgroup kick smash break 295 | 296 | action kick door when here bdoor 297 | swap bdoor tunnel 298 | drop balsa 299 | print "It splinters easily." 300 | print "There's a tunnel beyond." 301 | look2 302 | 303 | action chop door when here bdoor 304 | swap bdoor tunnel 305 | print "CRUNCH! It's smashed to smithereens!" 306 | print "There's a tunnel beyond." 307 | look2 308 | comment "no balsa wood" 309 | 310 | action ram door when here bdoor 311 | destroy bdoor 312 | drop tunnel 313 | print "DOOSH! It's absolutely annihilated!" 314 | print "There's a tunnel beyond." 315 | look2 316 | comment "no balsa wood" 317 | 318 | item balsa "Balsa wood" 319 | called balsa 320 | nowhere 321 | 322 | item tunnel "Tunnel disappears into the rock" 323 | nowhere 324 | 325 | action go tunnel when here tunnel 326 | goto tunnel 327 | look2 328 | 329 | room tunnel "dingy north-south tunnel" 330 | exit south outcrop 331 | 332 | item pdoor "Plywood door blocks the way north" 333 | 334 | action open door when here pdoor 335 | print "It's also locked." 336 | 337 | action kick door when here pdoor 338 | print "Ouch!" 339 | 340 | action chop door when here pdoor 341 | swap pdoor passage 342 | drop plywood 343 | print "CRUNCH!" 344 | print "There's a passage beyond." 345 | look2 346 | 347 | action ram door when here pdoor 348 | swap pdoor passage 349 | print "DOOSH! It's absolutely annihilated!" 350 | print "There's a passage beyond." 351 | look2 352 | comment "no plywood" 353 | 354 | item plywood "Plywood" 355 | called plywood 356 | nowhere 357 | 358 | item passage "Passage disappears into the rock" 359 | nowhere 360 | 361 | action go passage when here passage 362 | goto passage 363 | look2 364 | 365 | room passage "gloomy north-south passage" 366 | exit south tunnel 367 | 368 | item odoor "Oak door blocks the way north" 369 | 370 | action open door when here odoor 371 | print "OF COURSE it's locked!" 372 | 373 | action kick door when here odoor 374 | print "Ouch!" 375 | 376 | action chop door when here odoor 377 | print "It's too solid for the axe to make much impression." 378 | 379 | action ram door when here odoor 380 | swap odoor entrance 381 | drop oak 382 | print "DOOSH!" 383 | print "There's an entrance beyond." 384 | look2 385 | 386 | item oak "Oak" 387 | called oak 388 | nowhere 389 | 390 | item entrance "Entrance to the north" 391 | nowhere 392 | 393 | action go entrance when here entrance 394 | goto empty 395 | look2 396 | 397 | room empty "empty room" 398 | exit south passage 399 | 400 | item fire "Blazing hot fire" 401 | nowhere 402 | 403 | action light plywood when "carried" plywood 404 | print "Not while I'm carrying it!" 405 | 406 | action light plywood when here plywood 407 | print "I can't get it to catch fire." 408 | print "My match goes out." 409 | destroy match 410 | 411 | action light oak when here oak 412 | print "There's no way it will catch fire." 413 | print "My match goes out." 414 | destroy match 415 | 416 | action light oak when "carried" oak 417 | print "Not while I'm carrying it!" 418 | 419 | action light balsa when "carried" balsa 420 | print "Not while I'm carrying it!" 421 | 422 | action light balsa when here balsa 423 | print "OK. It burns up very quickly." 424 | print "My match goes out." 425 | destroy match 426 | destroy balsa 427 | set_flag 2 428 | 429 | room forest "forest" 430 | exit north clearing 431 | exit east forest2 432 | 433 | item path "Path leads south into the forest" 434 | 435 | action go path when here bear 436 | print "Bear won't let me" 437 | 438 | action go path when "at" forest 439 | goto path 440 | look2 441 | 442 | item bear "Very thin black bear" 443 | 444 | action give honey when here bear and present honey 445 | destroy bear 446 | destroy honey 447 | drop sleeping 448 | print "Bear eats the honey and falls asleep." 449 | 450 | item sleeping "Sleeping bear" 451 | nowhere 452 | 453 | room path "overgrown path in a dark forest" 454 | exit north forest 455 | 456 | item vase "Huge vase" 457 | called vase 458 | 459 | action examine vase when present vase 460 | print "It's bigger than I am." 461 | 462 | action go vase when here vase 463 | swap_specific_room 1 464 | goto vase 465 | look2 466 | 467 | action leave vase when "at" vase 468 | swap_specific_room 1 469 | look2 470 | 471 | action get out when "at" vase 472 | swap_specific_room 1 473 | look2 474 | 475 | room vase "*I'm INSIDE a huge vase!" 476 | 477 | item key "Iron key" 478 | called key 479 | 480 | room forest2 "forest" 481 | exit north glade 482 | exit west forest 483 | 484 | item pool "Bubbling pool" 485 | 486 | action go pool when here pool 487 | goto pool 488 | look2 489 | 490 | action hold breath when counter_gt 0 491 | print "I'm already holding my breath!" 492 | 493 | action hold breath 494 | set_counter 6 495 | print "OK" 496 | 497 | room pool "bubbling pool, just below the water level" 498 | exit up forest2 499 | 500 | item inflow "inflow from the south" 501 | 502 | action go inflow when here inflow 503 | goto river1 504 | look2 505 | 506 | room river1 "*I'm swimming in an underground river. 507 | Light pours from the north." 508 | exit north pool 509 | exit south river2 510 | 511 | room river2 "*I'm swimming in an underground river. 512 | There's a faint glimmer of light to the north." 513 | exit north river1 514 | exit south river3 515 | 516 | room river3 "*I'm swimming in an underground river. 517 | There's a faint glimmer of light to the south." 518 | exit north river2 519 | exit south river4 520 | 521 | room river4 "*I'm swimming in an underground river. 522 | Light pours from the south." 523 | exit north river3 524 | exit south chamber 525 | 526 | room chamber "brightly lit underground chamber. 527 | An underground river disappears into the north wall." 528 | exit north river4 529 | # exit south central 530 | 531 | item stoat "*Tin stoat*" 532 | called stoat 533 | 534 | room central "central underground chamber. Passages leave in all directions." 535 | exit north chamber 536 | exit west prison 537 | exit east junction 538 | 539 | room prison "prison in an undergound complex. Doors lead to prison cells" 540 | exit east central 541 | 542 | item idoor "Iron door leads south" 543 | 544 | item brdoor "Bronze door leads west" 545 | 546 | action knock door when "at" prison 547 | print "Which door? Use `knock iron` or `knock bronze`." 548 | 549 | action knock iron when here idoor 550 | print "Nothing happens." 551 | 552 | action knock bronze when here brdoor 553 | print "Nothing seems to happen." 554 | 555 | room cell1 "dirty prison cell with muddy straw on the ground" 556 | exit east prison 557 | exit north hut 558 | 559 | item goblin "small goblin" 560 | 561 | room junction "junction between an east-west passage and one that leads south" 562 | exit west central 563 | exit east control 564 | exit south steel 565 | 566 | room control "control room filled with humming, crackling machinery" 567 | exit west junction 568 | 569 | item red "Red button" 570 | 571 | item blue "Blue button" 572 | 573 | item level "Lever" 574 | 575 | room steel "square room with a steel floor" 576 | exit north junction 577 | exit south chasm 578 | 579 | room chasm "vast hall which is split by a deep chasm running from east to west" 580 | exit north steel 581 | 582 | room dead "*I'm dead. Great. Try again." 583 | exit east hut 584 | 585 | 586 | # ---------------------------------------------------------------------------- 587 | # Postamble actions (must fire after body actions) 588 | 589 | action help: 590 | print "You'll have to figure it out for yourself." 591 | 592 | action examine: 593 | print "It looks like a pretty average" 594 | println_noun 595 | 596 | action wait: 597 | print "OK" 598 | 599 | -------------------------------------------------------------------------------- /games/test/crystal.solution: -------------------------------------------------------------------------------- 1 | read sign 2 | east 3 | get chain 4 | get crown 5 | get medallion 6 | get sceptre 7 | get goblet 8 | west 9 | drop chain 10 | drop crown 11 | drop medallion 12 | drop sceptre 13 | drop goblet 14 | get axe 15 | get match 16 | east 17 | north 18 | chop tree 19 | get trunk 20 | east 21 | kick door 22 | go tunnel 23 | chop door 24 | go passage 25 | ram door 26 | go entrance 27 | drop trunk 28 | drop axe 29 | south 30 | get oak 31 | south 32 | get plywood 33 | south 34 | get balsa 35 | south 36 | drop oak 37 | drop plywood 38 | drop balsa 39 | light balsa 40 | climb tree 41 | get honey 42 | down 43 | north 44 | get lamp 45 | west 46 | south 47 | south 48 | give honey 49 | follow path 50 | get vase 51 | north 52 | east 53 | examine vase 54 | hold breath 55 | go pool 56 | go inflow 57 | south 58 | drop vase 59 | go vase 60 | get key 61 | hold breath 62 | get out 63 | south 64 | south 65 | south 66 | get stoat 67 | hold breath 68 | north 69 | north 70 | north 71 | go vase 72 | wait 73 | hold breath 74 | get out 75 | north 76 | north 77 | up 78 | north 79 | west 80 | west 81 | drop stoat 82 | score 83 | -------------------------------------------------------------------------------- /games/test/crystal.transcript: -------------------------------------------------------------------------------- 1 | ScottKit, a Scott Adams game toolkit in Ruby. 2 | (C) 2010-2017 Mike Taylor 3 | Distributed under the GNU GPL version 2 license. 4 | Setting random seed 12368 5 | Welcome to "CRYSTAL OF CHAOS" 6 | Written by Mike Taylor, starting Monday 10th April 2001 7 | This is a demo for the "ScottKit" adventure system 8 | 9 | Your task is to find the six crown jewels of the 10 | kingdom and store them in this hut. They are: 11 | a platinum chain, a gold crown, a silver medallion 12 | a bronze sceptre, a zinc goblet and a tin stoat. 13 | 14 | I'm in a small wooden hut. 15 | Obvious exits: East. 16 | I can also see: Sign, Axe, Single match 17 | 18 | Tell me what to do ? read sign 19 | It says - "Leave *TREASURES* here, then say: SCORE" 20 | Tell me what to do ? east 21 | Oh, there they are. That wasn't as hard as I expected. 22 | 23 | I'm in a clearing. There's a small hut to the west. 24 | Obvious exits: North, South, East, West. 25 | I can also see: *Platinum chain*, *Gold crown*, *Silver medallion*, *Bronze sceptre*, *Zinc goblet* 26 | 27 | Tell me what to do ? get chain 28 | O.K. 29 | Tell me what to do ? get crown 30 | O.K. 31 | Tell me what to do ? get medallion 32 | O.K. 33 | Tell me what to do ? get sceptre 34 | O.K. 35 | Tell me what to do ? get goblet 36 | O.K. 37 | Tell me what to do ? west 38 | 39 | I'm in a small wooden hut. 40 | Obvious exits: East. 41 | I can also see: Sign, Axe, Single match 42 | 43 | Tell me what to do ? drop chain 44 | O.K. 45 | Tell me what to do ? drop crown 46 | O.K. 47 | Tell me what to do ? drop medallion 48 | O.K. 49 | Tell me what to do ? drop sceptre 50 | O.K. 51 | Tell me what to do ? drop goblet 52 | O.K. 53 | Ah, looks like I'm still missing the stoat. 54 | Tell me what to do ? get axe 55 | O.K. 56 | Tell me what to do ? get match 57 | O.K. 58 | Tell me what to do ? east 59 | 60 | I'm in a clearing. There's a small hut to the west. 61 | Obvious exits: North, South, East, West. 62 | 63 | Tell me what to do ? north 64 | 65 | I'm in a dismal swamp 66 | Obvious exits: South, East. 67 | I can also see: Cypress tree, Evil smelling mud, Swamp gas, Patches of "OILY" slime, Chiggers 68 | 69 | Tell me what to do ? chop tree 70 | TIMBER! 71 | 72 | I'm in a dismal swamp 73 | Obvious exits: South, East. 74 | I can also see: -SOLID- stump, Trunk of cypress tree, Evil smelling mud, Swamp gas, Patches of "OILY" slime, Chiggers 75 | 76 | Tell me what to do ? get trunk 77 | O.K. 78 | Tell me what to do ? east 79 | 80 | I'm in a rocky area by an outcrop 81 | Obvious exits: South, West. 82 | I can also see: Old-fashioned brass lamp, Balsa-wood door set into the rock 83 | 84 | Tell me what to do ? kick door 85 | It splinters easily. 86 | There's a tunnel beyond. 87 | 88 | I'm in a rocky area by an outcrop 89 | Obvious exits: South, West. 90 | I can also see: Old-fashioned brass lamp, Balsa wood, Tunnel disappears into the rock 91 | 92 | Tell me what to do ? go tunnel 93 | 94 | I'm in a dingy north-south tunnel 95 | Obvious exits: South. 96 | I can also see: Plywood door blocks the way north 97 | 98 | Tell me what to do ? chop door 99 | CRUNCH! 100 | There's a passage beyond. 101 | 102 | I'm in a dingy north-south tunnel 103 | Obvious exits: South. 104 | I can also see: Plywood, Passage disappears into the rock 105 | 106 | Tell me what to do ? go passage 107 | 108 | I'm in a gloomy north-south passage 109 | Obvious exits: South. 110 | I can also see: Oak door blocks the way north 111 | 112 | Tell me what to do ? ram door 113 | DOOSH! 114 | There's an entrance beyond. 115 | 116 | I'm in a gloomy north-south passage 117 | Obvious exits: South. 118 | I can also see: Oak, Entrance to the north 119 | 120 | Tell me what to do ? go entrance 121 | 122 | I'm in a empty room 123 | Obvious exits: South. 124 | 125 | Tell me what to do ? drop trunk 126 | O.K. 127 | Tell me what to do ? drop axe 128 | O.K. 129 | Tell me what to do ? south 130 | 131 | I'm in a gloomy north-south passage 132 | Obvious exits: South. 133 | I can also see: Oak, Entrance to the north 134 | 135 | Tell me what to do ? get oak 136 | O.K. 137 | Tell me what to do ? south 138 | 139 | I'm in a dingy north-south tunnel 140 | Obvious exits: South. 141 | I can also see: Plywood, Passage disappears into the rock 142 | 143 | Tell me what to do ? get plywood 144 | O.K. 145 | Tell me what to do ? south 146 | 147 | I'm in a rocky area by an outcrop 148 | Obvious exits: South, West. 149 | I can also see: Old-fashioned brass lamp, Balsa wood, Tunnel disappears into the rock 150 | 151 | Tell me what to do ? get balsa 152 | O.K. 153 | Tell me what to do ? south 154 | 155 | I'm in a glade 156 | Obvious exits: North, South, West. 157 | I can also see: Beech tree 158 | 159 | Tell me what to do ? drop oak 160 | O.K. 161 | Tell me what to do ? drop plywood 162 | O.K. 163 | Tell me what to do ? drop balsa 164 | O.K. 165 | Tell me what to do ? light balsa 166 | OK. It burns up very quickly. 167 | My match goes out. 168 | The plywood also catches fire and burns quickly. 169 | The oak catches, and becomes a roaring fire. 170 | Smoke pours upwards. 171 | Tell me what to do ? climb tree 172 | 173 | I'm in a the top of a beech tree 174 | Obvious exits: Down. 175 | I can also see: Wild honey, Drowsy bees, Bees' nest 176 | 177 | Tell me what to do ? get honey 178 | O.K. 179 | Tell me what to do ? down 180 | 181 | I'm in a glade 182 | Obvious exits: North, South, West. 183 | I can also see: Beech tree, Blazing hot fire 184 | 185 | Tell me what to do ? north 186 | 187 | I'm in a rocky area by an outcrop 188 | Obvious exits: South, West. 189 | I can also see: Old-fashioned brass lamp, Tunnel disappears into the rock 190 | 191 | Tell me what to do ? get lamp 192 | O.K. 193 | Tell me what to do ? west 194 | 195 | I'm in a dismal swamp 196 | Obvious exits: South, East. 197 | I can also see: -SOLID- stump, Evil smelling mud, Swamp gas, Patches of "OILY" slime, Chiggers 198 | 199 | Tell me what to do ? south 200 | 201 | I'm in a clearing. There's a small hut to the west. 202 | Obvious exits: North, South, East, West. 203 | 204 | Tell me what to do ? south 205 | 206 | I'm in a forest 207 | Obvious exits: North, East. 208 | I can also see: Path leads south into the forest, Very thin black bear 209 | 210 | Tell me what to do ? give honey 211 | Bear eats the honey and falls asleep. 212 | Tell me what to do ? follow path 213 | 214 | I'm in a overgrown path in a dark forest 215 | Obvious exits: North. 216 | I can also see: Huge vase 217 | 218 | Tell me what to do ? get vase 219 | O.K. 220 | Tell me what to do ? north 221 | 222 | I'm in a forest 223 | Obvious exits: North, East. 224 | I can also see: Path leads south into the forest, Sleeping bear 225 | 226 | Tell me what to do ? east 227 | 228 | I'm in a forest 229 | Obvious exits: North, West. 230 | I can also see: Bubbling pool 231 | 232 | Tell me what to do ? examine vase 233 | It's bigger than I am. 234 | Tell me what to do ? hold breath 235 | OK 236 | I can only hold my breath for 237 | 5 more turns. 238 | Tell me what to do ? go pool 239 | I can only hold my breath for 240 | 4 more turns. 241 | 242 | I'm in a bubbling pool, just below the water level 243 | Obvious exits: Up. 244 | I can also see: inflow from the south 245 | 246 | Tell me what to do ? go inflow 247 | I can only hold my breath for 248 | 3 more turns. 249 | 250 | I'm swimming in an underground river. 251 | Light pours from the north. 252 | Obvious exits: North, South. 253 | 254 | Tell me what to do ? south 255 | I can only hold my breath for 256 | 2 more turns. 257 | 258 | I'm swimming in an underground river. 259 | There's a faint glimmer of light to the north. 260 | Obvious exits: North, South. 261 | 262 | Tell me what to do ? drop vase 263 | O.K. 264 | I can only hold my breath for 265 | 1 more turns. 266 | Tell me what to do ? go vase 267 | I have to breathe NOW! 268 | 269 | I'm INSIDE a huge vase! 270 | I can also see: Iron key 271 | 272 | Tell me what to do ? get key 273 | O.K. 274 | Tell me what to do ? hold breath 275 | OK 276 | I can only hold my breath for 277 | 5 more turns. 278 | Tell me what to do ? get out 279 | I can only hold my breath for 280 | 4 more turns. 281 | 282 | I'm swimming in an underground river. 283 | There's a faint glimmer of light to the north. 284 | Obvious exits: North, South. 285 | I can also see: Huge vase 286 | 287 | Tell me what to do ? south 288 | I can only hold my breath for 289 | 3 more turns. 290 | 291 | I'm swimming in an underground river. 292 | There's a faint glimmer of light to the south. 293 | Obvious exits: North, South. 294 | 295 | Tell me what to do ? south 296 | I can only hold my breath for 297 | 2 more turns. 298 | 299 | I'm swimming in an underground river. 300 | Light pours from the south. 301 | Obvious exits: North, South. 302 | 303 | Tell me what to do ? south 304 | I can only hold my breath for 305 | 1 more turns. 306 | 307 | I'm in a brightly lit underground chamber. 308 | An underground river disappears into the north wall. 309 | Obvious exits: North. 310 | I can also see: *Tin stoat* 311 | 312 | Tell me what to do ? get stoat 313 | O.K. 314 | I have to breathe NOW! 315 | Tell me what to do ? hold breath 316 | OK 317 | I can only hold my breath for 318 | 5 more turns. 319 | Tell me what to do ? north 320 | I can only hold my breath for 321 | 4 more turns. 322 | 323 | I'm swimming in an underground river. 324 | Light pours from the south. 325 | Obvious exits: North, South. 326 | 327 | Tell me what to do ? north 328 | I can only hold my breath for 329 | 3 more turns. 330 | 331 | I'm swimming in an underground river. 332 | There's a faint glimmer of light to the south. 333 | Obvious exits: North, South. 334 | 335 | Tell me what to do ? north 336 | I can only hold my breath for 337 | 2 more turns. 338 | 339 | I'm swimming in an underground river. 340 | There's a faint glimmer of light to the north. 341 | Obvious exits: North, South. 342 | I can also see: Huge vase 343 | 344 | Tell me what to do ? go vase 345 | I can only hold my breath for 346 | 1 more turns. 347 | 348 | I'm INSIDE a huge vase! 349 | 350 | Tell me what to do ? wait 351 | OK 352 | I have to breathe NOW! 353 | Tell me what to do ? hold breath 354 | OK 355 | I can only hold my breath for 356 | 5 more turns. 357 | Tell me what to do ? get out 358 | I can only hold my breath for 359 | 4 more turns. 360 | 361 | I'm swimming in an underground river. 362 | There's a faint glimmer of light to the north. 363 | Obvious exits: North, South. 364 | I can also see: Huge vase 365 | 366 | Tell me what to do ? north 367 | I can only hold my breath for 368 | 3 more turns. 369 | 370 | I'm swimming in an underground river. 371 | Light pours from the north. 372 | Obvious exits: North, South. 373 | 374 | Tell me what to do ? north 375 | I can only hold my breath for 376 | 2 more turns. 377 | 378 | I'm in a bubbling pool, just below the water level 379 | Obvious exits: Up. 380 | I can also see: inflow from the south 381 | 382 | Tell me what to do ? up 383 | I can only hold my breath for 384 | 1 more turns. 385 | 386 | I'm in a forest 387 | Obvious exits: North, West. 388 | I can also see: Bubbling pool 389 | 390 | Tell me what to do ? north 391 | I have to breathe NOW! 392 | 393 | I'm in a glade 394 | Obvious exits: North, South, West. 395 | I can also see: Beech tree, Blazing hot fire 396 | 397 | Tell me what to do ? west 398 | 399 | I'm in a clearing. There's a small hut to the west. 400 | Obvious exits: North, South, East, West. 401 | 402 | Tell me what to do ? west 403 | Your light is growing dim. 404 | 405 | I'm in a small wooden hut. 406 | Obvious exits: East. 407 | I can also see: Sign, *Platinum chain*, *Gold crown*, *Silver medallion*, *Bronze sceptre*, *Zinc goblet* 408 | 409 | Tell me what to do ? drop stoat 410 | O.K. 411 | Tell me what to do ? score 412 | I've stored 6 treasures. On a scale of 0 to 100, that rates 100. 413 | Well done. 414 | The game is now over. 415 | -------------------------------------------------------------------------------- /games/test/t6.pretty-print: -------------------------------------------------------------------------------- 1 | #, 14 | #, 18 | #"chamber"}>, 22 | #"dungeon", "north"=>"throne", "west"=>"cave"}>, 26 | #"chamber", "north"=>"crypt"}>, 30 | #"dungeon"}>, 34 | #"dungeon"}>], 38 | items= 39 | [#, 44 | #, 49 | #, 54 | #, 59 | #, 64 | #, 69 | #, 74 | #, 79 | #, 84 | #], 89 | actions= 90 | [#, 97 | #, 104 | #, 111 | #, 121 | #, 128 | #, 135 | #, 142 | #, 149 | #, 159 | #, 166 | #, 173 | #, 180 | #, 187 | #, 194 | #, 202 | #, 209 | #, 217 | #, 224 | #, 231 | #], 238 | verbgroups=[["take", "get"], ["leave", "drop"]], 239 | noungroups=[["lamp", "lantern"], ["doorbell", "bell"]]> 240 | -------------------------------------------------------------------------------- /games/test/t6.sck: -------------------------------------------------------------------------------- 1 | start cave 2 | treasury throne 3 | 4 | action score: score 5 | action inventory: inventory 6 | action look: look 7 | 8 | occur when !flag 1 9 | print "Welcome to the Tutorial adventure." 10 | print "You must find a gold coin and store it." 11 | set_flag 1 12 | 13 | room cave "cave mouth" 14 | 15 | item doorbell "doorbell" 16 | 17 | item entrance "entrance to cave" 18 | nowhere 19 | 20 | action go entrance when here entrance 21 | goto chamber 22 | look 23 | 24 | action ring doorbell when here doorbell and !here entrance 25 | set_counter 4 26 | print "Ding dong!" 27 | 28 | occur 29 | dec_counter 30 | 31 | occur when counter_eq 2 32 | print "I hear an ominous rumble." 33 | 34 | occur when counter_eq 1 35 | put entrance cave 36 | print "The rocks collapse leaving a way in." 37 | look 38 | 39 | action wait: 40 | print "Time passes ..." 41 | 42 | room throne "gorgeously decorated throne room" 43 | exit south chamber 44 | 45 | item sign "Sign says: leave treasure here, then say SCORE" 46 | 47 | item lamp "old-fashioned brass lamp" 48 | called "lamp" 49 | 50 | lightsource lamp 51 | 52 | room chamber "square chamber" 53 | exit east dungeon 54 | exit north throne 55 | exit west cave 56 | 57 | # Flag 15 is on when and only when it is dark 58 | occur when at chamber and flag 15 59 | clear_dark 60 | look 61 | 62 | item cross "Wooden cross" 63 | called "cross" 64 | 65 | room dungeon "gloomy dungeon" 66 | exit west chamber 67 | exit north crypt 68 | 69 | occur when at dungeon and !flag 15 70 | set_dark 71 | look 72 | 73 | occur 25% when at dungeon 74 | print "I smell something rotting to the north." 75 | 76 | item door "Locked door" 77 | 78 | item key "Brass key" 79 | called "key" 80 | at crypt 81 | 82 | item door2 "Open door leads south" 83 | nowhere 84 | 85 | action open door when here door and !present key 86 | print "It's locked." 87 | 88 | action open door when here door 89 | swap door door2 90 | print OK 91 | look 92 | 93 | action go door when here door2 94 | goto cell 95 | look 96 | 97 | room cell "dungeon cell" 98 | exit north dungeon 99 | 100 | item coin "*Gold coin*" 101 | called "coin" 102 | 103 | room crypt "damp, dismal crypt" 104 | exit south dungeon 105 | 106 | item vampire "Vampire" 107 | 108 | occur 25% when here vampire and !carried cross 109 | print "Vampire bites me! I'm dead!" 110 | game_over 111 | comment "vampire can attack unless cross is carried" 112 | 113 | occur when here vampire and !carried cross 114 | print "Vampire looks hungrily at me." 115 | 116 | occur when here vampire and carried cross 117 | print "Vampire cowers away from the cross!" 118 | 119 | action get key when here vampire and !carried cross 120 | print "I'm not going anywhere near that vampire!" 121 | 122 | verbgroup take get 123 | verbgroup leave drop 124 | noungroup lamp lantern 125 | noungroup doorbell bell 126 | -------------------------------------------------------------------------------- /games/test/t7.sao: -------------------------------------------------------------------------------- 1 | 29168 2 | 10 3 | 18 4 | 19 5 | 6 6 | 2 7 | 1 8 | 1 9 | 3 10 | 26 11 | 11 12 | 2 13 | 14 | 300 0 0 0 0 0 9750 0 15 | 450 0 0 0 0 0 9900 0 16 | 600 0 0 0 0 0 9600 0 17 | 100 29 20 0 0 0 152 8700 18 | 157 22 60 0 0 0 8164 0 19 | 758 2 25 80 0 0 11853 0 20 | 100 0 0 0 0 0 11550 0 21 | 100 59 0 0 0 0 600 0 22 | 100 39 20 20 0 0 9305 9600 23 | 900 0 0 0 0 0 900 0 24 | 100 328 320 180 80 0 9072 9600 25 | 100 64 308 0 0 0 8614 0 26 | 100 84 309 0 0 0 8464 0 27 | 25 84 0 0 0 0 1050 0 28 | 1058 122 146 0 0 0 1200 0 29 | 1058 122 120 160 0 0 10809 9600 30 | 158 162 100 0 0 0 8164 0 31 | 100 202 106 0 0 0 1563 0 32 | 100 202 101 0 0 0 1650 0 33 | 34 | "AUT" "ANY" 35 | "GO" "NOR" 36 | "SCO" "SOU" 37 | "INV" "EAS" 38 | "LOO" "WES" 39 | "RIN" "UP" 40 | "WAI" "DOW" 41 | "OPE" "ENT" 42 | "" "DOO" 43 | "" "*BEL" 44 | "TAK" "COI" 45 | "*GET" "LAM" 46 | "" "*LAN" 47 | "" "CRO" 48 | "" "KEY" 49 | "" "" 50 | "" "" 51 | "" "" 52 | "LEA" "" 53 | "*DRO" "" 54 | 55 | 0 0 0 0 0 0 "" 56 | 0 0 0 0 0 0 "cave mouth" 57 | 0 3 0 0 0 0 "gorgeously decorated throne room" 58 | 2 0 4 1 0 0 "square chamber" 59 | 6 0 0 3 0 0 "gloomy dungeon" 60 | 4 0 0 0 0 0 "dungeon cell" 61 | 0 4 0 0 0 0 "damp, dismal crypt" 62 | 63 | "" 64 | "Welcome to the Tutorial adventure." 65 | "You must find a gold coin and store it." 66 | "Ding dong!" 67 | "I hear an ominous rumble." 68 | "The rocks collapse leaving a way in." 69 | "Time passes ..." 70 | "I smell something rotting to the north." 71 | "It's locked." 72 | "OK" 73 | "Vampire bites me! I'm dead!" 74 | "Vampire cowers away from the cross!" 75 | 76 | "doorbell" 1 77 | "entrance to cave" 0 78 | "Sign says: leave treasure here, then say SCORE" 2 79 | "*Gold coin*/COI/" 5 80 | "empty lamp/LAM/" 0 81 | "Wooden cross/CRO/" 3 82 | "Locked door" 4 83 | "Brass key/KEY/" 6 84 | "Open door leads south" 0 85 | "old-fashioned brass lamp/LAM/" 2 86 | "Vampire" 6 87 | 88 | "" 89 | "" 90 | "" 91 | "" 92 | "" 93 | "" 94 | "" 95 | "" 96 | "" 97 | "" 98 | "The engine set flag 16 when the lamp runs out" 99 | "" 100 | "" 101 | "" 102 | "" 103 | "" 104 | "" 105 | "vampire attacks unless cross is carried" 106 | "" 107 | 108 | 100 109 | 31802 110 | 28893 111 | -------------------------------------------------------------------------------- /games/test/t7.solution: -------------------------------------------------------------------------------- 1 | ring bell 2 | wait 3 | wait 4 | go entrance 5 | get cross 6 | north 7 | get lamp 8 | south 9 | east 10 | north 11 | drop lamp 12 | get key 13 | south 14 | drop key 15 | north 16 | get lamp 17 | south 18 | drop cross 19 | get key 20 | open door 21 | go door 22 | drop key 23 | get coin 24 | north 25 | west 26 | north 27 | drop coin 28 | score 29 | -------------------------------------------------------------------------------- /games/test/t7.transcript: -------------------------------------------------------------------------------- 1 | ScottKit, a Scott Adams game toolkit in Ruby. 2 | (C) 2010-2017 Mike Taylor 3 | Distributed under the GNU GPL version 2 license. 4 | Setting random seed 12368 5 | Welcome to the Tutorial adventure. 6 | You must find a gold coin and store it. 7 | 8 | I'm in a cave mouth 9 | I can also see: doorbell 10 | 11 | Tell me what to do ? ring bell 12 | Ding dong! 13 | Tell me what to do ? wait 14 | Time passes ... 15 | I hear an ominous rumble. 16 | Tell me what to do ? wait 17 | Time passes ... 18 | The rocks collapse leaving a way in. 19 | 20 | I'm in a cave mouth 21 | I can also see: doorbell, entrance to cave 22 | 23 | Tell me what to do ? go entrance 24 | 25 | I'm in a square chamber 26 | Obvious exits: North, East, West. 27 | I can also see: Wooden cross 28 | 29 | Tell me what to do ? get cross 30 | O.K. 31 | Tell me what to do ? north 32 | Your light is growing dim. 33 | 34 | I'm in a gorgeously decorated throne room 35 | Obvious exits: South. 36 | I can also see: Sign says: leave treasure here, then say SCORE, old-fashioned brass lamp 37 | 38 | Tell me what to do ? get lamp 39 | O.K. 40 | Tell me what to do ? south 41 | 42 | I'm in a square chamber 43 | Obvious exits: North, East, West. 44 | 45 | Tell me what to do ? east 46 | I smell something rotting to the north. 47 | 48 | I'm in a gloomy dungeon 49 | Obvious exits: North, West. 50 | I can also see: Locked door 51 | 52 | Tell me what to do ? north 53 | Vampire cowers away from the cross! 54 | 55 | I'm in a damp, dismal crypt 56 | Obvious exits: South. 57 | I can also see: Brass key, Vampire 58 | 59 | Tell me what to do ? drop lamp 60 | O.K. 61 | Your light is growing dim. 62 | Vampire cowers away from the cross! 63 | Tell me what to do ? get key 64 | O.K. 65 | Vampire cowers away from the cross! 66 | Tell me what to do ? south 67 | 68 | I can't see. It is too dark! 69 | 70 | Tell me what to do ? drop key 71 | O.K. 72 | Tell me what to do ? north 73 | Dangerous to move in the dark! 74 | Vampire cowers away from the cross! 75 | 76 | I'm in a damp, dismal crypt 77 | Obvious exits: South. 78 | I can also see: old-fashioned brass lamp, Vampire 79 | 80 | Tell me what to do ? get lamp 81 | O.K. 82 | Your light is growing dim. 83 | Vampire cowers away from the cross! 84 | Tell me what to do ? south 85 | 86 | I'm in a gloomy dungeon 87 | Obvious exits: North, West. 88 | I can also see: Locked door, Brass key 89 | 90 | Tell me what to do ? drop cross 91 | O.K. 92 | Tell me what to do ? get key 93 | O.K. 94 | I smell something rotting to the north. 95 | Tell me what to do ? open door 96 | OK 97 | 98 | I'm in a gloomy dungeon 99 | Obvious exits: North, West. 100 | I can also see: Wooden cross, Open door leads south 101 | 102 | Tell me what to do ? go door 103 | Your light is growing dim. 104 | 105 | I'm in a dungeon cell 106 | Obvious exits: North. 107 | I can also see: *Gold coin* 108 | 109 | Tell me what to do ? drop key 110 | O.K. 111 | Tell me what to do ? get coin 112 | O.K. 113 | Tell me what to do ? north 114 | 115 | I'm in a gloomy dungeon 116 | Obvious exits: North, West. 117 | I can also see: Wooden cross, Open door leads south 118 | 119 | Tell me what to do ? west 120 | 121 | I'm in a square chamber 122 | Obvious exits: North, East, West. 123 | 124 | Tell me what to do ? north 125 | Your light has run out 126 | 127 | I'm in a gorgeously decorated throne room 128 | Obvious exits: South. 129 | I can also see: Sign says: leave treasure here, then say SCORE 130 | 131 | Tell me what to do ? drop coin 132 | O.K. 133 | Tell me what to do ? score 134 | I've stored 1 treasures. On a scale of 0 to 100, that rates 100. 135 | Well done. 136 | The game is now over. 137 | -------------------------------------------------------------------------------- /games/tutorial/Makefile: -------------------------------------------------------------------------------- 1 | ../../docs/tutorial.md: tutorial.source.md 2 | rm -f $@ 3 | m4 $< > $@ 4 | chmod ugo-w $@ 5 | 6 | -------------------------------------------------------------------------------- /games/tutorial/t1.map: -------------------------------------------------------------------------------- 1 | Chamber---------Dungeon 2 | -------------------------------------------------------------------------------- /games/tutorial/t1.sck: -------------------------------------------------------------------------------- 1 | room chamber "square chamber" 2 | exit east dungeon 3 | 4 | room dungeon "gloomy dungeon" 5 | exit west chamber 6 | -------------------------------------------------------------------------------- /games/tutorial/t2.map: -------------------------------------------------------------------------------- 1 | Chamber---------Dungeon 2 | [sign] | 3 | | 4 | | 5 | Cell 6 | [*coin*] 7 | -------------------------------------------------------------------------------- /games/tutorial/t2.sck: -------------------------------------------------------------------------------- 1 | room chamber "square chamber" 2 | exit east dungeon 3 | 4 | item sign "Sign says: leave treasure here, then say SCORE" 5 | 6 | room dungeon "gloomy dungeon" 7 | exit west chamber 8 | exit south cell 9 | 10 | room cell "dungeon cell" 11 | exit north dungeon 12 | 13 | item coin "*Gold coin*" 14 | called "coin" 15 | -------------------------------------------------------------------------------- /games/tutorial/t3.map: -------------------------------------------------------------------------------- 1 | Chamber---------Dungeon 2 | [sign, key] [door] 3 | = 4 | | 5 | Cell 6 | [*coin*] 7 | -------------------------------------------------------------------------------- /games/tutorial/t3.sck: -------------------------------------------------------------------------------- 1 | action score: score 2 | action inventory: inventory 3 | action look: look 4 | 5 | room chamber "square chamber" 6 | exit east dungeon 7 | 8 | item sign "Sign says: leave treasure here, then say SCORE" 9 | 10 | room dungeon "gloomy dungeon" 11 | exit west chamber 12 | 13 | item door "Locked door" 14 | 15 | room cell "dungeon cell" 16 | exit north dungeon 17 | 18 | item coin "*Gold coin*" 19 | called "coin" 20 | 21 | item key "Brass key" 22 | called "key" 23 | at chamber 24 | 25 | item door2 "Open door leads south" 26 | nowhere 27 | 28 | action open door when here door and !present key 29 | print "It's locked." 30 | 31 | action open door when here door 32 | swap door door2 33 | print OK 34 | look 35 | 36 | action go door when here door2 37 | goto cell 38 | look 39 | -------------------------------------------------------------------------------- /games/tutorial/t4.map: -------------------------------------------------------------------------------- 1 | Throne Room Crypt 2 | [sign] [vampire, key] 3 | | | 4 | | | 5 | Chamber---------Dungeon 6 | [cross] [door] 7 | = 8 | | 9 | Cell 10 | [*coin*] 11 | -------------------------------------------------------------------------------- /games/tutorial/t4.sck: -------------------------------------------------------------------------------- 1 | start dungeon 2 | treasury throne 3 | 4 | action score: score 5 | action inventory: inventory 6 | action look: look 7 | 8 | room throne "gorgeously decorated throne room" 9 | exit south chamber 10 | 11 | item sign "Sign says: leave treasure here, then say SCORE" 12 | 13 | room chamber "square chamber" 14 | exit east dungeon 15 | exit north throne 16 | 17 | item cross "Wooden cross" 18 | called "cross" 19 | 20 | room dungeon "gloomy dungeon" 21 | exit west chamber 22 | exit north crypt 23 | 24 | occur 25% when at dungeon 25 | print "I smell something rotting to the north." 26 | 27 | item door "Locked door" 28 | 29 | item key "Brass key" 30 | called "key" 31 | at crypt 32 | 33 | item door2 "Open door leads south" 34 | nowhere 35 | 36 | action open door when here door and !present key 37 | print "It's locked." 38 | 39 | action open door when here door 40 | swap door door2 41 | print OK 42 | look 43 | 44 | action go door when here door2 45 | goto cell 46 | look 47 | 48 | room cell "dungeon cell" 49 | exit north dungeon 50 | 51 | item coin "*Gold coin*" 52 | called "coin" 53 | 54 | room crypt "damp, dismal crypt" 55 | exit south dungeon 56 | 57 | item vampire "Vampire" 58 | 59 | occur when here vampire and carried cross 60 | print "Vampire cowers away from the cross!" 61 | 62 | occur when here vampire and !carried cross 63 | print "Vampire looks hungrily at me." 64 | 65 | occur 25% when here vampire and !carried cross 66 | print "Vampire bites me! I'm dead!" 67 | game_over 68 | comment "vampire can attack unless cross is carried" 69 | 70 | action get key when here vampire and !carried cross 71 | print "I'm not going anywhere near that vampire!" 72 | -------------------------------------------------------------------------------- /games/tutorial/t5.map: -------------------------------------------------------------------------------- 1 | Throne Room Crypt 2 | [sign, lamp] [vampire, key] 3 | | | 4 | | | 5 | Cave Mouth------Chamber---------Dungeon 6 | [station] [cross] [door] 7 | = 8 | | 9 | Cell 10 | [*coin*] 11 | -------------------------------------------------------------------------------- /games/tutorial/t5.sck: -------------------------------------------------------------------------------- 1 | start cave 2 | treasury throne 3 | 4 | action score: score 5 | action inventory: inventory 6 | action look: look 7 | 8 | occur when !flag 1 9 | print "Welcome to the Tutorial adventure." 10 | print "You must find a gold coin and store it." 11 | set_flag 1 12 | 13 | room cave "cave mouth" 14 | exit east chamber 15 | 16 | room throne "gorgeously decorated throne room" 17 | exit south chamber 18 | 19 | item sign "Sign says: leave treasure here, then say SCORE" 20 | 21 | item lamp "old-fashioned brass lamp" 22 | called "lamp" 23 | 24 | item lit_lamp "lit lamp" 25 | called "lamp" nowhere 26 | 27 | item empty_lamp "empty lamp" 28 | called "lamp" nowhere 29 | 30 | lightsource lit_lamp 31 | lighttime 10 32 | 33 | action light lamp when present lamp 34 | swap lamp lit_lamp 35 | print "OK, lamp is now lit and will burn for 10 turns." 36 | look 37 | 38 | occur when flag 16 39 | clear_flag 16 40 | swap lit_lamp empty_lamp 41 | look 42 | comment "The engine sets flag 16 when the lamp runs out" 43 | 44 | item station "lamp-refilling station" at cave 45 | 46 | action refill lamp when here station and present empty_lamp 47 | destroy empty_lamp 48 | refill_lamp 49 | print "The lamp is now full and lit." 50 | 51 | room chamber "square chamber" 52 | exit east dungeon 53 | exit north throne 54 | exit west cave 55 | 56 | # Flag 15 is on when and only when it is dark 57 | occur when at chamber and flag 15 58 | clear_dark 59 | look 60 | 61 | item cross "Wooden cross" 62 | called "cross" 63 | 64 | room dungeon "gloomy dungeon" 65 | exit west chamber 66 | exit north crypt 67 | 68 | occur when at dungeon and !flag 15 69 | set_dark 70 | look 71 | 72 | occur 25% when at dungeon 73 | print "I smell something rotting to the north." 74 | 75 | item door "Locked door" 76 | 77 | item key "Brass key" 78 | called "key" 79 | at crypt 80 | 81 | item door2 "Open door leads south" 82 | nowhere 83 | 84 | action open door when here door and !present key 85 | print "It's locked." 86 | 87 | action open door when here door 88 | swap door door2 89 | print OK 90 | look 91 | 92 | action go door when here door2 93 | goto cell 94 | look 95 | 96 | room cell "dungeon cell" 97 | exit north dungeon 98 | 99 | item coin "*Gold coin*" 100 | called "coin" 101 | 102 | room crypt "damp, dismal crypt" 103 | exit south dungeon 104 | 105 | item vampire "Vampire" 106 | 107 | occur when here vampire and carried cross 108 | print "Vampire cowers away from the cross!" 109 | 110 | occur when here vampire and !carried cross 111 | print "Vampire looks hungrily at me." 112 | 113 | occur 25% when here vampire and !carried cross 114 | print "Vampire bites me! I'm dead!" 115 | game_over 116 | comment "vampire can attack unless cross is carried" 117 | 118 | action get key when here vampire and !carried cross 119 | print "I'm not going anywhere near that vampire!" 120 | 121 | verbgroup get take g 122 | verbgroup drop leave 123 | noungroup lamp lantern 124 | -------------------------------------------------------------------------------- /games/tutorial/t6.map: -------------------------------------------------------------------------------- 1 | Throne Room Crypt 2 | [sign, lamp] [vampire, key] 3 | | | 4 | | | 5 | Cave Mouth------Chamber---------Dungeon 6 | [station] [cross] [door] 7 | = 8 | | 9 | Cell 10 | [*coin*] 11 | -------------------------------------------------------------------------------- /games/tutorial/t6.sck: -------------------------------------------------------------------------------- 1 | start cave 2 | treasury throne 3 | 4 | occur when !flag 1 5 | print "Welcome to the Tutorial adventure." 6 | print "You must find a gold coin and store it." 7 | set_flag 1 8 | 9 | room cave "cave mouth" 10 | exit east chamber 11 | 12 | room throne "gorgeously decorated throne room" 13 | exit south chamber 14 | 15 | item sign "sign" 16 | 17 | action examine sign when present sign 18 | print "It says: leave treasure here, then say SCORE" 19 | 20 | item lamp "old-fashioned brass lamp" 21 | called "lamp" 22 | 23 | action examine lamp when present lamp 24 | print "It is not lit." 25 | 26 | item lit_lamp "lit lamp" 27 | called "lamp" nowhere 28 | 29 | item empty_lamp "empty lamp" 30 | called "lamp" nowhere 31 | 32 | lightsource lit_lamp 33 | lighttime 10 34 | 35 | action light lamp when present lamp 36 | swap lamp lit_lamp 37 | print "OK, lamp is now lit and will burn for 10 turns." 38 | look 39 | 40 | occur when flag 16 41 | clear_flag 16 42 | swap lit_lamp empty_lamp 43 | look 44 | comment "The engine sets flag 16 when the lamp runs out" 45 | 46 | item station "lamp-refilling station" at cave 47 | 48 | action refill lamp when here station and present empty_lamp 49 | destroy empty_lamp 50 | refill_lamp 51 | print "The lamp is now full and lit." 52 | 53 | room chamber "square chamber" 54 | exit east dungeon 55 | exit north throne 56 | exit west cave 57 | 58 | # Flag 15 is on when and only when it is dark 59 | occur when at chamber and flag 15 60 | clear_dark 61 | look 62 | 63 | item cross "Wooden cross" 64 | called "cross" 65 | 66 | room dungeon "gloomy dungeon" 67 | exit west chamber 68 | exit north crypt 69 | 70 | occur when at dungeon and !flag 15 71 | set_dark 72 | look 73 | 74 | occur 25% when at dungeon 75 | print "I smell something rotting to the north." 76 | 77 | item door "Locked door" 78 | 79 | item key "Brass key" 80 | called "key" 81 | at crypt 82 | 83 | item door2 "Open door leads south" 84 | nowhere 85 | 86 | action open door when here door and !present key 87 | print "It's locked." 88 | 89 | action open door when here door 90 | swap door door2 91 | print OK 92 | look 93 | 94 | action go door when here door2 95 | goto cell 96 | look 97 | 98 | room cell "dungeon cell" 99 | exit north dungeon 100 | 101 | item coin "*Gold coin*" 102 | called "coin" 103 | 104 | room crypt "damp, dismal crypt" 105 | exit south dungeon 106 | 107 | item vampire "Vampire" 108 | 109 | occur when here vampire and carried cross 110 | print "Vampire cowers away from the cross!" 111 | 112 | occur when here vampire and !carried cross 113 | print "Vampire looks hungrily at me." 114 | 115 | occur 25% when here vampire and !carried cross 116 | print "Vampire bites me! I'm dead!" 117 | game_over 118 | comment "vampire can attack unless cross is carried" 119 | 120 | action get key when here vampire and !carried cross 121 | print "I'm not going anywhere near that vampire!" 122 | 123 | item rum "bottle of rum" called rum at cell 124 | 125 | action drink rum when carried rum 126 | destroy rum 127 | print "OK. I feel funny." 128 | 129 | action inventory when !exists rum 130 | print "I'm carrying ... uh ... you're my best mate, you are." 131 | 132 | action score: score 133 | action inventory: inventory 134 | action look: look 135 | action save game: save_game 136 | 137 | action quit game 138 | print "OK, goodbye." 139 | game_over 140 | action quit: 141 | print "Did you mean to quit? If so, type QUIT GAME." 142 | 143 | action examine: 144 | print "I see nothing special." 145 | 146 | verbgroup get take g 147 | verbgroup drop leave 148 | verbgroup examine x 149 | noungroup lamp lantern 150 | -------------------------------------------------------------------------------- /games/tutorial/t7.map: -------------------------------------------------------------------------------- 1 | Throne Room Crypt 2 | [sign, lamp] [vampire, key] 3 | | | 4 | | | 5 | Cave Mouth--||--Chamber---------Dungeon 6 | [doorbell, [cross] [door] 7 | (entrance), = 8 | station] | 9 | Cell 10 | [*coin*] 11 | -------------------------------------------------------------------------------- /games/tutorial/t7.sck: -------------------------------------------------------------------------------- 1 | start cave 2 | treasury throne 3 | 4 | occur when !flag 1 5 | print "Welcome to the Tutorial adventure." 6 | print "You must find a gold coin and store it." 7 | set_flag 1 8 | 9 | room cave "cave mouth" 10 | 11 | item doorbell "doorbell" 12 | 13 | item entrance "entrance to cave" 14 | nowhere 15 | 16 | action go entrance when here entrance 17 | goto chamber 18 | look 19 | 20 | action ring doorbell when here doorbell and !here entrance 21 | set_counter 4 22 | print "Ding dong!" 23 | 24 | occur 25 | dec_counter 26 | 27 | occur when counter_eq 2 28 | print "I hear an ominous rumble." 29 | 30 | occur when counter_eq 1 31 | put entrance cave 32 | print "The rocks collapse leaving a way in." 33 | look 34 | 35 | action wait: 36 | print "Time passes ..." 37 | 38 | room throne "gorgeously decorated throne room" 39 | exit south chamber 40 | 41 | item sign "sign" 42 | 43 | action examine sign when present sign 44 | print "It says: leave treasure here, then say SCORE" 45 | 46 | item lamp "old-fashioned brass lamp" 47 | called "lamp" 48 | 49 | action examine lamp when present lamp 50 | print "It is not lit." 51 | 52 | item lit_lamp "lit lamp" 53 | called "lamp" nowhere 54 | 55 | item empty_lamp "empty lamp" 56 | called "lamp" nowhere 57 | 58 | lightsource lit_lamp 59 | lighttime 10 60 | 61 | action light lamp when present lamp 62 | swap lamp lit_lamp 63 | print "OK, lamp is now lit and will burn for 10 turns." 64 | look 65 | 66 | occur when flag 16 67 | clear_flag 16 68 | swap lit_lamp empty_lamp 69 | look 70 | comment "The engine sets flag 16 when the lamp runs out" 71 | 72 | item station "lamp-refilling station" at cave 73 | 74 | action refill lamp when here station and present empty_lamp 75 | destroy empty_lamp 76 | refill_lamp 77 | print "The lamp is now full and lit." 78 | 79 | room chamber "square chamber" 80 | exit east dungeon 81 | exit north throne 82 | exit west cave 83 | 84 | # Flag 15 is on when and only when it is dark 85 | occur when at chamber and flag 15 86 | clear_dark 87 | look 88 | 89 | item cross "Wooden cross" 90 | called "cross" 91 | 92 | room dungeon "gloomy dungeon" 93 | exit west chamber 94 | exit north crypt 95 | 96 | occur when at dungeon and !flag 15 97 | set_dark 98 | look 99 | 100 | occur 25% when at dungeon 101 | print "I smell something rotting to the north." 102 | 103 | item door "Locked door" 104 | 105 | item key "Brass key" 106 | called "key" 107 | at crypt 108 | 109 | item door2 "Open door leads south" 110 | nowhere 111 | 112 | action open door when here door and !present key 113 | print "It's locked." 114 | 115 | action open door when here door 116 | swap door door2 117 | print OK 118 | look 119 | 120 | action go door when here door2 121 | goto cell 122 | look 123 | 124 | room cell "dungeon cell" 125 | exit north dungeon 126 | 127 | item coin "*Gold coin*" 128 | called "coin" 129 | 130 | room crypt "damp, dismal crypt" 131 | exit south dungeon 132 | 133 | item vampire "Vampire" 134 | 135 | occur when here vampire and carried cross 136 | print "Vampire cowers away from the cross!" 137 | 138 | occur when here vampire and !carried cross 139 | print "Vampire looks hungrily at me." 140 | 141 | occur 25% when here vampire and !carried cross 142 | print "Vampire bites me! I'm dead!" 143 | game_over 144 | comment "vampire can attack unless cross is carried" 145 | 146 | action get key when here vampire and !carried cross 147 | print "I'm not going anywhere near that vampire!" 148 | 149 | item rum "bottle of rum" called rum at cell 150 | 151 | action drink rum when carried rum 152 | destroy rum 153 | print "OK. I feel funny." 154 | 155 | action inventory when !exists rum 156 | print "I'm carrying ... uh ... you're my best mate, you are." 157 | 158 | action score: score 159 | action inventory: inventory 160 | action look: look 161 | action save game: save_game 162 | 163 | action quit game 164 | print "OK, goodbye." 165 | game_over 166 | action quit: 167 | print "Did you mean to quit? If so, type QUIT GAME." 168 | 169 | action examine: 170 | print "I see nothing special." 171 | 172 | verbgroup get take g 173 | verbgroup drop leave 174 | verbgroup examine x 175 | noungroup lamp lantern 176 | noungroup doorbell bell 177 | -------------------------------------------------------------------------------- /games/tutorial/tutorial.source.md: -------------------------------------------------------------------------------- 1 | changequote(`[[[', `]]]')dnl 2 | # ScottKit Tutorial 3 | 4 | 5 | * [Introduction](#introduction) 6 | * [Stage 1](#stage-1) 7 | * [Stage 1 map](#stage-1-map) 8 | * [Stage 1 source](#stage-1-source) 9 | * [Stage 2](#stage-2) 10 | * [Stage 2 map](#stage-2-map) 11 | * [Stage 2 source](#stage-2-source) 12 | * [Stage 3](#stage-3) 13 | * [Stage 3 map](#stage-3-map) 14 | * [Stage 3 source](#stage-3-source) 15 | * [Stage 4](#stage-4) 16 | * [Stage 4 map](#stage-4-map) 17 | * [Stage 4 source](#stage-4-source) 18 | * [Stage 5](#stage-5) 19 | * [Stage 5 map](#stage-5-map) 20 | * [Stage 5 source](#stage-5-source) 21 | * [Stage 6](#stage-6) 22 | * [Stage 6 map](#stage-6-map) 23 | * [Stage 6 source](#stage-6-source) 24 | * [Stage 7](#stage-7) 25 | * [Stage 7 map](#stage-7-map) 26 | * [Stage 7 source](#stage-7-source) 27 | * [Caveats](#caveats) 28 | 29 | 30 | ## Introduction 31 | 32 | This document walks you through the process of creating a small but complete and playable game with six rooms, seven items including a single treasure, and a couple of puzzles. It makes no attempt to be complete: you need the reference manual for that. But by the time you've worked your way through this tutorial you should be familiar with rooms, items, actions and occurrences, and you'll be ready to start writing your own games. 33 | 34 | 35 | ## Stage 1 36 | 37 | This is the minimal playable game, consisting of rooms only - and only two of them. 38 | 39 | This stage is built entirely using the `%room` and `%exit` directives. 40 | 41 | ### Stage 1 map 42 | 43 | ``` 44 | 45 | include(t1.map)dnl 46 | 47 | ``` 48 | 49 | ### Stage 1 source 50 | 51 | ``` 52 | include(t1.sck)dnl 53 | ``` 54 | 55 | 56 | ## Stage 2 57 | 58 | This stage introduces the first items: one portable (the coin) and one not (the sign). 59 | 60 | This stage uses the directives from the previous stage, plus `item` and `called`. 61 | 62 | ### Stage 2 map 63 | 64 | ``` 65 | 66 | include(t2.map)dnl 67 | 68 | ``` 69 | 70 | ### Stage 2 source 71 | 72 | ``` 73 | include(t2.sck)dnl 74 | ``` 75 | 76 | 77 | ## Stage 3 78 | 79 | Here we introduce the first explicitly-coded actions - the previous stages' movement between locations and ability to pick up and drop items are "intrinsics" provided by the interpreter. 80 | 81 | The new action provides the first puzzle: the player needs to unlock the cell door before entering the cell to obtain the coin. The key is necessary in order to open the door. 82 | 83 | This stage uses the directives from the previous stage, plus `nowhere`, `at`, `action` and `result`. 84 | 85 | ### Stage 3 map 86 | 87 | ``` 88 | 89 | include(t3.map)dnl 90 | 91 | ``` 92 | 93 | ### Stage 3 source 94 | 95 | ``` 96 | include(t3.sck)dnl 97 | ``` 98 | 99 | 100 | ## Stage 4 101 | 102 | This stage introduces automatic actions, or "occurrences", which occur without the player needing to do anything. In effect, they happen _to_ him rather than being done _by_ him. 103 | 104 | It also uses inline documentation in the form of an action comment (though why you'd want to do this is beyond me) and specifies the start and treasury rooms explicitly. 105 | 106 | This stage uses the directives from the previous stage, plus `occur`, `comment`, `start` and `treasury`. 107 | 108 | ### Stage 4 map 109 | 110 | ``` 111 | 112 | include(t4.map)dnl 113 | 114 | ``` 115 | 116 | ### Stage 4 source 117 | 118 | ``` 119 | include(t4.sck)dnl 120 | ``` 121 | 122 | 123 | ## Stage 5 124 | 125 | This stage adds a light source (and darkness), a random occurrence and aliases for both verbs and nouns. 126 | 127 | This stage uses the directives from the previous stage, plus `lightsource`, `occur` with an argument, `verbgroup` and `noungroup`. 128 | 129 | ### Stage 5 map 130 | 131 | ``` 132 | 133 | include(t5.map)dnl 134 | 135 | ``` 136 | 137 | ### Stage 5 source 138 | 139 | ``` 140 | include(t5.sck)dnl 141 | ``` 142 | 143 | 144 | ## Stage 6 145 | 146 | This stage adds standard boilerplate actions for `save game`, `quit game` and `examine`; is uses `examine` for several objects (and so makes the sign description less verbose), and shows how to override the standard behaviour of a verb (`inventory`) under unusual circumstances. 147 | 148 | This stage uses the same directives as the previous stage (and has the same map as that stage). 149 | 150 | ### Stage 6 map 151 | 152 | ``` 153 | 154 | include(t6.map)dnl 155 | 156 | ``` 157 | 158 | ### Stage 6 source 159 | 160 | ``` 161 | include(t6.sck)dnl 162 | ``` 163 | 164 | 165 | ## Stage 7 166 | 167 | This stage uses a counter to implement a timed event: there is initially no way into the main complex, but ringing the doorbell in the first location starts a timer that results in a cave-in, and an entrance becoming available. 168 | 169 | This stage uses the same directives as the previous stage (and has a very similar map to that stage). 170 | 171 | ### Stage 7 map 172 | 173 | ``` 174 | 175 | include(t7.map)dnl 176 | 177 | ``` 178 | 179 | ### Stage 7 source 180 | 181 | ``` 182 | include(t7.sck)dnl 183 | ``` 184 | 185 | 186 | ## Caveats 187 | 188 | This tutorial skips a lot of details. [The reference manual](../../docs/reference.md) is indispensible for filling in the gaps. 189 | 190 | The following directives are not yet discussed: `ident`, `version`, `wordlen`, `maxload`, `lighttime`. 191 | 192 | There is not yet any discussion of flags, counters and location stores. 193 | 194 | Some discussion of what makes a good game design may be appropriate. 195 | 196 | -------------------------------------------------------------------------------- /lib/scottkit/decompile.rb: -------------------------------------------------------------------------------- 1 | module ScottKit 2 | class Game 3 | private 4 | 5 | def quote(token) #:nodoc: 6 | if ((token !~ /^([!a-z_0-9-]+)$/i || token =~ /\n/) || 7 | Compiler::Lexer::TOKENMAP[token]) 8 | "\"#{token.gsub('"', '\'')}\"" 9 | else 10 | token 11 | end 12 | end 13 | 14 | def decompile(f) 15 | f << "# #{@rooms.size} rooms, " 16 | f << "#{@items.size} items, " 17 | f << "#{@actions.size} actions\n" 18 | f << "# #{@messages.size} messages, " 19 | f << "#{defined?(@ntreasures) ? @ntreasures : "UNDEFINED"} treasures, " 20 | f << "#{@verbs.size} verbs/nouns\n" 21 | f.puts "ident #{@id}" if defined? @id 22 | f.puts "version #{@version}" if defined? @version 23 | f.puts "wordlen #{@wordlen}" if defined? @wordlen 24 | f.puts "maxload #{@maxload}" if defined? @maxload 25 | f.puts "lighttime #{@lamptime}" if defined? @lamptime 26 | f.puts "unknown1 #{@unknown1}" if defined? @unknown1 27 | f.puts "unknown2 #{@unknown2}" if defined? @unknown2 28 | f.puts "start #{quote roomname @startloc}" if defined? @startloc 29 | ### Do NOT change the nested if's to a single &&ed one: for 30 | # reasons that I do not at all understand, doing so results in 31 | # the protected statement being executed when @treasury is 0 32 | if defined? @treasury 33 | if @treasury != 0 34 | f.puts "treasury #{quote roomname @treasury}" 35 | end 36 | end 37 | f.puts 38 | decompile_wordgroup(f, @verbs, "verb") 39 | decompile_wordgroup(f, @nouns, "noun") 40 | 41 | @rooms.each.with_index do |room, i| 42 | next if i == 0 43 | f.puts "room " << quote(roomname(i)) << " \"#{room.desc}\"" 44 | room.exits.each.with_index do |exit, j| 45 | if exit != 0 46 | f.puts "\texit #{dirname(j)} #{quote roomname(exit)}" 47 | end 48 | end 49 | f.puts 50 | end 51 | 52 | @items.each.with_index do |item, i| 53 | f.puts "item #{quote itemname(i)} \"#{item.desc}\"" 54 | f.puts "\tcalled #{quote item.name}" if item.name 55 | f.puts case item.startloc 56 | when ROOM_CARRIED then "\tcarried" 57 | when ROOM_NOWHERE then "\tnowhere" 58 | else "\tat #{quote roomname(item.startloc)}" 59 | end 60 | f.puts 61 | end 62 | 63 | @actions.each { |action| action.decompile(f) } 64 | end 65 | 66 | def decompile_wordgroup(f, list, label) 67 | canonical = nil 68 | synonyms = [] 69 | printed = false 70 | 71 | list.each.with_index do |word, i| 72 | if (word =~ /^\*/) 73 | synonyms << word.sub(/^\*/, "") 74 | end 75 | if (word !~ /^\*/ || i == list.size-1) 76 | if synonyms.size > 0 77 | f.print "#{label}group #{quote canonical} " 78 | f.puts synonyms.map { |token| quote token }.join(" ") 79 | printed = true 80 | end 81 | canonical = word 82 | synonyms = [] 83 | end 84 | end 85 | 86 | f.puts if printed 87 | end 88 | 89 | public :decompile # Must be visible to driver program 90 | public :quote # Needed for contained classes' decompile()/render() methods 91 | 92 | 93 | class Action 94 | def quote(*args); @game.quote(*args); end 95 | 96 | def decompile(f) 97 | emitted_noun_or_condition = false 98 | if self.verb == 0 then 99 | f << "occur" 100 | f << " " << self.noun << "%" if self.noun != 100 101 | else 102 | f << "action #{quote @game.verbs[self.verb]}" 103 | if self.noun != 0 104 | f << " #{quote @game.nouns[self.noun]}" 105 | emitted_noun_or_condition = true 106 | end 107 | end 108 | self.conds.each.with_index do |cond, i| 109 | f << (i == 0 ? " when " : " and ") << cond.render 110 | emitted_noun_or_condition = true 111 | end 112 | f << ":" if self.verb != 0 && !emitted_noun_or_condition 113 | f.puts 114 | args = @args.clone 115 | self.instructions.each do |instruction| 116 | f.puts "\t" + instruction.render(args) 117 | end 118 | if (self.comment != "") 119 | f.puts "\tcomment \"#{self.comment}\"" 120 | end 121 | f.puts 122 | end 123 | end 124 | 125 | class Condition 126 | def quote(*args); @game.quote(*args); end 127 | 128 | def render 129 | type = OPS[@cond][1] 130 | res = OPS[@cond][0] 131 | res += " " + 132 | quote(type == :room ? @game.roomname(@value) : 133 | type == :item ? @game.itemname(@value) : 134 | type == :number ? String(@value) : "ERROR") if 135 | type != :NONE 136 | res 137 | end 138 | end 139 | 140 | class Instruction 141 | def quote(*args); @game.quote(*args); end 142 | 143 | def render(args) 144 | if (@op == 0) 145 | return "NOP" # shouldn't happen 146 | elsif (@op <= 51) 147 | return "print #{quote @game.messages[@op]}" 148 | elsif (@op >= 102) 149 | return "print #{quote @game.messages[@op-50]}" 150 | end 151 | 152 | op = OPS[@op-52] 153 | return "UNKNOWN_OP" if !op 154 | op[0] + case op[1] 155 | when :item 156 | " #{quote @game.itemname(args.shift)}" 157 | when :room 158 | " #{quote @game.roomname(args.shift)}" 159 | when :number 160 | " #{@game.quote String(args.shift)}" 161 | when :item_item 162 | " #{quote @game.itemname(args.shift)}" + 163 | " #{quote @game.itemname(args.shift)}" 164 | when :item_room 165 | " #{quote @game.itemname(args.shift)}" + 166 | " #{quote @game.roomname(args.shift)}" 167 | when :NONE 168 | "" # Nothing to add 169 | else 170 | " UNKNOWN_PARAM" 171 | end 172 | end 173 | end 174 | end 175 | end 176 | -------------------------------------------------------------------------------- /lib/scottkit/withio.rb: -------------------------------------------------------------------------------- 1 | # Provides a utility method withIO() used by several test-cases. Runs 2 | # the specified block with stdin and stdout replumbed to the provided 3 | # file-handles; the old values of stdin and stdout are passed to the 4 | # block, in case they should be needed. 5 | 6 | def withIO(newin, newout) 7 | old_STDIN = $stdin 8 | old_STDOUT = $stdout 9 | $stdin = newin 10 | $stdout = newout 11 | yield old_STDIN, old_STDOUT 12 | ensure 13 | $stdin = old_STDIN 14 | $stdout = old_STDOUT 15 | end 16 | -------------------------------------------------------------------------------- /scottkit.gemspec: -------------------------------------------------------------------------------- 1 | # Generated by jeweler 2 | # DO NOT EDIT THIS FILE DIRECTLY 3 | # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec' 4 | # -*- encoding: utf-8 -*- 5 | # stub: scottkit 1.6.0 ruby lib 6 | 7 | Gem::Specification.new do |s| 8 | s.name = "scottkit".freeze 9 | s.version = "1.6.0" 10 | 11 | s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version= 12 | s.require_paths = ["lib".freeze] 13 | s.authors = ["Mike Taylor".freeze] 14 | s.date = "2017-10-24" 15 | s.description = "ScottKit is a toolkit for compiling, decompiling and playing adventure games in the Scott Adams format.".freeze 16 | s.email = "mike@miketaylor.org.uk".freeze 17 | s.executables = ["md5ruby".freeze, "scottkit".freeze] 18 | s.extra_rdoc_files = [ 19 | "ChangeLog.md", 20 | "README.md" 21 | ] 22 | s.files = [ 23 | ".travis.yml", 24 | ".yardopts", 25 | "ChangeLog.md", 26 | "GPL-2.txt", 27 | "Gemfile", 28 | "README.md", 29 | "Rakefile", 30 | "VERSION", 31 | "bin/md5ruby", 32 | "bin/scottkit", 33 | "docs/notes/Definition-saved-game.txt", 34 | "docs/notes/Definition-scottfree-1.14.txt", 35 | "docs/notes/Definition.txt", 36 | "docs/notes/adventureland-maze", 37 | "docs/notes/continue-action", 38 | "docs/reference.md", 39 | "docs/tutorial.md", 40 | "games/.gitignore", 41 | "games/adams/.gitignore", 42 | "games/adams/AdamsGames.zip", 43 | "games/adams/Makefile", 44 | "games/crystal/crystal.map", 45 | "games/crystal/crystal.sck", 46 | "games/crystal/crystal.solution", 47 | "games/dan-and-matt/dan-and-matt.sck", 48 | "games/dan-and-matt/dan-and-matt.solution", 49 | "games/howarth/.gitignore", 50 | "games/howarth/Makefile", 51 | "games/howarth/mysterious.tar.gz", 52 | "games/nosferatu/.gitignore", 53 | "games/nosferatu/Makefile", 54 | "games/nosferatu/README", 55 | "games/nosferatu/TODO", 56 | "games/nosferatu/nosferatu.map", 57 | "games/nosferatu/nosferatu.regression", 58 | "games/nosferatu/nosferatu.sck", 59 | "games/nosferatu/nosferatu.sol", 60 | "games/nosferatu/nosferatu.transcript", 61 | "games/test/Makefile", 62 | "games/test/adams/Makefile", 63 | "games/test/adams/adv01.solution", 64 | "games/test/adams/adv01.transcript", 65 | "games/test/adams/adv01.transcript.md5", 66 | "games/test/adams/adv02.solution", 67 | "games/test/adams/adv02.transcript", 68 | "games/test/adams/adv02.transcript.md5", 69 | "games/test/adams/adv04.solution", 70 | "games/test/adams/adv04.transcript", 71 | "games/test/adams/adv04.transcript.md5", 72 | "games/test/crystal.decompile", 73 | "games/test/crystal.sao", 74 | "games/test/crystal.save-file", 75 | "games/test/crystal.save-script", 76 | "games/test/crystal.sck", 77 | "games/test/crystal.solution", 78 | "games/test/crystal.transcript", 79 | "games/test/t6.pretty-print", 80 | "games/test/t6.sck", 81 | "games/test/t7.sao", 82 | "games/test/t7.solution", 83 | "games/test/t7.transcript", 84 | "games/tutorial/Makefile", 85 | "games/tutorial/t1.map", 86 | "games/tutorial/t1.sck", 87 | "games/tutorial/t2.map", 88 | "games/tutorial/t2.sck", 89 | "games/tutorial/t3.map", 90 | "games/tutorial/t3.sck", 91 | "games/tutorial/t4.map", 92 | "games/tutorial/t4.sck", 93 | "games/tutorial/t5.map", 94 | "games/tutorial/t5.sck", 95 | "games/tutorial/t6.sck", 96 | "games/tutorial/t7.sck", 97 | "games/tutorial/tutorial.source.md", 98 | "lib/scottkit/compile.rb", 99 | "lib/scottkit/decompile.rb", 100 | "lib/scottkit/game.rb", 101 | "lib/scottkit/play.rb", 102 | "lib/scottkit/withio.rb", 103 | "scottkit.gemspec", 104 | "test/test_canonicalise.rb", 105 | "test/test_compile.rb", 106 | "test/test_decompile.rb", 107 | "test/test_play.rb", 108 | "test/test_playadams.rb", 109 | "test/test_save.rb", 110 | "test/withio_test.rb" 111 | ] 112 | s.homepage = "http://github.com/MikeTaylor/scottkit".freeze 113 | s.licenses = ["GPL-2.0".freeze] 114 | s.rubygems_version = "2.6.11".freeze 115 | s.summary = "Toolkit for Scott Adams-format adventure games".freeze 116 | 117 | if s.respond_to? :specification_version then 118 | s.specification_version = 4 119 | 120 | if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then 121 | s.add_runtime_dependency(%q.freeze, ["~> 12.0"]) 122 | s.add_runtime_dependency(%q.freeze, ["~> 2.0"]) 123 | s.add_runtime_dependency(%q.freeze, ["~> 3.2.0"]) 124 | else 125 | s.add_dependency(%q.freeze, ["~> 12.0"]) 126 | s.add_dependency(%q.freeze, ["~> 2.0"]) 127 | s.add_dependency(%q.freeze, ["~> 3.2.0"]) 128 | end 129 | else 130 | s.add_dependency(%q.freeze, ["~> 12.0"]) 131 | s.add_dependency(%q.freeze, ["~> 2.0"]) 132 | s.add_dependency(%q.freeze, ["~> 3.2.0"]) 133 | end 134 | end 135 | 136 | -------------------------------------------------------------------------------- /test/test_canonicalise.rb: -------------------------------------------------------------------------------- 1 | require 'test/unit' 2 | require 'scottkit/game' 3 | require 'stringio' 4 | require 'scottkit/withio' 5 | 6 | # The idea here is that we can start with a source file and compile it 7 | # once. Decompiling the result will of course yield a different 8 | # source file (for example, comments will be discarded) but 9 | # recompiling the decompiled source should yield identical output to 10 | # that generated by the initial compilation. 11 | 12 | class TestCanonicalise < Test::Unit::TestCase #:nodoc: 13 | def test_1canonicalise_tutorials 14 | 1.upto(7) { |i| canonicalise("tutorial/t#{i}.sck", :source) } 15 | end 16 | 17 | def test_2canonicalise_crystal 18 | canonicalise("crystal/crystal.sck", :source) 19 | end 20 | 21 | def test_3canonicalise_adams 22 | %w{ 23 | adv01 24 | adv02 25 | adv03 26 | adv04 27 | adv05 28 | adv06 29 | adv07 30 | adv08 31 | adv09 32 | adv10 33 | adv11 34 | adv12 35 | adv13 36 | adv14a 37 | *adv14b 38 | quest1 39 | quest2 40 | sampler1 41 | }.each do |x| 42 | options = {} 43 | if x[0] == "*" 44 | x[0] = "" 45 | options[:bug_tolerant] = true 46 | end 47 | canonicalise("adams/#{x}.dat", :object, options) 48 | end 49 | end 50 | 51 | def canonicalise(name, type, options = {}) 52 | #puts "#{name}: options=#{options}" 53 | filename = "games/#{name}" 54 | 55 | if !File::readable?(filename) 56 | if self.respond_to? :skip 57 | skip "no game file #{filename}" 58 | else 59 | # Crappy older version of Test::Unit 60 | puts "skipping '#{name}' because no filename" 61 | end 62 | return 63 | end 64 | 65 | if type == :source 66 | source1 = IO.read(filename) 67 | else 68 | object0 = IO.read(filename) 69 | source1 = decompile(object0, options) 70 | end 71 | object1 = compile(source1, options) 72 | source2 = decompile(object1, options) 73 | object2 = compile(source2, options) 74 | assert_equal(object2, object1) 75 | end 76 | 77 | def compile(source, options) 78 | game = ScottKit::Game.new(options) 79 | f = StringIO.new 80 | withIO(nil, f) do 81 | game.compile_to_stdout(nil, StringIO.new(source)) or 82 | raise "couldn't compile" 83 | end 84 | f.string 85 | end 86 | 87 | def decompile(object, options) 88 | game = ScottKit::Game.new(options) 89 | game.load(object) 90 | f = StringIO.new() 91 | game.decompile(f) 92 | f.string 93 | end 94 | end 95 | -------------------------------------------------------------------------------- /test/test_compile.rb: -------------------------------------------------------------------------------- 1 | require 'test/unit' 2 | require 'scottkit/game' 3 | require 'stringio' 4 | require 'scottkit/withio' 5 | 6 | class TestCompile < Test::Unit::TestCase #:nodoc: 7 | EXPECTED = [ 8 | # Token, Lexeme 9 | [ :room ], 10 | [ :symbol, "chamber" ], 11 | [ :symbol, "square chamber" ], 12 | [ :exit ], 13 | [ :direction, "east" ], 14 | [ :symbol, "dungeon" ], 15 | [ :room ], 16 | [ :symbol, "dungeon" ], 17 | [ :symbol, "gloomy dungeon" ], 18 | [ :exit ], 19 | [ :direction, "west" ], 20 | [ :symbol, "chamber" ], 21 | [ :eof ], 22 | ]; 23 | 24 | def test_lexer 25 | game = ScottKit::Game.new({}) 26 | lexer = ScottKit::Game::Compiler::Lexer.new(game, "games/tutorial/t1.sck") 27 | EXPECTED.each do |x| token, lexeme = *x 28 | got = lexer.lex 29 | assert_equal(token, got) 30 | assert_equal(lexeme, lexer.lexeme) if lexeme 31 | end 32 | end 33 | 34 | def test_parser 35 | game = ScottKit::Game.new({}) 36 | # It's a clumsy API, but then we're peeking where we're not invited 37 | compiler = ScottKit::Game::Compiler.new(game, "games/test/t6.sck") 38 | tree = compiler.parse 39 | got = tree.pretty_inspect 40 | expected = File.read("games/test/t6.pretty-print") 41 | # Remove hex object addresses from pretty-printed trees 42 | assert_equal(got.gsub(/0x\h+/, ""), expected.gsub(/0x\h+/, "")) 43 | end 44 | 45 | def test_code_generator 46 | game = ScottKit::Game.new({}) 47 | f = StringIO.new 48 | withIO(nil, f) do 49 | game.compile_to_stdout("games/test/crystal.sck") or 50 | raise "couldn't compile crystal.sck" 51 | end 52 | assert_equal(f.string, File.read("games/test/crystal.sao")) 53 | end 54 | end 55 | -------------------------------------------------------------------------------- /test/test_decompile.rb: -------------------------------------------------------------------------------- 1 | require 'test/unit' 2 | require 'scottkit/game' 3 | require 'stringio' 4 | 5 | class TestDecompile < Test::Unit::TestCase #:nodoc: 6 | def test_decompile_crystal 7 | game = ScottKit::Game.new({}) 8 | game.load(IO.read("games/test/crystal.sao")) 9 | f = StringIO.new() 10 | game.decompile(f) 11 | assert_equal(f.string, File.read("games/test/crystal.decompile")) 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /test/test_play.rb: -------------------------------------------------------------------------------- 1 | require 'test/unit' 2 | require 'scottkit/game' 3 | require 'stringio' 4 | require 'scottkit/withio' 5 | 6 | class TestPlay < Test::Unit::TestCase #:nodoc: 7 | def test_play_tutorial7; play("t7"); end 8 | def test_play_crystal; play("crystal"); end 9 | 10 | def play(name) 11 | game = ScottKit::Game.new({ :read_file => 12 | "games/test/#{name}.solution", 13 | :random_seed => 12368, :no_wait => true }) 14 | game.load(IO.read("games/test/#{name}.sao")) 15 | f = StringIO.new 16 | withIO(nil, f) { game.play } 17 | expected = File.read("games/test/#{name}.transcript") 18 | assert_equal(expected, f.string) 19 | end 20 | end 21 | -------------------------------------------------------------------------------- /test/test_playadams.rb: -------------------------------------------------------------------------------- 1 | require 'test/unit' 2 | require 'scottkit/game' 3 | require 'stringio' 4 | require 'digest/md5' 5 | require 'scottkit/withio' 6 | 7 | class TestPlayAdams < Test::Unit::TestCase #:nodoc: 8 | def test_play_adams 9 | %w{01 04}.each do |num| 10 | play("adv#{num}") 11 | end 12 | end 13 | 14 | def play(name) 15 | gamefile = "games/adams/#{name}.dat" 16 | 17 | if(File::readable?(gamefile)) 18 | game = ScottKit::Game.new({ :read_file => 19 | "games/test/adams/#{name}.solution", 20 | :random_seed => 12368, :no_wait => true }) 21 | game.load(IO.read gamefile) 22 | f = StringIO.new 23 | withIO(nil, f) { game.play } 24 | digest = Digest::MD5.hexdigest(f.string) 25 | expected = File.read("games/test/adams/#{name}.transcript.md5").chomp 26 | assert_equal(expected, digest) 27 | else 28 | if self.respond_to? :skip 29 | skip "no game file #{gamefile}" 30 | else 31 | # Crappy older version of Test::Unit 32 | puts "skipping '#{name}' because no gamefile" 33 | end 34 | end 35 | end 36 | end 37 | -------------------------------------------------------------------------------- /test/test_save.rb: -------------------------------------------------------------------------------- 1 | require 'test/unit' 2 | require 'scottkit/game' 3 | require 'stringio' 4 | require 'scottkit/withio' 5 | 6 | class TestSave < Test::Unit::TestCase #:nodoc: 7 | # Can't use a setup() method here as the two test-cases need the 8 | # games to be initialised with different options. 9 | 10 | def test_save_crystal 11 | game = ScottKit::Game.new({ :random_seed => 12368, :echo_input => true }) 12 | game.load(IO.read("games/test/crystal.sao")) 13 | withIO(File.new("games/test/crystal.save-script"), 14 | File.new("/dev/null", "w")) do 15 | game.play() 16 | end 17 | assert_equal(File.read("TMP"), File.read("games/test/crystal.save-file")) 18 | File.unlink "TMP" 19 | end 20 | 21 | def test_resave_crystal 22 | game = ScottKit::Game.new({ :random_seed => 12368, :echo_input => true, 23 | :restore_file => "games/test/crystal.save-file" }) 24 | game.load(IO.read("games/test/crystal.sao")) 25 | withIO(StringIO.new("save game\nTMP"), File.new("/dev/null", "w")) do 26 | game.play() 27 | end 28 | assert_equal(File.read("TMP"), File.read("games/test/crystal.save-file")) 29 | File.unlink "TMP" 30 | end 31 | end 32 | -------------------------------------------------------------------------------- /test/withio_test.rb: -------------------------------------------------------------------------------- 1 | #!/usr/local/bin/ruby -w 2 | 3 | # Run as: echo Bart Lisa | ./withio_test.rb && echo == && cat /tmp/xcv 4 | # Expecting the output: 5 | # first line is 'Bart Lisa' 6 | # saved line 'Eric' 7 | # died in withIO: divided by 0 8 | # saved line was 'Eric' 9 | # == 10 | # first line was 'Bart Lisa' 11 | # oldout is of class IO 12 | 13 | require 'stringio' 14 | require 'scottkit/withio' 15 | 16 | saved = nil 17 | begin 18 | line = gets 19 | puts "first line is '#{line.chomp}'" 20 | withIO(StringIO.new("Eric\nthe"), File.new("/tmp/xcv", "w")) do 21 | |oldin, oldout| 22 | puts "first line was '#{line.chomp}'" 23 | puts "oldout is of class #{oldout.class}" 24 | saved = gets 25 | oldout.puts "saved line '#{saved.chomp}'" 26 | puts 1/0 27 | end 28 | rescue Exception => e 29 | puts "died in withIO: #{e}" 30 | end 31 | puts "saved line was '#{saved.chomp}'" 32 | --------------------------------------------------------------------------------