git @ Cat's Eye Technologies Flip / 6a2e331
Don't ship with (old) .beams, add driver script, dotignores. catseye 11 years ago
6 changed file(s) with 34 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
0 *.beam
0 syntax: glob
1
2 *.beam
00 Flip
11 ====
22
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_.
57
68 In the game, the computer flips a virtual coin 50 times, and the object is
79 for you to guess whether the coin will come up heads or tails each time.
2123 randomness thrown in, too.
2224
2325 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_,
2527 Ed. David H. Ahl (ISBN 0-89480-137-6). Note that in this implementation,
2628 heads and tails are called `Y` and `N`.
2729
2830 Running
2931 -------
3032
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.
0 #!/bin/sh
1 ERL_LIBS=`dirname $0`/../../ erl -noshell -run flip -run init stop
ebin/flip.beam less more
Binary diff not shown
0 #!/bin/sh
1
2 if [ ! -d ebin ]; then
3 mkdir ebin
4 fi
5 for FILE in src/*.erl; do
6 erlc -o ebin $FILE
7 done