blib/lib/Game/Snake.pm

filter: Statementstmt 99.5% 207 / 208 Branchbran 98.6% 73 / 74 Conditioncond 88.8% 40 / 45 MC/DCmcdc 80.7% 21 / 26 Subroutinesub 100% 33 / 33 Podpod 94.4% 17 / 18 totaltotal 96.7% 391 / 404 CC 62 SCAR 21.0
CC
62
Cov
98%
tick
18.0
BUILD
13.0
turn
9.0
CRAP 8.2
« blib/lib/Game/Snake/Terminal.pm ↑ Summary blib/lib/Game/Snake/Bot.pm »
1 package Game::Snake;
2  
3 15 ▶use 5.014;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 15 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 15 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 15 ▶use Carp ();
Subroutine BEGIN: called CC=1 SCAR=0.0
8 15 ▶use Digest::SHA ();
Subroutine BEGIN: called CC=1 SCAR=0.0
9 15 ▶use Object::Proto::Sugar -types;
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 15 ▶use Game::Snake::Error;
Subroutine BEGIN: called CC=1 SCAR=0.0
12 15 ▶use Game::Snake::Result;
Subroutine BEGIN: called CC=1 SCAR=0.0
13  
14 15 our $VERSION = '0.12';
15  
16 15 our @DIRECTIONS = qw/ up down left right /;
17  
18 15 my %DELTA = (
19 up => [ 0, -1 ],
20 down => [ 0, 1 ],
21 left => [ -1, 0 ],
22 right => [ 1, 0 ],
23 );
24  
25 15 my %OPPOSITE = (
26 up => 'down',
27 down => 'up',
28 left => 'right',
29 right => 'left',
30 );
31  
32 15 my %IS_DIRECTION = map { $_ => 1 } @DIRECTIONS;
33  
34 has cols => (
35 is => 'ro',
36 isa => Int,
37 default => 40
38 15 );
39  
40 has rows => (
41 is => 'ro',
42 isa => Int,
43 default => 28
44 15 );
45  
46 has seed => (
47 is => 'ro',
48 isa => Str,
49 default => 'Game::Snake'
50 15 );
51  
52 has start_length => (
53 is => 'ro',
54 isa => Int,
55 default => 3
56 15 );
57  
58 has food_score => (
59 is => 'ro',
60 isa => Int,
61 default => 10
62 15 );
63  
64 has start_speed => (
65 is => 'ro',
66 isa => Int,
67 default => 2
68 15 );
69  
70 has _body => (
71 is => 'rw',
72 isa => ArrayRef,
73 1285 ▶ default => sub { [] },
Subroutine __ANON__: called CC=1 SCAR=0.0
74 private => 1
75 15 );
76  
77 has _queue => (
78 is => 'rw',
79 isa => ArrayRef,
80 1285 ▶ default => sub { [] },
Subroutine __ANON__: called CC=1 SCAR=0.0
81 private => 1
82 15 );
83  
84 15 has _heading => (is => 'rw', private => 1);
85 15 has _food => (is => 'rw', private => 1);
86 15 has _cause => (is => 'rw', private => 1);
87 15 has _error => (is => 'rw', private => 1);
88  
89 has _grow => (
90 is => 'rw',
91 isa => Int,
92 default => 0,
93 private => 1
94 15 );
95  
96 has _score => (
97 is => 'rw',
98 isa => Int,
99 default => 0,
100 private => 1
101 15 );
102  
103 has _ticks => (
104 is => 'rw',
105 isa => Int,
106 default => 0,
107 private => 1
108 15 );
109  
110 has _status => (
111 is => 'rw',
112 isa => Str,
113 default => 'ready',
114 private => 1
115 15 );
116  
117 has _placed => (
118 is => 'rw',
119 isa => Int,
120 default => 0,
121 private => 1
122 15 );
123  
124 has _last_rise => (
125 is => 'rw',
126 isa => Int,
127 default => 0,
128 private => 1
129 15 );
130  
131 has _speed => (
132 is => 'rw',
133 isa => Int,
134 default => 0,
135 private => 1
136 15 );
137  
138 3321 ▶my $place_food = sub {
Subroutine __ANON__: called CC=2 SCAR=6.9
139 3321 my ($self) = @_;
140 3321 my @free = $self->free_cells;
141 3321 ▶ return 0 unless @free;
Branch: 1 branch
BranchTrueFalseTotal
unless @free 1 3320 3321
142 3320 my $k = $self->_placed;
143 3320 my $hash = Digest::SHA::sha256($self->seed . "snake:food:$k");
144 3320 my $index = unpack('N', substr($hash, 0, 4)) % @free;
145 3320 $self->_food($free[$index]);
146 3320 $self->_placed($k + 1);
147 3320 return 1;
148 15 };
149  
150 1277 ▶my $lay = sub {
Subroutine __ANON__: called CC=1 SCAR=0.0
151 1277 my ($self) = @_;
152 1277 my $x = int($self->cols * 0.375);
153 1277 my $y = int($self->rows * 0.643);
154 1277 $self->_body([ map { [ $x + $_, $y ] } 0 .. $self->start_length - 1 ]);
155 1277 $self->_heading('left');
156 1277 $self->_queue([]);
157 1277 $self->_food(undef);
158 1277 $self->_cause(undef);
159 1277 $self->_error(undef);
160 1277 $self->_grow(0);
161 1277 $self->_score(0);
162 1277 $self->_ticks(0);
163 1277 $self->_status('ready');
164 1277 $self->_placed(0);
165 1277 $self->_last_rise($self->food_score);
166 1277 $self->_speed($self->start_speed);
167 1277 $self->$place_food;
168 1277 return $self;
169 15 };
170  
171 6 ▶my $refuse = sub {
Subroutine __ANON__: called CC=1 SCAR=0.0
172 6 my ($self, $code) = @_;
173 6 $self->_error(Game::Snake::Error->of($code));
174 6 return 0;
175 15 };
176  
177 98 ▶my $finish = sub {
Subroutine __ANON__: called CC=1 SCAR=0.0
178 98 my ($self, $cause) = @_;
179 98 $self->_status('finished');
180 98 $self->_cause($cause);
181 98 $self->_queue([]);
182 98 return { moved => 0, ate => 0, grew => 0, died => $cause };
183 15 };
184  
185 1285 ▶sub BUILD {
Subroutine BUILD: called CC=13 SCAR=25.7
Pod undocumented
186 1285 my ($self) = @_;
187  
188 1285 for my $name (qw/ cols rows start_length food_score start_speed /) {
189 6418 my $value = $self->$name;
190 6418 ▶ Carp::croak("Game::Snake: $name must be a whole number, not "
Branch: 2 branches
BranchTrueFalseTotal
unless defined $value and $value =~ /\A[0-9]+\z/u 2 6416 6418
defined $value ? : 1 1 2
Condition100%3/3
defined $value and $value =~ /\A[0-9]+\z/u
!ll&&!rl&&r
116416
MC/DC100%2/2
defined $value and $value =~ /\A[0-9]+\z/u
defined $value $value =~ /\A[0-9]+\z/u
Truth table100%3/3
A and B
A= defined $valueB= $value =~ /\A[0-9]+\z/u
ABresult
0X0
100
111
191 . (defined $value ? "'$value'" : 'undef'))
192 unless defined $value && $value =~ /\A[0-9]+\z/;
193 }
194  
195 1283 ▶ Carp::croak('Game::Snake: a board is at least 6 by 6')
Branch: 1 branch
BranchTrueFalseTotal
if $self->cols < 6 or $self->rows < 6 4 1279 1283
Condition66%2/3
$self->cols < 6 or $self->rows < 6
l!l&&r!l&&!r
401279
MC/DC50%1/2
$self->cols < 6 or $self->rows < 6
$self->cols < 6 $self->rows < 6
Truth table66%2/3
A or B
A= $self->cols < 6B= $self->rows < 6
ABresult
1X1
011
000
196 if $self->cols < 6 || $self->rows < 6;
197 1279 ▶ Carp::croak('Game::Snake: a snake starts at least 2 long')
Branch: 1 branch
BranchTrueFalseTotal
if $self->start_length < 2 1 1278 1279
198 if $self->start_length < 2;
199 1278 ▶ Carp::croak('Game::Snake: the speed starts at 1 or more')
Branch: 1 branch
BranchTrueFalseTotal
if $self->start_speed < 1 1 1277 1278
200 if $self->start_speed < 1;
201 1277 ▶ Carp::croak('Game::Snake: food is worth 1 or more')
Branch: 1 branch
BranchTrueFalseTotal
if $self->food_score < 1 1 1276 1277
202 if $self->food_score < 1;
203 1276 ▶ Carp::croak('Game::Snake: a seed is a string with something in it')
Branch: 1 branch
BranchTrueFalseTotal
unless defined $self->seed and CORE::length $self->seed 1 1275 1276
Condition66%2/3
defined $self->seed and CORE::length $self->seed
!ll&&!rl&&r
011275
MC/DC50%1/2
defined $self->seed and CORE::length $self->seed
defined $self->seed CORE::length $self->seed
Truth table66%2/3
A and B
A= defined $self->seedB= CORE::length $self->seed
ABresult
0X0
100
111
204 unless defined $self->seed && CORE::length $self->seed;
205 1275 ▶ Carp::croak('Game::Snake: a snake ' . $self->start_length
Branch: 1 branch
BranchTrueFalseTotal
if int($self->cols * "0.375") + $self->start_length > $self->cols 1 1274 1275
206 . ' long does not fit a board ' . $self->cols . ' wide')
207 if int($self->cols * 0.375) + $self->start_length > $self->cols;
208  
209 1274 $self->$lay;
210 1274 return;
211 }
212  
213 5846 ▶sub turn {
Subroutine turn: called CC=9 SCAR=22.0
Pod documented
214 5846 my ($self, $direction) = @_;
215  
216 Carp::croak("Game::Snake: '" . (defined $direction ? $direction : 'undef')
217 . "' is not a direction")
218 5846 ▶ unless defined $direction && $IS_DIRECTION{$direction};
Branch: 2 branches
BranchTrueFalseTotal
unless defined $direction and $IS_DIRECTION{$direction} 1 5845 5846
defined $direction ? : 1 0 1
Condition66%2/3
defined $direction and $IS_DIRECTION{$direction}
!ll&&!rl&&r
015845
MC/DC50%1/2
defined $direction and $IS_DIRECTION{$direction}
defined $direction $IS_DIRECTION{$direction}
Truth table66%2/3
A and B
A= defined $directionB= $IS_DIRECTION{$direction}
ABresult
0X0
100
111
219  
220 5845 ▶ return $self->$refuse('not_active') if $self->_status eq 'finished';
Branch: 1 branch
BranchTrueFalseTotal
if $self->_status eq "finished" 1 5844 5845
221  
222 5844 my $queue = $self->_queue;
223 5844 ▶ my $against = @$queue ? $queue->[0] : $self->_heading;
Branch: 1 branch
BranchTrueFalseTotal
@$queue ? : 7 5837 5844
224  
225 5844 ▶ return $self->$refuse('same_direction') if $direction eq $against;
Branch: 1 branch
BranchTrueFalseTotal
if $direction eq $against 2 5842 5844
226 5842 ▶ return $self->$refuse('reverse') if $direction eq $OPPOSITE{$against};
Branch: 1 branch
BranchTrueFalseTotal
if $direction eq $OPPOSITE{$against} 3 5839 5842
227  
228 5839 ▶ if (@$queue >= 2) {
Branch: 1 branch
BranchTrueFalseTotal
if (@$queue >= 2) { } 1 5838 5839
229 1 $queue->[1] = $direction;
230 }
231 else {
232 5838 push @$queue, $direction;
233 }
234  
235 5839 $self->_error(undef);
236 5839 return 1;
237 }
238  
239 27632 ▶sub tick {
Subroutine tick: called CC=18 SCAR=28.9
Pod documented
240 27632 my ($self) = @_;
241  
242 27632 ▶ return { moved => 0 } if $self->_status eq 'finished';
Branch: 1 branch
BranchTrueFalseTotal
if $self->_status eq "finished" 2 27630 27632
243  
244 27630 $self->_status('active');
245 27630 $self->_ticks($self->_ticks + 1);
246  
247 27630 my $queue = $self->_queue;
248 27630 ▶ $self->_heading(shift @$queue) if @$queue;
Branch: 1 branch
BranchTrueFalseTotal
if @$queue 5830 21800 27630
249  
250 27630 my $body = $self->_body;
251 27630 my ($dx, $dy) = @{ $DELTA{ $self->_heading } };
252 27630 my ($x, $y) = ($body->[0][0] + $dx, $body->[0][1] + $dy);
253  
254 27630 ▶ return $self->$finish('wall')
Branch: 1 branch
BranchTrueFalseTotal
if $x < 0 or $y < 0 or $x >= $self->cols or $y >= $self->rows 33 27597 27630
Condition100%9/9
$x < 0 or $y < 0 or $x >= $self->cols or $y >= $self->rows
l!l&&r!l&&!r
28527597
$x < 0 or $y < 0 or $x >= $self->cols
l!l&&r!l&&!r
22627602
$x < 0 or $y < 0
l!l&&r!l&&!r
71527608
MC/DC100%4/4
$x < 0 or $y < 0 or $x >= $self->cols or $y >= $self->rows
$x < 0 $y < 0 $x >= $self->cols $y >= $self->rows
Truth table100%5/5
A or B or C or D
A= $x < 0B= $y < 0C= $x >= $self->colsD= $y >= $self->rows
ABCDresult
1XXX1
01XX1
001X1
00011
00000
255 if $x < 0 || $y < 0 || $x >= $self->cols || $y >= $self->rows;
256  
257 27597 my $growing = $self->_grow > 0;
258 27597 ▶ my $last = $growing ? $#$body : $#$body - 1;
Branch: 1 branch
BranchTrueFalseTotal
$growing ? : 2028 25569 27597
259 27597 for my $i (0 .. $last) {
260 730754 ▶ return $self->$finish('body')
Branch: 1 branch
BranchTrueFalseTotal
if $body->[$i][0] == $x and $body->[$i][1] == $y 38 730716 730754
Condition100%3/3
$body->[$i][0] == $x and $body->[$i][1] == $y
!ll&&!rl&&r
6606007011638
MC/DC100%2/2
$body->[$i][0] == $x and $body->[$i][1] == $y
$body->[$i][0] == $x $body->[$i][1] == $y
Truth table100%3/3
A and B
A= $body->[$i][0] == $xB= $body->[$i][1] == $y
ABresult
0X0
100
111
261 if $body->[$i][0] == $x && $body->[$i][1] == $y;
262 }
263  
264 27559 unshift @$body, [ $x, $y ];
265 27559 ▶ if ($growing) {
Branch: 1 branch
BranchTrueFalseTotal
if ($growing) { } 2024 25535 27559
266 2024 $self->_grow($self->_grow - 1);
267 }
268 else {
269 25535 pop @$body;
270 }
271  
272 27559 ▶ my $step = { moved => 1, ate => 0, grew => ($growing ? 1 : 0), died => undef };
Branch: 1 branch
BranchTrueFalseTotal
$growing ? : 2024 25535 27559
273  
274 27559 my $food = $self->_food;
275 27559 ▶ if ($food && $food->[0] == $x && $food->[1] == $y) {
Branch: 1 branch
BranchTrueFalseTotal
if ($food and $food->[0] == $x and $food->[1] == $y) 2044 25515 27559
Condition83%5/6
$food and $food->[0] == $x and $food->[1] == $y
!ll&&!rl&&r
2090246132044
$food and $food->[0] == $x
!ll&&!rl&&r
0209026657
MC/DC66%2/3
$food and $food->[0] == $x and $food->[1] == $y
$food $food->[0] == $x $food->[1] == $y
Truth table75%3/4
A and B and C
A= $foodB= $food->[0] == $xC= $food->[1] == $y
ABCresult
0XX0
10X0
1100
1111
276 2044 $step->{ate} = 1;
277 2044 $self->_grow($self->_grow + 1);
278 2044 my $score = $self->_score + $self->food_score;
279 2044 $self->_score($score);
280 2044 ▶ if ($score >= 2 * $self->_last_rise) {
Branch: 1 branch
BranchTrueFalseTotal
if ($score >= 2 * $self->_last_rise) 278 1766 2044
281 278 $self->_speed($self->_speed + 1);
282 278 $self->_last_rise($score);
283 }
284 2044 $self->_food(undef);
285 2044 ▶ unless ($self->$place_food) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($self->$place_food) 1 2043 2044
286 1 $self->$finish('full');
287 1 $step->{died} = 'full';
288 }
289 }
290  
291 27559 return $step;
292 }
293  
294 27 ▶sub quit {
Subroutine quit: called CC=2 SCAR=6.9
Pod documented
295 27 my ($self) = @_;
296 27 ▶ return 0 if $self->_status eq 'finished';
Branch: 1 branch
BranchTrueFalseTotal
if $self->_status eq "finished" 1 26 27
297 26 $self->$finish('quit');
298 26 return 1;
299 }
300  
301 3 ▶sub reset {
Subroutine reset: called CC=1 SCAR=0.0
Pod documented
302 3 my ($self) = @_;
303 3 return $self->$lay;
304 }
305  
306 1742071 ▶sub _direction_from {
Subroutine _direction_from: called CC=4 SCAR=13.9
307 1742071 my ($from, $to) = @_;
308 1742071 my ($dx, $dy) = ($to->[0] - $from->[0], $to->[1] - $from->[1]);
309 1742071 for my $direction (@DIRECTIONS) {
310 4577712 my $delta = $DELTA{$direction};
311 4577712 ▶ return $direction if $delta->[0] == $dx && $delta->[1] == $dy;
Branch: 1 branch
BranchTrueFalseTotal
if $delta->[0] == $dx and $delta->[1] == $dy 1742071 2835641 4577712
Condition100%3/3
$delta->[0] == $dx and $delta->[1] == $dy
!ll&&!rl&&r
24588243768171742071
MC/DC100%2/2
$delta->[0] == $dx and $delta->[1] == $dy
$delta->[0] == $dx $delta->[1] == $dy
Truth table100%3/3
A and B
A= $delta->[0] == $dxB= $delta->[1] == $dy
ABresult
0X0
100
111
312 }
313 0 return undef;
314 }
315  
316 64051 ▶sub segments {
Subroutine segments: called CC=6 SCAR=17.9
Pod documented
317 64051 my ($self) = @_;
318  
319 64051 my $body = $self->_body;
320 64051 my $n = $#$body;
321  
322 64051 my @dir;
323 64051 for my $i (0 .. $n - 1) {
324 1742071 $dir[$i] = _direction_from($body->[ $i + 1 ], $body->[$i]);
325 }
326 64051 $dir[0] = $self->_heading;
327 64051 $dir[$n] = $dir[ $n - 1 ];
328  
329 64051 my @segments;
330 64051 for my $i (0 .. $n) {
331 1806122 ▶ my $bend = $i > 0 && $dir[ $i - 1 ] ne $dir[$i] ? $dir[ $i - 1 ] : 0;
Branch: 1 branch
BranchTrueFalseTotal
$i > 0 && $dir[$i - 1] ne $dir[$i] ? : 347116 1459006 1806122
Condition100%3/3
$i > 0 and $dir[$i - 1] ne $dir[$i]
!ll&&!rl&&r
640511394955347116
MC/DC100%2/2
$i > 0 and $dir[$i - 1] ne $dir[$i]
$i > 0 $dir[$i - 1] ne $dir[$i]
Truth table100%3/3
A and B
A= $i > 0B= $dir[$i - 1] ne $dir[$i]
ABresult
0X0
100
111
332 1806122 ▶ push @segments, {
Branch: 1 branch
BranchTrueFalseTotal
$i == $n ? : 64051 1742071 1806122
333 x => $body->[$i][0],
334 y => $body->[$i][1],
335 dir => $dir[$i],
336 bend => $bend,
337 last => ($i == $n ? 1 : 0),
338 };
339 }
340  
341 64051 return \@segments;
342 }
343  
344 2263 ▶sub at {
Subroutine at: called CC=9 SCAR=22.0
Pod documented
345 2263 my ($self, $x, $y) = @_;
346  
347 2263 my $body = $self->_body;
348 2263 for my $i (0 .. $#$body) {
349 30490 ▶ next unless $body->[$i][0] == $x && $body->[$i][1] == $y;
Branch: 1 branch
BranchTrueFalseTotal
unless $body->[$i][0] == $x and $body->[$i][1] == $y 30177 313 30490
Condition100%3/3
$body->[$i][0] == $x and $body->[$i][1] == $y
!ll&&!rl&&r
264243753313
MC/DC100%2/2
$body->[$i][0] == $x and $body->[$i][1] == $y
$body->[$i][0] == $x $body->[$i][1] == $y
Truth table100%3/3
A and B
A= $body->[$i][0] == $xB= $body->[$i][1] == $y
ABresult
0X0
100
111
350 313 ▶ return 'head' if $i == 0;
Branch: 1 branch
BranchTrueFalseTotal
if $i == 0 2 311 313
351 311 ▶ return 'tail' if $i == $#$body;
Branch: 1 branch
BranchTrueFalseTotal
if $i == $body->$#* 25 286 311
352 286 return 'body';
353 }
354  
355 1950 my $food = $self->_food;
356 1950 ▶ return 'food' if $food && $food->[0] == $x && $food->[1] == $y;
Branch: 1 branch
BranchTrueFalseTotal
if $food and $food->[0] == $x and $food->[1] == $y 142 1808 1950
Condition83%5/6
$food and $food->[0] == $x and $food->[1] == $y
!ll&&!rl&&r
1528280142
$food and $food->[0] == $x
!ll&&!rl&&r
01528422
MC/DC66%2/3
$food and $food->[0] == $x and $food->[1] == $y
$food $food->[0] == $x $food->[1] == $y
Truth table75%3/4
A and B and C
A= $foodB= $food->[0] == $xC= $food->[1] == $y
ABCresult
0XX0
10X0
1100
1111
357  
358 1808 return undef;
359 }
360  
361 3325 ▶sub free_cells {
Subroutine free_cells: called CC=5 SCAR=16.1
Pod documented
362 3325 my ($self) = @_;
363  
364 3325 my %taken;
365 3325 $taken{ $_->[0] . ',' . $_->[1] }++ for @{ $self->_body };
366  
367 3325 my @free;
368 3325 for my $y (0 .. $self->rows - 1) {
369 34788 for my $x (0 .. $self->cols - 1) {
370 511873 ▶ push @free, [ $x, $y ] unless $taken{"$x,$y"};
Branch: 1 branch
BranchTrueFalseTotal
unless $taken{"$x,$y"} 463814 48059 511873
371 }
372 }
373  
374 3325 return @free;
375 }
376  
377 29008 ▶sub food {
Subroutine food: called CC=2 SCAR=6.9
Pod documented
378 29008 my ($self) = @_;
379 29008 my $food = $self->_food;
380 29008 ▶ return $food ? [ @$food ] : undef;
Branch: 1 branch
BranchTrueFalseTotal
$food ? : 29007 1 29008
381 }
382  
383 20392 ▶sub length { return scalar @{ $_[0]->_body } }
Subroutine length: called CC=1 SCAR=0.0
Pod documented
384 30412 ▶sub growing { return $_[0]->_grow }
Subroutine growing: called CC=1 SCAR=0.0
Pod documented
385 59177 ▶sub heading { return $_[0]->_heading }
Subroutine heading: called CC=1 SCAR=0.0
Pod documented
386 58048 ▶sub status { return $_[0]->_status }
Subroutine status: called CC=1 SCAR=0.0
Pod documented
387 619 ▶sub score { return $_[0]->_score }
Subroutine score: called CC=1 SCAR=0.0
Pod documented
388 1170 ▶sub speed { return $_[0]->_speed }
Subroutine speed: called CC=1 SCAR=0.0
Pod documented
389 26837 ▶sub ticks { return $_[0]->_ticks }
Subroutine ticks: called CC=1 SCAR=0.0
Pod documented
390 11 ▶sub error { return $_[0]->_error }
Subroutine error: called CC=1 SCAR=0.0
Pod documented
391  
392 49 ▶sub result {
Subroutine result: called CC=2 SCAR=6.9
Pod documented
393 49 my ($self) = @_;
394 49 ▶ return undef unless $self->_status eq 'finished';
Branch: 1 branch
BranchTrueFalseTotal
unless $self->_status eq "finished" 2 47 49
395 47 return Game::Snake::Result->new(
396 cause => $self->_cause,
397 score => $self->_score,
398 length => $self->length,
399 ticks => $self->_ticks,
400 speed => $self->_speed,
401 );
402 }
403  
404 15 1;
405  
406 __END__
« blib/lib/Game/Snake/Terminal.pm ↑ Summary blib/lib/Game/Snake/Bot.pm »