Re: gnothello...



On Sat, Jan 23, 1999 at 04:44:07PM -0600, James Smith wrote:
> This is a little on the lighter side of GNOME.  I've been playing
> gnothello a bit lately -- I like it.  Good graphics.  Tear off menus
> great.

Thanks.  The graphics I did.  The tear off menus I have nothing to do
with.

> My question is -- are we going to have more than three levels for the
> computer?  I've been playing on level three lately and just beat it in 8
> seconds with 17 stones for me and none for it.  Doesn't seem like much
> of a challenge.  (This is a bit of a suprise since it usually takes
> about 40 seconds or so with all the stones used.)

I'm responsible for the pathetic levels.  I've just run out of time
with classes and my first year of college and all.  You're right, the
levels aren't a challenge at all.

> I haven't actually gone in and looked at the code yet, but I might see
> how the levels are defined and add a couple, if possible.  Any pointers
> on what to look for? (Yes, I know we have greater problems to work on,
> but a little fun needs to be had too :)

I would welcome any work done to make additional gnothello levels.  If
you'd really like to work on some, that would kick ass.  Here is some
basic information.

A board in gnothello is defined as

gint8 board[8][8];

There are some functions to work with the board in othello.c, specifically

gint is_valid_move (guint x, guint y, guint me);
gint is_valid_move_board (gint8 board[8][8], guint x, guint y, guint me);
gint move (guint x, guint y, guint me);
gint move_board (gint8 board[8][8], guint x, guint y, guint me, gint real);

x and y are the squares on the board, me is either BLACK_TURN or
WHITE_TURN.

The functions with _board on the end actually do things, the wrappers
just assume the default board.

Note that move () does stuff graphically, but move_board () only draws
on the screen if real is true.  This way, you can do look ahead on a
copy of the game board if you want.

A computer level is written inside othello.c as

gint computer_move_# (guint me)
{
}

This function should always return (FALSE), and should call
move(#, #, me);

before they return.

To install a new level, look at check_computer_players (),
black_level_radio_list[], and white_level_radio_list[] in gnothello.c.
Feel free to mail me if you have any questions.

> ---------------------+---------------------------------------
> Jim Smith            | Email: j-smith@physics.tamu.edu
> Texas A&M University | http://people.physics.tamu.edu/jsmith/
> Dept. of Physics     | Phone: (409) 845-1379
> ---------------------+---------------------------------------

-- 
Ian Peters		``Never attribute to malice what can be explained
ipeters@acm.org			by stupidity'' -- Hanlon's Razor



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]