Changeset 6881
- Timestamp:
- 02/18/08 23:24:49 (5 years ago)
- Location:
- lang/perl/Games-Go/trunk
- Files:
-
- 3 modified
-
README (modified) (1 diff)
-
bin/start_go.pl (modified) (1 diff)
-
lib/Games/Go/Play.pm (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lang/perl/Games-Go/trunk/README
r3771 r6881 1 1 Games-Go-Play version 0.0.1 2 3 [ REPLACE THIS...4 5 The README is used to introduce the module and provide instructions on6 how to install the module, any machine dependencies it may have (for7 example C compilers and installed libraries) and any other information8 that should be understood before the module is installed.9 10 A README file is required for CPAN modules since CPAN extracts the11 README file from a module distribution so that people browsing the12 archive can use it get an idea of the modules uses. It is usually a13 good idea to provide version information here so that people can14 decide whether fixes for the module are worth downloading.15 ]16 17 2 18 3 INSTALLATION -
lang/perl/Games-Go/trunk/bin/start_go.pl
r6878 r6881 61 61 } 62 62 elsif ( $in eq 'p' ) { 63 64 # [TODO]pass. 65 return; 63 $go->pass; 66 64 } 67 65 elsif ( $in eq 'resign' ) { -
lang/perl/Games-Go/trunk/lib/Games/Go/Play.pm
r6878 r6881 11 11 12 12 use base qw/Class::Accessor::Fast/; 13 __PACKAGE__->mk_accessors(qw(space black white out ));13 __PACKAGE__->mk_accessors(qw(space black white out pass)); 14 14 15 15 our $B_SIZE = 19; … … 34 34 'ji' => 0, 35 35 }, 36 'pass' => 0, 36 37 }; 37 38 … … 91 92 return; 92 93 } 94 $self->{'pass'} = 0; 93 95 $self->{'board'}[ $points->[1] ][ $points->[0] ] = $symbol; 94 96 $self->{'teban'} = $self->other_side( $self->{'teban'} ); … … 111 113 sub pass { 112 114 my ($self) = @_; 115 $self->{'pass'}++; 116 if ($self->{'pass'} >= '2') { 117 $self->end; 118 return; 119 } 113 120 $self->{'teban'} = $self->other_side( $self->{'teban'} ); 114 121 } … … 117 124 my ( $self, $symbol ) = @_; 118 125 return ( $symbol eq $BLACK ) ? $WHITE : $BLACK; 126 } 127 128 sub end { 129 my ($self) = @_; 130 print "[TODO] end.\n"; 119 131 } 120 132 … … 167 179 =item show 168 180 Show play field. 181 =item end 182 End the game. 169 183 =back 170 184
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)