Discussion:
use of board_given.c functions
(too old to reply)
Abrouie Masood
2004-04-02 00:58:21 UTC
Permalink
I thought we may use any function that is provided in the code you give
us. I used two of the directionSweep... fuctions, but it turned out
that they were local functions. I was wondering whether I can use
them. If so, can you declare them in board.h or can I just copy-paste them
into board.c?


Thanks,

Masood
Alexander Smith
2004-04-03 19:47:27 UTC
Permalink
After receiving several requests to make the "sweep" functions public, I
have now done so. However, I recommend that you do NOT use them. You may
if you wish, but they have several "quirks" you must work around. In my
opinion, it will probably take as much effort to get these functions
working correctly for you as it would just to write your own. The sweep
functions are designed to sweep the entire game board. For makeMove(), you
do not need to sweep the whole board. You just need to search in the eight
compass directions from where the piece is being placed. If you use the
sweep functions, you will notice that they wrap around the edges of the
board, and they also "visit" locations that are not on the board. You will
have to take all of that into account, because those are two things you
don't want to do in makeMove().

Alexander
Post by Abrouie Masood
I thought we may use any function that is provided in the code you give
us. I used two of the directionSweep... fuctions, but it turned out
that they were local functions. I was wondering whether I can use
them. If so, can you declare them in board.h or can I just copy-paste them
into board.c?
Thanks,
Masood
Loading...