line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Games::Wumpus::Constants; |
2
|
|
|
|
|
|
|
|
3
|
6
|
|
|
6
|
|
56494
|
use 5.010; |
|
6
|
|
|
|
|
23
|
|
|
6
|
|
|
|
|
238
|
|
4
|
|
|
|
|
|
|
|
5
|
6
|
|
|
6
|
|
32
|
use strict; |
|
6
|
|
|
|
|
13
|
|
|
6
|
|
|
|
|
203
|
|
6
|
6
|
|
|
6
|
|
29
|
use warnings; |
|
6
|
|
|
|
|
15
|
|
|
6
|
|
|
|
|
202
|
|
7
|
6
|
|
|
6
|
|
29
|
no warnings 'syntax'; |
|
6
|
|
|
|
|
10
|
|
|
6
|
|
|
|
|
341
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
our $VERSION = '2009112401'; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
# |
12
|
|
|
|
|
|
|
# Contants used in the Wumpus game. |
13
|
|
|
|
|
|
|
# |
14
|
|
|
|
|
|
|
|
15
|
6
|
|
|
6
|
|
38
|
use Exporter (); |
|
6
|
|
|
|
|
11
|
|
|
6
|
|
|
|
|
2141
|
|
16
|
|
|
|
|
|
|
our @ISA = 'Exporter'; |
17
|
|
|
|
|
|
|
our @EXPORT = qw [ |
18
|
|
|
|
|
|
|
$WUMPUS $BAT $PIT $PLAYER @HAZARDS |
19
|
|
|
|
|
|
|
$NR_OF_WUMPUS $NR_OF_BATS $NR_OF_PITS $NR_OF_ARROWS |
20
|
|
|
|
|
|
|
$WUMPUS_MOVES |
21
|
|
|
|
|
|
|
@CLASSICAL_LAYOUT |
22
|
|
|
|
|
|
|
]; |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
# |
25
|
|
|
|
|
|
|
# Hazards |
26
|
|
|
|
|
|
|
# |
27
|
|
|
|
|
|
|
our $WUMPUS = 1 << 0; |
28
|
|
|
|
|
|
|
our $BAT = 1 << 1; |
29
|
|
|
|
|
|
|
our $PIT = 1 << 2; |
30
|
|
|
|
|
|
|
our $PLAYER = 1 << 3; |
31
|
|
|
|
|
|
|
our @HAZARDS = ($WUMPUS, $BAT, $PIT); |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
our $NR_OF_WUMPUS = 1; |
34
|
|
|
|
|
|
|
our $NR_OF_BATS = 2; |
35
|
|
|
|
|
|
|
our $NR_OF_PITS = 2; |
36
|
|
|
|
|
|
|
our $NR_OF_ARROWS = 5; |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
our $WUMPUS_MOVES = .75; # Change of Wumpus moving when woken up. |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
# |
41
|
|
|
|
|
|
|
# Classical |
42
|
|
|
|
|
|
|
# |
43
|
|
|
|
|
|
|
our @CLASSICAL_LAYOUT = ( |
44
|
|
|
|
|
|
|
[ 1, 4, 7], [ 0, 2, 9], [ 1, 3, 11], [ 2, 4, 13], |
45
|
|
|
|
|
|
|
[ 0, 3, 5], [ 4, 6, 14], [ 5, 7, 16], [ 0, 6, 8], |
46
|
|
|
|
|
|
|
[ 7, 9, 17], [ 1, 8, 10], [ 9, 11, 18], [ 2, 10, 12], |
47
|
|
|
|
|
|
|
[11, 13, 19], [ 3, 12, 14], [ 5, 13, 15], [14, 16, 19], |
48
|
|
|
|
|
|
|
[ 6, 15, 17], [ 8, 16, 18], [10, 17, 19], [12, 15, 18], |
49
|
|
|
|
|
|
|
); |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
1; |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
__END__ |