Masem makes an excellent point. If you are going to have a lot of board related functions, it makes a lot of sense to have those functions be methods of a board object.
Your AI particularly should be able to make a move based on the board's layout. So you can just give the AI routines the current board object. Any information the AI needs can be retrieved using $board->is_free( x, y ) or whatever methods you'd need.
elbieelbieelbie
In reply to (elbie): OO vs. global variables...
by elbie
in thread OO vs. global variables...
by dragonchild
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |