line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# $Id: ScottAdams.pm,v 1.5 2006/11/02 18:04:37 mike Exp $ |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
# ScottAdams.pm - a compiler for Scott Adams adventures |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
package Games::ScottAdams; |
6
|
1
|
|
|
1
|
|
2030
|
use strict; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
71
|
|
7
|
|
|
|
|
|
|
|
8
|
1
|
|
|
1
|
|
7
|
use vars qw($VERSION); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
111
|
|
9
|
|
|
|
|
|
|
$VERSION = '0.04'; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
=head1 NAME |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
Games::ScottAdams - Perl extension for representing Scott Adams games |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
=head1 SYNOPSIS |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
use Games::ScottAdams; |
18
|
|
|
|
|
|
|
$game = new Games::ScottAdams::Game(); |
19
|
|
|
|
|
|
|
$game->parse('/usr/local/lib/sac/foo.sac'); |
20
|
|
|
|
|
|
|
$game->compile(); |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
=head1 DESCRIPTION |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
This module allows adventure games in the textual SAC format to be |
25
|
|
|
|
|
|
|
compiled into a form that can be understood by Scott Adams adventure |
26
|
|
|
|
|
|
|
interpreters such as ScottFree and GnomeScott. |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
I don't propose to discuss the API because frankly, no-one will ever |
29
|
|
|
|
|
|
|
call it. They'll just use the trivial front-end program C which |
30
|
|
|
|
|
|
|
is essentially identical to the code in the SYNOPSIS, but with a few |
31
|
|
|
|
|
|
|
more C |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
You'd do much better to read the Tutorial and Reference Manual. |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
=head1 SEE ALSO |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
I |
39
|
|
|
|
|
|
|
(B) |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
I |
42
|
|
|
|
|
|
|
(B) |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
C, the Scott Adams Compiler that uses this module. |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
=head1 AUTHOR |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
Mike Taylor Emike@miketaylor.org.ukE |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
First version Tuesday 17th April 2001. |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
=cut |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
|
55
|
1
|
|
|
1
|
|
1179
|
use Games::ScottAdams::Game; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
35
|
|
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
1; |
58
|
|
|
|
|
|
|
__END__ |