bump up version number
[mancala] / README
1 --------------------------------
2  Mancala README file
3  Kevin Riggle
4  http://cmancala.sourceforge.net
5  $Revision: 1.15.2.3 $
6  $Date: 2004/01/17 20:18:06 $
7 --------------------------------
8
9 To compile the Mancala program itself, cd into 'src' and type 'make'.
10 To compile the ai-test program, type 'make ai-test-normal'.  ('make recurse' 
11 and 'make ultimate' compile the mancala with the recursive and "ultimate" ai 
12 modules, respectively.)
13
14
15 DEV-LOG:
16
17 01-17-04: A lot of work has happened on the graphical branch without much in 
18 the way of updates here.  I would in no way call the code "production ready" --
19 it's a game, for crying out loud, and I'm in high school.  It is in a lot better
20 shape now, however.  There's still a memory leak somewhere, and valgrind is
21 segfaulting on me (grr), but it more-or-less works and looks good doing it, so
22 I'm releasing version 0.1.0 of the graphical Mancala in C today. :)  Projects
23 for later include making it work with autoconf/automake/etc., fixing the
24 remaining bugs, adding some configurability, and making it compile on Windows.
25 I spent about five hours trying to get everything in place, and I'm still
26 getting Blue Screens of Death.  At least it works on Linux, and I can show it
27 to my teacher for a grade.  Happy compiling!
28
29 01-07-04: The graphical version is getting off the ground, though the current
30 code looks like barfed-up ramen.  Bugger.  Once I decided I didn't like the
31 random stone placement look, I had an established code structure that forced
32 me to do the drawing a certain way.  It's proving to be a real pain in the ass,
33 since it's more logical to draw the entire board at once, but I'd rather not
34 pass half my environment to a function.  I may have to, since the alternative
35 is putting it all in main(), which is nasty, or dividing it up somehow, which
36 just doesn't make any sense at all.  I think my first impulse (before random
37 stones) was right -- all the board-drawing code goes in a function in
38 graphics.c, and no more messing around with half-a-dozen intermediate surfaces.
39 Oh, and I'm also keeping something of a development log at the Mancala in C
40 webpage (http://cmancala.sourceforge.net) *and* the day-to-day changes in the
41 ChangeLog, so I may be updating this less frequently than I used to.
42
43 12-28-03: Well, well, well.  Looks like I may write a graphical version of
44 mancala after all!  I've cleaned up the source code tree as well, using several
45 other notable projects (*cough*Linuxkernel*cough*) as models.  I've also
46 learned a bit about CVS in the process and how it handles branches.  Grrr...
47 At any rate, this should be fun to watch. :)
48
49 12-04-03: Progress continues.  Taking a small break from the ultimate algo, 
50 (stealing homework time, too, but -- hey, this is homework too).  Redid the 
51 Makefile a little more so you can make mancala and ai-test with any of the
52 three routines, plus wrote *another* wrapper function because the copy-the-
53 boards-and-set-up-the-logs code was being duplicated in -recurse and -ultimate.
54 I'm proud to say that my first attempt at passing function pointers worked
55 without a single hitch.  I love C... <sigh> :)
56
57 12-01-03: Made good progress over Thanksgiving break.  SSH works pretty well,
58 even over my grandmother's feeble dial-up connection.  Work is starting on the
59 "ultimate" algorithm, which may or may not be "ultimate," but will certainly
60 improve on the recursive algorithm, which doesn't have any concept of 
61 "strategy" or not letting me have a huge capture.  Thankfully the memory
62 requirements don't seem too overwhelming (c'mon, Kev, you really expected a
63 couple pitiful little integer tables would bring a modern computer to its
64 knees?)  If this comes along as quickly as it is seeming to, I may have time
65 to write a GUI before Christmas.  Oh, and I removed Makefile.bsd because I
66 figured out how to make one work for *both* UNIXes I use.
67
68 11-22-03: Getting better at CVS every day.  Set up a separate branch for the
69 new ai-test stuff (-r ai-test-headless), which lets me test the ai without
70 entering each value manually.  Instead, it grabs it from a file, which allows
71 me to, say, use AskIgor (http://www.st.cs.uni-sb.de/askigor/) to debug the ai.
72 Once I've got the code tightened up, all I need to do is release my working
73 directory and run "cvs co -j ai-test-headless mancala", resolve conflicts, and
74 commit.  Sweetness. :)
75
76 11-21-03: from the its-not-a-bug-its-a-feature dept.:  Turns out the ai-test 
77 program was balking because I entered the human board as all zeroes, so it
78 thought the game had been won.  Silly me.  Anyhow, 0.2.0 is in good shape
79 and I'm starting on the ultimate algo now.  Nothing more to see here, move
80 along... 
81
82 11-19-03: Not sure *why* I can't squash the bug, but I need to step away and 
83 we're due for a release anyway, so prepare for mancala-0.2.0!  This should
84 include the bugfixes I came up with to the original ai lo these many years ago,
85 and should otherwise prove that, yes, Virginia, I really am doing something.
86 The old AI beats the recursive one *anyway*, so it isn't really a big deal.
87 Now to refresh my memory about game theory so I can write THE ULTIMATE AI...
88 MUAHAHAHAHA...  sorry. 
89
90 11-12-03: Made a good start on squashing the bug I talked about two days ago.
91 Still getting some confusing results (ai-test="0 1 2 0 0 0 0"), but it is 
92 obvious we're getting the information we need without passing more pointers
93 with each recursion.  I should be able to ditch *ptCount, too -- I love 
94 abstraction, which lets me mess with the function definitions without making
95 me rewrite the call in main.c too. :)  
96
97 11-10-03: Almost have the recursive algorithm licked.  Looks like there's only 
98 one major bug left, namely the "i have no idea how many stones i got when i
99 recursed" bug.  Discovered that the algorithm had no idea if we'd won the
100 game, and so would loop infinitely trying to find a move that didn't exist.
101 Also changed the Makefiles so that they will clean up the logs the program 
102 and the recursive algo generate.  Code needs some clean-up, commenting, and
103 pretty exhaustive documentation (preferably step-by-step) just so I can say
104 I'm doing *something* in my independent study, but is otherwise pretty close.
105
106 10-29-03: Okay, added the select-a-random-move-if-we-don't-have-a-good-
107 alternative code to the recursive algo -- need to check the main program
108 logic to discern why the computer won't take its extra turns.  This may
109 be why the recursive algorithm seems "worse" than the heiuristic one,
110 when in fact they should play almost identically except in certain
111 special cases (ie. where taking the extra turn destroys an opportunity
112 for a larger gain, eg. a good capture).  Prepping a nicely-commented
113 version for MIT.
114 -----
115 Bah.  Tested the instance I mentioned above and discovered that when my
116 function actually recurses beyond one or two levels, it ends up getting
117 stuck somewhere. Bah.
118
119 10-28-03: And now it comes to me why I don't use my lovely rand_btw
120 function in my heiuristic AI...  it doesn't work (or rather, it puts the
121 "pseudo-" in "pseudo-random").  Research needed on a better and more
122 random random-function, though its current form will work well enough
123 for the version of the recursive algo I send to MIT (they won't see that
124 code anyway :).  It's in mancala.c now, and extern'd.
125
126 10-27-03: Well, the recursive algorithm now a) compiles and b) runs,
127 though it doesn't play terribly well.  There are also several noticable
128 bugs that need to be fixed (eg. if the AI cannot make a move that gains
129 it points, it does not move at all), but by in large I'm happy that I've
130 at least reached this juncture.  I'm also hoping to send the recursive
131 algorithm to MIT with my application as an example of extra things I do
132 in my spare time, so it's a good thing it's coming along so nicely.
133
134 10-16-03: Taking a little longer than expected -- needing to get a development
135 environment set up on SDF takes more time and money (!) than I initially thought
136 it would.  At any rate, it's all set so I should be making some more progress
137 now.  Added the two new ai modules (recursive and "ultimate") and started 
138 updating the makefile to allow for that.  Nothing actually works yet, but
139 it's in process now.  We'll see how far I get...
140
141 09-21-03: Wow, it's really been a while.  The code is in SourceForge CVS 
142 (finally) because I'm doing a little work on it for an independent-study at school -- learning about recursion and working with pointers.  At any rate, I'm
143 making progress, and may even have a GUI in the works.  We'll see if I can
144 learn to stomach graphics programming. :)
145
146 07-10-02: Getting this ready to post to SourceForge.
147
148 07-07-02: Coded the game loop plus neccessary game modules (mostly 
149 mancala.c:move), integrating the AI.  The by far biggest bug in the AI (aside
150 from the fact that it always loses against me) is that the 'random move'
151 algorithm often picks piddly little moves that don't get it any points -- say
152 moving one or two stones when there are ten in another hole.  The AI also needs
153 a true random-number generator (probably a whole new algorithm).  I'm going to
154 have to con a family member or three into sitting down and playing against this
155 thing.  Since I *programmed* the dang thing, I have some insight into how it
156 works.  (Which I stupidly revealed tonight, though they'll hopefully a. forget
157 it, or b. not know what to do with the knowledge.)  I must say, if the program
158 *I* design beats *me*, using just these pitiful hueristic methodss and not some
159 fancy-schmancy neural-net-cum-expert-system-cum-kitchen-sink, it wouldn't say
160 much for my skill at Mancala or the difficulty of the game.  (In short, it 
161 would be *really* embarrassing!)  Not that I'm worried, mind you. ;-)
162
163 07-04-02: Worked on instructions and game setup.  Also morphed common.h into
164 mancala.[ch], containing the same game-wide symbolic constants plus most of
165 the core game modules like move() and gameWon().
166
167 07-03-02: Began the main program module by coding in support for command-line
168 options.  Not sexy work, but necessary.  I also revised the Makefile to get
169 rid of the *~ files EMACS sometimes leaves behind.
170
171 06-29-02: Not only does it work, but I've fixed the remaining bugs in the AI
172 module, so it's time to code the UI/game modules!
173
174 06-28-02 (later): IT WORKS! (That thunking you hear is the sound of brain cells
175 being violently beaten to death.  I forgot to dereference the pointers.  Shit.)
176 AI code, at least with the minimal testing I've done, gives the expected 
177 result.  This project may go quicker than I thought it would! :-)  Mad props to
178 Peder Skyt of povray.off-topic for pointing out my error.
179
180 06-28-02: Posted a query to povray.off-topic RE: the segfault/"scanf-needs-a-
181 pointer" conundrum.  Gah.  Entered my code for the AI module itself.  No way to
182 test it out (obviously), but it compiles so I'm happy.  Updated the Makefile
183 (again) to compile with debugging, and introduced common.h to store standard
184 symbolic constants (BOARD_MAX, INITIAL_STONES, etc.).
185
186 06-27/28-02: Tried to code the bulk of ai-test.  Didn't work.  It's the ai-test
187 module, now with SEGFAULTs!  I know it's a stupid problem, I *know* I've seen
188 it before, but I can't. make. it. work! <grrrr>  Also updated the Makefile to 
189 reflect the way GNU make *actually* works, not the way I think it does. :-)
190
191 06-27-02: Well, just getting this project off the ground... set up a Makefile
192 and put basic 'Hello, world!'-ish stubs in to test it out, set up a
193 basic structure, etc. etc. etc. and checked it into CVS.  We'll see how this
194 turns out... :-)