Whoops, that was supposed to be to Rob only. :P Errr.... Since it went out to the world I just want to be clear on one thing. The point I was trying to make about not being included in the quiz summary was that my solution isn't very Rubyish and is more interesting from and algorithms perspective than a coding perspective. I hope that's clear. :-\ Damn, how embarrassing. On 12/12/05, David Balmain <dbalmain.ml / gmail.com> wrote: > Hi Rob, > > To you only. > > Looks like you are setting up a nice little framework there. Since you > are going to the effort, you might want to have a look at my solution; > > MyPlayer won the match: 71-25 > MyPlayer took 2.249866 seconds, Standard took 93.019248 seconds > > Not sending this to brag. Actually, I think your code is a lot nicer. > I'm betting James will just ignore my solution in his quiz summary > again. Fair enough too. It's not very rubyish and it is a bit complex > but it does a good job. If you'd like to clean it up and incorporate > it into your framework, please do. And since you are using gdbm, maybe > you'll even be able to get my transposition tables to work. Currently > I have to refresh them each turn (which would be completely pointless > if I wasn't using MTD(f)). If you want to read more about the MTD(f) > algorithm I found a good explanation here; > > http://www.cs.vu.nl/~aske/mtdf.html > > Anyway, hopefully my code will be of interest to someone. ;-) > > Cheers, > Dave > > PS: if you didn't find my solution in the mailing list, it's here; > > http://www.davebalmain.com/pages/kalah > > On 12/12/05, Rob Leslie <rob / mars.org> wrote: > > Here's my solution. I'm still playing with it, but I'm posting it now > > for the benefit of others to look at. > > > > The solution is divided into strategies and players. Strategies are > > used to estimate the value of any particular board configuration to a > > player without any deep recursion or other lengthy operations. The > > only strategy I have now is BasicStrategy. > > > > Players implement a tactic for finding the best move based on the > > strategy. StandardPlayer uses a 6-ply alpha-beta search, and plays > > fairly well. The ply depth can be changed by modifying the DEPTH > > constant. > > > > ThreadedPlayer is an experimental time-limited player using a > > multithreaded search. It doesn't tend to play as well or as fast as > > StandardPlayer. CachingPlayer is an experimental GDBM-based caching > > player I wrote in an attempt to improve StandardPlayer's performance. > > > > RandomPlayer simply plays random moves, and has been useful for testing. > > > > To play, you can: > > > > ruby -r ./match.rb -e 'run(StandardPlayer, RandomPlayer)' > > > > > > > > > > -- > > Rob Leslie > > rob / mars.org > > > > > > > > > > > > > >