tiny-c source code for Piranha Fish

Notes: This game came with the original tiny-c package and was thus written by Tom Gibson and / or Scott Guthery. Contrary to what you might think, cannibals are your friends in this addictive game; they don't seem to be interested in eating anybody.

Piranha Fish -- An Original Game

You are leading the following party on a safari through the jungle:

2 cannibals
2 big-game hunters
1 doctor
1 nurse
3 missionaries

You arrive at a 100-yard-wide river filled with piranha fish. You must cross the river. There is a leaky canoe on your shore, which can hold, at most, 4 people. The cannibals paddle the best, followed by the hunters, the doctor, the nurse and the missionaries, who are notoriously weak. You must decide who gets in the canoe for each trip back and forth. Get the party across with a minimum of carnage.

The commands are : s to get a status, 1 thru 9 to put people in the boat, . to start trip. The cannibals are 1 and 2, hunters 3 and 4, doctor 5, nurse 6 and missionaries 7 thru 9.

Read the full documentation if you need a good laugh.

Here's a sample run.


7:54 B6>>tc
 ***  TINY-C   VERSION 1.0  ***

COPYRIGHT 1977, T A GIBSON

>>>.r pps.tc
>>>.g
 ***  TINY-C   VERSION 1.0  ***

COPYRIGHT 1977, T A GIBSON

>.r pf
 6829
 0 278 6829 171
>.pf
seed? 31

move s

near shore                     far shore

 1 cannibal
 2 cannibal
 3 hunter
 4 hunter
 5 doctor
 6 nurse
 7 missionary
 8 missionary
 9 missionary
     canoe

move 1.
Canoe has 70 yards to go, and is 25% full
Canoe has 40 yards to go, and is 50% full
Canoe has 10 yards to go, and is 75% full
trip to far shore is complete.

move s

near shore                     far shore

                                1 cannibal
 2 cannibal
 3 hunter
 4 hunter
 5 doctor
 6 nurse
 7 missionary
 8 missionary
 9 missionary
                                    canoe
move 1.
Canoe has 70 yards to go, and is 25% full
Canoe has 40 yards to go, and is 50% full
A piranha fish has jumped into the boat.  He is swimming
around.  He is looking at the toe of the cannibal.
The cannibal has speared the fish.
Canoe has 10 yards to go, and is 75% full
trip to near shore is complete.

move s

near shore                     far shore

 1 cannibal
 2 cannibal
 3 hunter
 4 hunter
 5 doctor
 6 nurse
 7 missionary
 8 missionary
 9 missionary
     canoe

move 1234.
Canoe has 74 yards to go, and is 25% full
A piranha fish has jumped into the boat.  He is swimming
around.  He is looking at the toe of the cannibal.
The cannibal has speared the fish.
Unfortunately he made a hole in the
boat, increasing its sink rate 10%.
Canoe has 48 yards to go, and is 52% full
Canoe has 22 yards to go, and is 79% full
trip to far shore is complete.

move s

near shore                     far shore

                                1 cannibal
                                2 cannibal
                                3 hunter
                                4 hunter
 5 doctor
 6 nurse
 7 missionary
 8 missionary
 9 missionary
                                    canoe
move 1.
Canoe has 70 yards to go, and is 27% full
Canoe has 40 yards to go, and is 54% full
A piranha fish has jumped into the boat.  He is swimming
around.  He is looking at the toe of the cannibal.
The cannibal has speared the fish.
Canoe has 10 yards to go, and is 81% full
trip to near shore is complete.

move s

near shore                     far shore

 1 cannibal
                                2 cannibal
                                3 hunter
                                4 hunter
 5 doctor
 6 nurse
 7 missionary
 8 missionary
 9 missionary
     canoe

move 1589.
Canoe has 84 yards to go, and is 27% full
Canoe has 68 yards to go, and is 54% full
Canoe has 52 yards to go, and is 81% full
A piranha fish has jumped into the boat.  He is swimming
around.  He is looking at the toe of the missionary.
The missionary is calm.  He is staring back at the
fish.  The fish just jumped back into the river.
The boat is swamped ...
CAPSIZE!! Everybody swim FAST!! The fish are coming ..
Player 1 makes it.
Player 5 makes it.
BYTE!! BYTE!!  Player 8 fortunately escapes with minor wounds.
BYTE!! BYTE!!  Player 9 fortunately escapes with minor wounds.
trip to far shore is complete.
 8 attended by doctor.
 9 attended by doctor.

move s

near shore                     far shore

                                1 cannibal
                                2 cannibal
                                3 hunter
                                4 hunter
                                5 doctor
 6 nurse
 7 missionary
                                8 missionary minor att
                                9 missionary minor att
                                    canoe

move 1.
Canoe has 70 yards to go, and is 27% full
Canoe has 40 yards to go, and is 54% full
Canoe has 10 yards to go, and is 81% full
A piranha fish has jumped into the boat.  He is swimming
around.  He is looking at the toe of the cannibal.
The cannibal has speared the fish.
trip to near shore is complete.

move s

near shore                     far shore

 1 cannibal
                                2 cannibal
                                3 hunter
                                4 hunter
                                5 doctor
 6 nurse
 7 missionary
                                8 missionary minor att
                                9 missionary minor att
     canoe

move 167.
Canoe has 83 yards to go, and is 27% full
Canoe has 66 yards to go, and is 54% full
Canoe has 49 yards to go, and is 81% full
The boat is swamped ...
CAPSIZE!! Everybody swim FAST!! The fish are coming ..
BYTE!! BYTE!!  Player 1 fortunately escapes with minor wounds.
BYTE!! BYTE!!  Player 6 major wounds acquired.
Player 7 makes it.
trip to far shore is complete.
 1 attended by doctor.
 6 attended by doctor.
 6 is much worse, in fact dead.

near shore                     far shore

                                1 cannibal minor att
                                2 cannibal
                                3 hunter
                                4 hunter
                                5 doctor
                                6 nurse dead
                                7 missionary
                                8 missionary minor att
                                9 missionary minor att
                                    canoe

Your score is 885