Re: othello data structures etc.
- From: "Jason Lenderman" <jasonl@xxxxxxxxxxxxx>
- Date: Thu, 22 Sep 2005 16:12:48 -0700
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.
>
.
- Follow-Ups:
- Re: othello data structures etc.
- From: bob
- Re: othello data structures etc.
- References:
- othello data structures etc.
- From: bob
- othello data structures etc.
- Prev by Date: Re: othello data structures etc.
- Next by Date: Re: othello data structures etc.
- Previous by thread: Re: othello data structures etc.
- Next by thread: Re: othello data structures etc.
- Index(es):
Relevant Pages
|
|