Games::TicTacToe - Interface to the TicTacToe game.
Version 0.05
A console based TicTacToe game to play against the computer.A simple TicTacToe player supplied with the distribution in the script sub folder.
Returns game board for TicTacToe (3x3) as of now.
use strict; use warnings; use Games::TicTacToe; my $tictactoe = Games::TicTacToe->new(); print $tictactoe->getGameBoard();
Add player to the TicTacToe game.It prompts the user to pick the player from Human / Computer. As soon as the user picks one, it then asks to pick the symbol for the selected user from X/O. Once the player and symbol are selected then it automatically selects the other player/symbol.
use strict; use warnings; use Games::TicTacToe; my $tictactoe = Games::TicTacToe->new(); $tictactoe->addPlayer();
Returns the players information with their symbol.
use strict; use warnings; use Games::TicTacToe; my $tictactoe = Games::TicTacToe->new(); $tictactoe->addPlayer(); print $tictactoe->getPlayers();
Actually starts the game by prompty player to make a move.
use strict; use warnings; use Games::TicTacToe; my $tictactoe = Games::TicTacToe->new(); $tictactoe->addPlayer(); $tictactoe->play();
Returns 1 or 0 depending whether the TicTacToe is over or not. It dumps the winner name if any found. It also dumps the message if the games is drawn just in case.
use strict; use warnings; use Games::TicTacToe; my $tictactoe = Games::TicTacToe->new(); $tictactoe->addPlayer(); $tictactoe->play(); print "Thank you!!!\n" if $tictactoe->isGameOver();
Mohammad S Anwar, <mohammad.anwar at yahoo.com>
<mohammad.anwar at yahoo.com>
Please report any bugs or feature requests to bug-games-tictactoe at rt.cpan.org or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Games-TicTacToe. I will be notified & then you'll automatically be notified of progress on your bug as I make changes.
bug-games-tictactoe at rt.cpan.org
You can find documentation for this module with the perldoc command.
perldoc Games::TicTacToe
You can also look for information at:
RT: CPAN's request tracker
http://rt.cpan.org/NoAuth/Bugs.html?Dist=Games-TicTacToe
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/Games-TicTacToe
CPAN Ratings
http://cpanratings.perl.org/d/Games-TicTacToe
Search CPAN
http://search.cpan.org/dist/Games-TicTacToe/
This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
To install Games::TicTacToe, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Games::TicTacToe
CPAN shell
perl -MCPAN -e shell install Games::TicTacToe
For more information on module installation, please visit the detailed CPAN module installation guide.