Welcome to the Program Small Home Page!

Welcome to program "Small", a demonstration of the Ada 95 programming language. Program "Small" implements a small text adventure game. This version of Small supports these commands:

You can see a sample run of program "Small".

Program Small is a part of the Lovelace Ada tutorial. You can access the master copy of Lovelace through the Web. You can read a more detailed description of how program Small was developed, including design rationale and a description of the general process used to develop it, as lesson 18 in Lovelace. You can access the master copy of lesson 18 through the Web.

Below is a brief description of program small, with hypertext links to the various compilation units in program Small. The compilation units have a large number of hypertext links between each other, making it easier to follow the program (these links were generated by my program ada2html).


The Design of Small

[Object Hierarchy] WIDTH=151 HEIGHT=87 Program Small has a number of different packages that implement different types. At the heart of program Small is a set of types that implements the interesting "things" in the simulated world. To the right is a graphic showing the object-oriented hierarchy of the various types. All things in the simulated world are a "Thing"; a Thing can be a Room or an Occupant, an Occupant can be an Item or a Creature, and a Creature can be a Player or a Monster. Each of these types is contained in an Ada package with the plural name (type Thing is defined in package Things, etc.).

Program Small is implemented as the following program units:

All of the compilation units above can be selected; useful starting points include:

A shorter, simple list of these compilation units is also available.

How to Start Experimenting with Small

You can versions of program "Small" for your experimentation in many ways:

How to Compile Small

If you're using GNAT, it's easiest to compile using "gnatmake", which will automatically figure out what needs compiling and in what order, then compile the files for you. You have two choices in this case: using short filenames or long filenames:

  1. The "zip" files the filenames are all "krunched" down to 8 character filenames per MS-DOS and ISO CD-ROM requirements. Here's the GNAT incantation to tell your system to use 8-character limits:
          gnatmake small -cargs -gnatk8 -largs -gnatk8
    

  2. If you're using GNAT but want to use long filenames (and your operating system supports them!), use the file "small.txt" (which puts all the source code in one file) and expand that file with the command:
          gnatchop small.txt
    
    Now you'll have a bunch of files with long names. You can then compile the files with:
          gnatmake small
    

Version and Legal Information

This is version 1.5 of "Small", which notes the change in location of "HBAP" to its new URL, "http://www.adahome.com/". Version 1.4 of "Small" fixed a small bug in the Parser (in file parser.adb line 28) and deleted a misleading comment in the specification for Occupant (in file occupant.ads line 36). Version 1.3 of "Small" added some documentation on how to compile Small. Version 1.2 of "Small" added the copyright statements for the ARA and made two small corrections in the body of package Rooms. Version 1.1 changed ada2html's location, so all Small hypertext pages were regenerated.

You are free to copy and modify program Small as you see fit, and you can use Small in any way you want, commercial or not. However, please give me credit for writing the original if you do anything with Small; I think you'll agree that's a reasonable request. Small was the first winner of the Ada Resource Association (ARA)'s Ada Lovelace programming contest. Small was submitted to the ARA as a December 15, 1995 entry. On request of the ARA, the following text was placed in each file:

--
-- Copyright (C) 1996 Ada Resource Association (ARA), Columbus, Ohio.
-- Author: David A. Wheeler
--

--
-- Permission to use, copy, modify, and distribute this software and its
-- documentation for any purpose and without fee is hereby granted,
-- provided that the above copyright and authorship notice appear in all
-- copies and that both that copyright notice and this permission notice
-- appear in supporting documentation.
-- 
-- The ARA makes no representations about the suitability of this software
-- for any purpose.  It is provided "as is" without express
-- or implied warranty.
-- 

David A. Wheeler (dwheeler@dwheeler.com)