git @ Cat's Eye Technologies Flip / b62eb77
Add README, update license verbiage (no "REGENTS".) Cat's Eye Technologies 11 years ago
3 changed file(s) with 43 addition(s) and 58 deletion(s). Raw diff Collapse all Expand all
0 Flip
1 ====
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*.
5
6 In the game, the computer flips a virtual coin 50 times, and the object is
7 for you to guess whether the coin will come up heads or tails each time.
8
9 What makes it interesting is that the coin is not fair. The computer tries
10 to find patterns in your guesses, and exploit them by biasing the coin toss
11 away from what it thinks you are likely to guess next.
12
13 You can think of it as creating a Markov chain to model your guesses, and
14 updating it each time you make a guess, based on your last few guesses.
15
16 This version of the game is written in Erlang, based largely on the version
17 written in BASIC by Steve North appearing in *More BASIC Computer Games*,
18 Ed. David H. Ahl (ISBN 0-89480-137-6).
+0
-33
doc/flip.html less more
0 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
1 <html>
2 <head>
3 <title>Module flip</title>
4
5 </head>
6 <body bgcolor="white">
7 <h1>Module flip</h1>
8 <ul><li>
9 <a href="#index">Function index</a></li><li>
10 <a href="#exported">Exported functions</a></li></ul>
11
12 <h2>Description</h2>
13 The venerable and ancient computer game of FLIP.
14
15 <p>This version is coded in Erlang. It is based on the
16 original game of FLIP by John S. James, as implemented in
17 BASIC by Steve North in <i>Creative Computing</i>, March/April 1977.</p>
18
19
20 <h2><a name="index">Function Index</a></h2>
21
22 <table width="100%" border="1"><tr><th colspan="2" align="left">Exported Functions</th></tr>
23 <tr><td><a href="#start-0">start/0</a></td><td>Plays a game of FLIP.</td></tr>
24 </table>
25
26 <h2><a name="exported">Exported Functions</a></h2>
27
28 <h3><a name="start-0">start/0</a></h3>
29
30 <p><code>start() -> ok</code></p>
31 <p>Plays a game of FLIP.</p></body>
32 </html>
00 %%% BEGIN flip.erl %%%
11 %%%
22 %%% flip - Cat's Eye Technologies' Erlang FLIP
3 %%% Copyright (c)2002 Cat's Eye Technologies. All rights reserved.
3 %%%
4 %%% Copyright (c)2002-2012, Chris Pressey, Cat's Eye Technologies.
5 %%% All rights reserved.
46 %%%
57 %%% Redistribution and use in source and binary forms, with or without
68 %%% modification, are permitted provided that the following conditions
79 %%% are met:
810 %%%
9 %%% Redistributions of source code must retain the above copyright
10 %%% notice, this list of conditions and the following disclaimer.
11 %%% 1. Redistributions of source code must retain the above copyright
12 %%% notices, this list of conditions and the following disclaimer.
13 %%% 2. Redistributions in binary form must reproduce the above copyright
14 %%% notices, this list of conditions, and the following disclaimer in
15 %%% the documentation and/or other materials provided with the
16 %%% distribution.
17 %%% 3. Neither the names of the copyright holders nor the names of their
18 %%% contributors may be used to endorse or promote products derived
19 %%% from this software without specific prior written permission.
1120 %%%
12 %%% Redistributions in binary form must reproduce the above copyright
13 %%% notice, this list of conditions and the following disclaimer in
14 %%% the documentation and/or other materials provided with the
15 %%% distribution.
16 %%%
17 %%% Neither the name of Cat's Eye Technologies nor the names of its
18 %%% contributors may be used to endorse or promote products derived
19 %%% from this software without specific prior written permission.
20 %%%
21 %%% THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
22 %%% CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
23 %%% INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
24 %%% MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
25 %%% DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE
26 %%% LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
27 %%% OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
28 %%% PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
29 %%% OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
30 %%% ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
31 %%% OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32 %%% OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
33 %%% POSSIBILITY OF SUCH DAMAGE.
21 %%% THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 %%% ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES INCLUDING, BUT NOT
23 %%% LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24 %%% FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25 %%% COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26 %%% INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
27 %%% BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28 %%% LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29 %%% CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 %%% LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
31 %%% ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32 %%% POSSIBILITY OF SUCH DAMAGE.
3433
3534 %% @doc The venerable and ancient computer game of FLIP.
3635 %%