VOYAGE OF PERIL (16K ZX-81)
by Norman Brooks
from ZX Computing (August/September 1985), pages 48-53

A life on the Ocean Waves can be full of danger but you, as Captain of HMS
BOUNTY, have a duty to your country to return to your Home Port carrying as
much Gold as you can get your hands on...


INSTRUCTIONS

From a position at anchor in the bottom left hand corner of Map 1 you may sail
in any direction you choose and you can deploy as much sail as your crew is
able to hoist. However, beware that the wind is not Gale or Storm Force as it
may tear your sails and damage your masts. Remember as well that your ship
cannot sail within +/-45 degrees of the wind direction or else your sails will
flap uselessly in the breeze. If the wind force is 0 you will be becalmed for a
day; if a Hurricane force 12 blows then batten down the hatches!

         MAP 5 -- MAP 6 <- HOME PORT
           |        |
         MAP 3 -- MAP 4
           |        |
START -> MAP 1 -- MAP 3

On your voyage you will encounter Hazards. These are shown graphically as:

Graphic T (black bottom left, black top right)  ROCKS     Your ship will be damaged.
Graphic D (chequerboard bottom, white top)      REEF      Your ship will be damaged.
Graphic 6 (black bottom, white top)             ICEBERG   Your ship will be damaged.
Asterisk                                        SANDBANK  Your ship is stuck fast for 1 day.
Graphic A (chequerboard)                        LAND
	You have (a) a 20% chance of being attacked by Savages,
             (b) a 20% chance of losing some of your crew to Alluring Maidens
          or (c) you will be offered the chance to Trade.
                 You can buy Food, take on Crew and Repair damage
                 provided you have enough Gold to pay for the transactions.

There are 26 TREASURE points spread over the six Maps which are shown as
Graphic A to Z. Land on these and your coffers will start to bulge.

Oh... by the way... you may be attacked by PIRATES at any time whilst at sea
(your chances of this happening are 1 in 250 each time the ship is plotted in
open sea).

Your crew eats one food ration per man per day and it provisions run out you
will have a MUTINY on your hands. Too much ship damage will result in SHIPWRECK
and if your Crew Strength is too small, sailing ship will be impossible, and
you will find yourself MAROONED if on land or ADRIFT if at sea. Any of these
occurences results in a lost game.

If, on the other hand, you reach your HOME PORT shown as an inverse asterisk in
the top right hand corner of Map 6 then you have achieved your objective and
the size of your Gold haul will determine the degree of your success. I suggest
that you always try to beat your previous Hi-Score and congratulate yourself
according to the this guide:

Gold Pieces:  Success:
Under 1000    You started the game with 1000 gold pieces so was it worth the effort?
1000-2500     You can probably just afford to pay off the remaining crew.
2500-5000     Your voyage was a moderate success.
5000-7500     Well done, you have made a handsome profit.
Over 7500     Your Fortune is made and promotion to Admiral is a certainty.


PROGRAM NOTES

LOAD "PERIL" and then RUN the program. In order to fit the program into 16K, I
have had to remove all the REM statements. These were as indicated below:

Line No:      Statement:
100           Main program.
180           Input course and sail area.
230           Check course with wind direction.
310           Check sail area with wind force.
330           Plot ship passage and check location.
1000          Becalmed routine.
1200          In Irons routine.
1400          Storm damage routine.
1600          Going off map routine.
1645          Edge of world routine.
2000          Treasure routine.
2250          Rocks routine.
2500          Reef routine.
2750          Sandbank routine.
3000          Iceberg routine.
3250          Pirates routine.
3500          Home port routine including Hi-Score display.
3750          Land routine.
3800          Savages attack routine.
3900          Dusky Maidens routine.
4000          Trade routines:
4100          Buy food.
4200          Take on crew.
4300          Repair ship damage.
4400          Leave land routine.
4500          Display Days, Gold, Food, Crew and Harm points.
4750          Check for lost game:
5000          Mutiny routine.
5250          Marooned routine.
5500          Adrift routine.
5750          Shipwreck routine.
6000          Clear message area.
6100-8500     Print new map.
7250          Create map arrays.
8750          Draw board.
8880          Call new map array.
9500          Instructions.
9750          Set up variables and arrays.


MAJOR VARIABLES

G             Gold points.
HG            Hi-Score gold points.
F             Food rations.
CS            Crew strength.
H             Health points (Harm=100-H).
H1            Storm damage.
HL            Previous health points.
WF            Wind force.
WD            Wind direction.
SA            Maximum sail area hoistable by available crew.
A             Inputted sail area.
C             Inputted course.
Q(26)         CHR$ CODEs of treasure points.
T             Days into voyage.
N             Map number.
D             Distance ship may travel.
Z             Flag to re-display scores.
X,Y           Coordinates of ship position.
X1,Y1         Coordinates of last ship position.
X2,Y2         Coordinates of ship at end of previous day.
L,K           Conversion of X,Y into PRINT coordinates.
L1,K1         Conversion of X1,Y1 into PRINT coordinates.
D$(15,25)     Map array.
T$            Type of trade chosen (e.g. Food).
P$,Q$,R$,S$   Memory saving messages.