0 | 0 |
Flip
|
1 | 1 |
====
|
2 | 2 |
|
3 | |
*Flip* is a very simple computer game by John S. James which first appeared
|
4 | |
in the March/April 1977 edition of *Creative Computing*.
|
|
3 |
This is Cat's Eye Technologies' distribution of the game of _Flip_.
|
|
4 |
|
|
5 |
Flip is a very simple computer game by John S. James which first appeared
|
|
6 |
in the March/April 1977 edition of _Creative Computing_.
|
5 | 7 |
|
6 | 8 |
In the game, the computer flips a virtual coin 50 times, and the object is
|
7 | 9 |
for you to guess whether the coin will come up heads or tails each time.
|
|
21 | 23 |
randomness thrown in, too.
|
22 | 24 |
|
23 | 25 |
This version of the game is written in Erlang, based largely on the version
|
24 | |
written in BASIC by Steve North appearing in *More BASIC Computer Games*,
|
|
26 |
written in BASIC by Steve North appearing in _More BASIC Computer Games_,
|
25 | 27 |
Ed. David H. Ahl (ISBN 0-89480-137-6). Note that in this implementation,
|
26 | 28 |
heads and tails are called `Y` and `N`.
|
27 | 29 |
|
28 | 30 |
Running
|
29 | 31 |
-------
|
30 | 32 |
|
31 | |
Start an Erlang shell, load the `flip` module, and run `flip:start()`.
|
|
33 |
To build the `flip` module, run the script `make.sh` from the root
|
|
34 |
directory of the distribution.
|
|
35 |
|
|
36 |
After the module has been built, the game can be played by running the
|
|
37 |
script `flip` in the `bin` directory. This script can be run from anywhere;
|
|
38 |
it knows to locate the module in the distribution directory.
|
|
39 |
|
|
40 |
Playing the Game
|
|
41 |
----------------
|
|
42 |
|
|
43 |
Each time the computer prompts you with a question mark, type 'Y' to
|
|
44 |
guess that the flip was heads, or 'N' to guess that the flip was tails.
|
|
45 |
A correct guess will be signalled by an asterisk printed before the
|
|
46 |
next question mark. At the end of the run (by default 50 flips,) your
|
|
47 |
score will be printed.
|