# $Id: Display.pm,v 1.1.1.1 2008/10/12 04:05:34 alamos Exp $ # The state is in an array package TicTacToe::Display; use strict; use base qw(Exporter); use vars qw(@ISA $VERSION @EXPORT); $VERSION='1.0'; @EXPORT = qw(&display_position); # Variable used in formatting my $pos; ################################################ # # Format game position, using an array reference # ################################################ format POS = +-----+-----+-----+ | | | | | @ | @ | @ | $pos->[0], $pos->[1], $pos->[2] | | | | +-----+-----+-----+ | | | | | @ | @ | @ | $pos->[3], $pos->[4], $pos->[5] | | | | +-----+-----+-----+ | | | | | @ | @ | @ | $pos->[6], $pos->[7], $pos->[8] | | | | +-----+-----+-----+ . ################################################ sub display_position { $pos = $_[0]; $~ = 'POS'; write } ## This is here because a module must return a value 1;