Added the 'Star Trek' example game.

This commit is contained in:
dtrg 2007-04-21 23:20:11 +00:00
parent 921c55968c
commit 9710c14c93
3 changed files with 2065 additions and 1 deletions

View file

@ -6,7 +6,7 @@ A few notes on the examples
---------------------------
This directory contains a handful of working example programs that can be
built with the ACK. They're intended as a convention source of test code
built with the ACK. They're intended as a convenient source of test code
and as a starting point when writing your own programs.
They consist of:
@ -18,9 +18,14 @@ hilo.ocm Occam 1 version of the Hi/Lo game
hilo.p Pascal version of the Hi/Lo game
paranoia.c An ancient public domain K&R C adventure game
startrek.c An even more ancient public domain ANSI C game
startrek.doc Manual for above (plus in current directory when running)
Enjoy.
(startrek.c was written by David Ahl and converted to C by Chris Nystrom. See
http://www.cactus.org/%7Enystrom/startrek.html for more info.)
David Given
dg@cowlark.com
2007-02-25

1954
examples/startrek.c Normal file

File diff suppressed because it is too large Load diff

105
examples/startrek.doc Normal file
View file

@ -0,0 +1,105 @@
1. When you see _Command?_ printed, enter one of the legal commands
(nav, srs, lrs, pha, tor, she, dam, com, or xxx).
2. If you should type in an illegal command, you'll get a short list of
the legal commands printed out.
3. Some commands require you to enter data (for example, the 'nav' command
comes back with 'Course(1-9) ?'.) If you type in illegal data (like
negative numbers), that command will be aborted.
The galaxy is divided into an 8 X 8 quadrant grid, and each quadrant
is further divided into an 8 x 8 sector grid.
You will be assigned a starting point somewhere in the galaxy to begin
a tour of duty as commander of the starship _Enterprise_; your mission:
to seek out and destroy the fleet of Klingon warships which are menacing
the United Federation of Planets.
You have the following commands available to you as Captain of the Starship
Enterprise:
\nav\ Command = Warp Engine Control --
Course is in a circular numerical vector 4 3 2
arrangement as shown. Integer and real . . .
values may be used. (Thus course 1.5 is ...
half-way between 1 and 2. 5 ---*--- 1
...
Values may approach 9.0, which itself is . . .
equivalent to 1.0. 6 7 8
One warp factor is the size of one quadrant. COURSE
Therefore, to get from quadrant 6,5 to 5,5
you would use course 3, warp factor 1.
\srs\ Command = Short Range Sensor Scan
Shows you a scan of your present quadrant.
Symbology on your sensor screen is as follows:
<*> = Your starship's position
+K+ = Klingon battlecruiser
>!< = Federation starbase (Refuel/Repair/Re-Arm here)
* = Star
A condensed 'Status Report' will also be presented.
\lrs\ Command = Long Range Sensor Scan
Shows conditions in space for one quadrant on each side of the Enterprise
(which is in the middle of the scan). The scan is coded in the form \###\
where the units digit is the number of stars, the tens digit is the number
of starbases, and the hundreds digit is the number of Klingons.
Example - 207 = 2 Klingons, No Starbases, & 7 stars.
\pha\ Command = Phaser Control.
Allows you to destroy the Klingon Battle Cruisers by zapping them with
suitably large units of energy to deplete their shield power. (Remember,
Klingons have phasers, too!)
\tor\ Command = Photon Torpedo Control
Torpedo course is the same as used in warp engine control. If you hit
the Klingon vessel, he is destroyed and cannot fire back at you. If you
miss, you are subject to the phaser fire of all other Klingons in the
quadrant.
The Library-Computer (\com\ command) has an option to compute torpedo
trajectory for you (option 2).
\she\ Command = Shield Control
Defines the number of energy units to be assigned to the shields. Energy
is taken from total ship's energy. Note that the status display total
energy includes shield energy.
\dam\ Command = Damage Control report
Gives the state of repair of all devices. Where a negative 'State of Repair'
shows that the device is temporarily damaged.
\com\ Command = Library-Computer
The Library-Computer contains six options:
Option 0 = Cumulative Galactic Record
This option shows computer memory of the results of all previous
short and long range sensor scans.
Option 1 = Status Report
This option shows the number of Klingons, stardates, and starbases
remaining in the game.
Option 2 = Photon Torpedo Data
Which gives directions and distance from Enterprise to all Klingons
in your quadrant.
Option 3 = Starbase Nav Data
This option gives direction and distance to any starbase in your
quadrant.
Option 4 = Direction/Distance Calculator
This option allows you to enter coordinates for direction/distance
calculations.
Option 5 = Galactic /Region Name/ Map
This option prints the names of the sixteen major galactic regions
referred to in the game.