AI::Evolve::Befunge::Board - board game object
my $board = AI::Evolve::Befunge::Board->new(Size => $vector);
This module tracks board-game state for AI::Evolve::Befunge. It is only used for board-game-style physics, like tic tac toe, othello, go, chess, etc. Non-boardgame applications do not use a Board object.
AI::Evolve::Befunge::Board->new(Size => $vector);
AI::Evolve::Befunge::Board->new(Size => $number, Dimensions => $number);
Creates a new Board object. You need to specify the board-size somehow, either by providing a Language::Befunge::Vector object, or by specifying the size of the side of a hypercube and the number of dimensions it exists in (2 is the most likely number of dimensions). If the Size argument is numeric, the Dimensions argument is required, and a size vector will be generated internally.
Clear the board - set all spaces to 0.
my $string = $board->as_string();
Returns an ascii-art display of the current board state. The return value looks like this (without indentation):
my $binary = $board->as_binary_string();
Returns an ascii-art display of the current board state. It looks the same as ->as_string(), above, except that the values it uses are binary values 0, 1, and 2, rather than plaintext descriptive tokens. This is suitable for passing to Language::Befunge::LaheySpace::Generic's ->store() method.
Prints the return value of the ->as_string() method to the console, decorated with row and column indexes. The output looks like this (without indentation):
Returns the value of the board space specified by the vector argument. This is typically a numeric value; 0 means the space is unoccupied, otherwise the value is typically the player number who owns the space, or the piece-type (for games which have multiple types of pieces), or whatever.
Set the value of the board space specified by the vector argument.
my $new_board = $board->copy();
Create a new copy of the board.
To install AI::Evolve::Befunge, copy and paste the appropriate command in to your terminal.
perl -MCPAN -e shell
For more information on module installation, please visit the detailed CPAN module installation guide.