Re: othello data structures etc.



I think I set things up as a 10x10 array of bytes or ints (I'm thinking I
used ints since my program is in Java and for some reason java copies ints
faster...I think.)

As far as legal moves are concerned, you want to try to update that from
turn to turn. What I do is keep a list of positions that are adjacent to
black (white) pieces and update the list after each turn. Not all the moves
in the list are legal but they dramatically reduce the possible moves you
need to check. The lists are also useful since their size gives a mobility
measure which can be incorporated into the board evaluation. The updating of
the list is done inside the "doMove(Position p)" which also updates various
other things including piece counts of each color and such.

Here's an Othello Java applet I wrote a few years ago:
http://www.stat.ucla.edu/~jasonl/reversi/Reversi.html. The level of play is
limited by the small number of board features that I am using (~16) but
weights assigned to these features were obtained using self-play and
logistic regression so it still manages to play a pretty decent game.


<bob@xxxxxxxxxxxxxx> wrote in message
news:1127397837.482509.268890@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
>I was just wondering if you guys know what data structures and
> functions are best for an Othello game. Right now, I'm just using an
> array of 64 chars.
>
> Also, my functions for enumerating moves and what not probably are
> quite suboptimal. If anyone has any insights regarding this sort of
> thing, I'd love to hear about them.
>
> Thanks.
>


.



Relevant Pages

  • Re: newbie: hierarchies in lisp? (long)
    ... > As much as the C implementation commits me to an array or the XML ... > was the most appropriate Lisp structure to use here. ... Your Java example hides the data structure which is holding the runway ... Lists are convenient data ...
    (comp.lang.lisp)
  • Re: othello data structures etc.
    ... It tried your game, and it's not bad. ... > I think I set things up as a 10x10 array of bytes or ints (I'm thinking I ... > used ints since my program is in Java and for some reason java copies ints ... The lists are also useful since their size gives a mobility ...
    (comp.ai.games)
  • Re: MV Keys
    ... implemented quite conveniently with lists. ... Java chose only a single, ... to the array; Java has certainly thrown an impressive ... A mathematician has the luxury of picking and choosing ...
    (comp.databases.theory)
  • Re: Constant list of strings and numbers
    ... > Is it possible to make a constant list of lists of strings and numbers ... > in Java? ... Your example is not right because all of the values in an array ...
    (comp.lang.java.programmer)
  • Constant list of strings and numbers
    ... Is it possible to make a constant list of lists of strings and numbers ... in Java? ... I know that I could make an 2D array of Objects and store String and ...
    (comp.lang.java.programmer)