ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/Games-Go-SGF-Grove/Grove.pm
Revision: 1.6
Committed: Sun Jul 20 22:21:26 2008 UTC (15 years, 11 months ago) by root
Branch: MAIN
Changes since 1.5: +1 -2 lines
Log Message:
*** empty log message ***

File Contents

# Content
1 =head1 NAME
2
3 Games::Go::SGF::Grove - SGF the Perl way
4
5 =head1 SYNOPSIS
6
7 use Games::Go::SGF::Grove;
8
9 $game = load_sgf $path;
10 save_sgf $path, $game;
11
12 $game = decode_sgf $sgf_data;
13 $sgf_data = encode_sgf $game;
14
15 =head1 DESCRIPTION
16
17 This module loads and saves Go SGF files. Unlike other modules, it doesn't
18 build a very fancy data structure with lot's of java-like accessors
19 but instead returns a simple Perl data structure you can inspect with
20 Data::Dumper and modify easily. The structure follows the SGF file format
21 very closely.
22
23 The SGF format is documented here: L<http://www.red-bean.com/sgf/>.
24
25 All the functions below use a common data format and throw exceptions on
26 any errors.
27
28 =over 4
29
30 =cut
31
32 package Games::Go::SGF::Grove;
33
34 use base Exporter;
35
36 use strict;
37 no warnings;
38
39 our $VERSION = 0.1;
40 our @EXPORT = qw(load_sgf save_sgf encode_sgf decode_sgf);
41
42 =item $game = load_sgf $path
43
44 Tries to read the file given by C<$path> and parses it as an SGF file,
45 returning the parsed data structure.
46
47 =item save_sgf $path, $game
48
49 Saves the SGF data to the specified file.
50
51 =item $game = decode_sgf $sgf_data
52
53 Tries to parse the given string into a Pelr data structure and returns it.
54
55 =item $sgf_data = encode_sgf $game
56
57 Takes a Perl data structure and serialises it into an SGF file. Anything
58 stored in the structure that isn't understood by this module will be
59 silently ignored.
60
61 =cut
62
63 sub decode_sgf($) {
64 my ($sgf_data) = @_;
65
66 Games::Go::SGF::Grove::Parser::->new->decode_sgf ($sgf_data)
67 }
68
69 sub encode_sgf($) {
70 my ($game) = @_;
71
72 Games::Go::SGF::Grove::Parser::->new->encode_sgf ($game)
73 }
74
75 sub load_sgf($) {
76 my ($path) = @_;
77
78 open my $fh, "<:perlio", $path
79 or die "$path: $!";
80
81 local $/;
82 decode_sgf <$fh>
83 }
84
85 sub save_sgf($$) {
86 my ($path, $game) = @_;
87
88 open my $fh, ">:perlio", $path
89 or die "$path: $!";
90
91 print $fh encode_sgf $game;
92 }
93
94 =back
95
96 =head2 The Game Data structure
97
98 The SGF game is represented by a linked Perl data structure consisting of
99 unblessed hashes and arrays.
100
101 SGF files are a forest of trees, called a collection (i.e. you can have
102 multiple games stored in a file). The C<load_sgf> and C<decode_sgf>
103 functions returns this collection as a reference to an array containing
104 the individual game trees (usually there is only one, though).
105
106 Each individual tree is again an array of nodes representing the main line
107 of play.
108
109 Each node is simply a hash reference. Each SGF property is stored with the
110 (uppercase) property name as the key, and a property-dependent value for
111 the contents (e.g., a black move is stored as C<< B => [3, 5] >>.
112
113 If there are any variations/branches/alternate lines of play, then these
114 are stored in the array reference in the C<variations> key (those again
115 are game trees, so array references themselves).
116
117 This module reserves all uppercase key names for SGF properties, the key
118 C<variations> and all keys starting with an underscore (C<_xxx>) as it's
119 own. Users of this module may store additional attributes that don't
120 conflict with these names in any node.
121
122 Unknown properties will be stored as scalars with the (binary) property
123 contents. Text nodes will always be decoded into Unicode text and encoded
124 into whatever the CA property of the root node says (default: C<UTF-8>).
125
126 When saving, all uppercase keys will be saved, lowercase keys will be
127 ignored.
128
129 For the actual encoding of other types, best decode some example game that
130 contains them and use Data::Dumper. Here is such an example:
131
132 [ # list of game-trees, only one here
133 [ # the main node sequence
134 { # the root node, contains some variations
135 DI => '7k',
136 AP => undef,
137 CO => '5',
138 DP => '40',
139 GE => 'tesuji',
140 AW => [
141 [ 2, 16 ], [ 3, 15 ], [ 15, 9 ], [ 14, 13 ], ...
142 ],
143 C => 'White just played a ladder block at h12.',
144 variations => [ # list of variations, only one
145 [ # sequence of variation moves
146 { B => [ 7, 5 ] }, # a black move
147 { W => [ 12, 12 ] }, # a white move
148 ... and so on
149 ]
150 ],
151 }
152 ]
153 }
154
155 =cut
156
157 package Games::Go::SGF::Grove::Parser;
158
159 no warnings;
160 use strict 'vars';
161
162 use Encode ();
163 use Carp qw(croak);
164
165 my $ws = qr{[\x00-\x20]*}s;
166 my $property; # property => propertyinfo
167
168 sub new {
169 my $class = shift;
170 bless { @_ }, $class;
171 }
172
173 sub error {
174 my ($self, $error) = @_;
175
176 my $pos = pos $self->{sgf};
177
178 my $tail = substr $self->{sgf}, $pos, 32;
179 $tail =~ s/[\x00-\x1f]+/ /g;
180
181 croak "$error (at octet $pos, '$tail')";
182 }
183
184 sub decode_sgf {
185 my ($self, $sgf) = @_;
186
187 # correct lines
188 if ($sgf =~ /[^\015\012]\015/) {
189 $sgf =~ s/\015\012?/\n/g;
190 } else {
191 $sgf =~ s/\012\015?/\n/g;
192 }
193
194 $self->{sgf} = $sgf;
195
196 $self->{FF} = 1;
197 $self->{CA} = 'WINDOWS-1252'; # too many files are
198 $self->{GM} = 1;
199
200 my @trees;
201
202 eval {
203 while ($self->{sgf} =~ /\G$ws(?=\()/sgoc) {
204 push @trees, $self->decode_GameTree;
205 }
206 };
207
208 croak $@ if $@;
209
210 \@trees
211 }
212
213 sub decode_GameTree {
214 my ($self) = @_;
215
216 $self->{sgf} =~ /\G$ws\(/sgoc
217 or $self->error ("GameTree does not start with '('");
218
219 my $nodes = $self->decode_Sequence;
220
221 while ($self->{sgf} =~ /\G$ws(?=\()/sgoc) {
222 push @{$nodes->[-1]{variations}}, $self->decode_GameTree;
223 }
224 $self->{sgf} =~ /\G$ws\)/sgoc
225 or $self->error ("GameTree does not end with ')'");
226
227 $nodes
228 }
229
230 sub postprocess {
231 my $self = shift;
232
233 for (@_) {
234 if ("ARRAY" eq ref) {
235 $self->postprocess (@$_);
236 } elsif ("HASH" eq ref) {
237 if (my $value = $_->{_text}) {
238 $value =~ s/\\\n/ /g;
239 $value =~ s/\\(.)/$1/g;
240 $_ = eval { Encode::decode $self->{CA}, $value } || $value
241 } else {
242 $self->postprocess (values %$_);
243 }
244 }
245 }
246 }
247
248 sub decode_Sequence {
249 my ($self) = @_;
250
251 my (@nodes, $node, $name, $value, $prop, @val);
252
253 while ($self->{sgf} =~ /\G$ws;/goc) {
254 push @nodes, $node = {};
255 # Node
256 while ($self->{sgf} =~ /\G$ws([A-Z]+)/goc) {
257 # Property
258 $name = $1;
259 $prop = $property->{$name};
260
261 while ($self->{sgf} =~ /\G$ws\[((?:[^\\\]]*|\\.)*)\]/sgoc) {
262 # PropValue
263 $value = $1;
264 if ($prop) {
265 @val = $prop->{in}->($self, $value, $prop);
266
267 if ($prop->{is_list}) {
268 push @{$node->{$name}}, @val
269 } else {
270 $node->{$name} = $val[0];
271
272 $self->{CA} = $val[0] if $name eq "CA";
273 }
274 } else {
275 #warn "unknown property '$name', will be saved unchanged.";#d#
276 push @{$node->{$name}}, $value;
277 }
278 }
279 }
280
281 # postprocess nodes, currently only to decode text and simpletext
282 $self->postprocess ($node);
283 }
284
285 \@nodes
286 }
287
288 sub encode_sgf($) {
289 my ($self, $game) = @_;
290
291 $self->{sgf} = "";
292
293 $self->{FF} = 4;
294 $self->{CA} = 'UTF-8';
295 $self->{GM} = 1;
296 $self->{AP} = ["Games::Go::SGF::Grove", $VERSION];
297
298 $self->encode_GameTree ($_, 1) for @$game;
299
300 $self->{sgf}
301 }
302
303 sub encode_GameTree {
304 my ($self, $sequence, $is_root) = @_;
305
306 if ($is_root) {
307 my $root = $sequence->[0];
308
309 $root->{CA} ||= $self->{CA};
310 $root->{FF} ||= $self->{FF};
311 $root->{GM} ||= $self->{GM};
312 $root->{AP} ||= $self->{AP};
313
314 $self->{CA} = $root->{CA};
315 }
316
317 $self->{sgf} .= "(";
318 $self->encode_Sequence ($sequence);
319 $self->{sgf} .= ")";
320 }
321
322 sub encode_Sequence {
323 my ($self, $sequence) = @_;
324
325 for my $node (@$sequence) {
326 $self->{sgf} .= ";";
327
328 while (my ($name, $value) = each %$node) {
329 next unless $name eq uc $name;
330
331 $self->{sgf} .= "$name\[";
332
333 if (my $prop = $property->{$name}) {
334 if ($prop->{is_list}) {
335 $self->{sgf} .= join "][", map $prop->{out}->($self, $_), @$value;
336 } else {
337 $self->{sgf} .= $prop->{out}->($self, $value);
338 }
339 } else {
340 $self->{sgf} .= join "][", @$value;
341 }
342
343 $self->{sgf} .= "]";
344 }
345
346 $self->encode_GameTree ($_) for @{ $node->{variations} };
347 }
348 }
349
350 #############################################################################
351
352 =head2 Property Type Structure
353
354 A property type is a hash like this:
355
356 {
357 name => "SQ",
358 group => {
359 name => "Markup properties",
360 restrictions => "CR, MA, SL, SQ and TR points must be unique, ...",
361 },
362 related => "TR, CR, LB, SL, AR, MA, LN",
363 function => "Marks the given points with a square.\nPoints must be unique.",
364 propertytype => "-",
365 propvalue => "list of point"
366 is_list => 1,
367 }
368
369 =cut
370
371
372 {
373 my ($group, $name, $value, $prop);
374
375 my (%char2coord, %coord2char);
376
377 {
378 my @coord = ("a" .. "z", "A" .. "Z");
379
380 for (0.. $#coord) {
381 $char2coord{ $coord[$_] } = $_;
382 $coord2char{ $_ } = $coord[$_];
383 }
384 }
385
386 sub _parsetype($);
387 sub _parsetype {
388 for (shift) {
389 if (s/e?list of //) {
390 $prop->{is_list} = 1;
391 return _parsetype $_;
392
393 } elsif (s/composed (\S+)\s+(?:':'\s+)?(\S+)//) {
394 $prop->{composed} = 1;
395 my ($i, $o) = ($1, $2);
396 my ($i1, $o1, $i2, $o2) = (_parsetype $i, _parsetype $o);
397 return (
398 sub {
399 if ($_[1] =~ /^((?:[^\\:]+|\\.)*)(?::(.*))$/s) {
400 # or $_[0]->error ("'Compose' ($i:$o) expected, got '$_[1]'");
401 my ($l, $r) = ($1, $2);
402
403 [
404 $i1->($_[0], $l),
405 defined $r ? $i2->($_[0], $r) : undef,
406 ]
407 } else {
408 # yes, this is not according to standard, but let's handle it somehow anyway
409 #[ $i1->($_[0], $l) ] #d# #TODO#
410 }
411 },
412 sub {
413 $o1->($_[0], $_[1][0])
414 . ":"
415 . $o2->($_[0], $_[1][1])
416 },
417 );
418
419 } elsif (s/double//) {
420 return (
421 sub {
422 $_[1] =~ /^[12]$/
423 or $_[0]->error ("'Double' (1|2) expected, got '$_[1]'");
424 $_[1]
425 },
426 sub {
427 $_[1]
428 },
429 );
430 } elsif (s/color//) {
431 return (
432 sub {
433 # too many broken programs write this wrong
434 return "B" if $_[1] eq "1";
435 return "W" if $_[1] eq "2";
436
437 $_[1] =~ /^[BW]$/i
438 or $_[0]->error ("'Color' (B|W) expected, got '$_[1]'");
439 lc $_[1]
440 },
441 sub {
442 uc $_[1]
443 },
444 );
445 } elsif (s/none//) {
446 return (
447 sub {
448 $_[1] =~ /^$/i
449 or $_[0]->error ("'None' expected, got '$_[1]'");
450 undef
451 },
452 sub {
453 "",
454 },
455 );
456 } elsif (s/point// || s/move// || s/stone//) {
457 return (
458 sub {
459 if ($_[2]->{is_list}) {
460 if ($_[1] =~ /^([^:]+):(.*)$/) {
461 my ($ul, $dr) = ($1, $2);
462 my ($x1, $y1) = map $char2coord{$_}, split //, $ul;
463 my ($x2, $y2) = map $char2coord{$_}, split //, $dr;
464 my @stones;
465 for (my $d = $x1; $d < $x2; $d++) {
466 for (my $i = $y1; $i < $y2; $i++) {
467 push @stones, [$d, $i];
468 }
469 }
470 return @stones;
471 }
472 }
473 $_[1] =~ /^(.)(.)$/
474 ? [ $char2coord{$1}, $char2coord{$2} ]
475 : []
476 },
477 sub {
478 $coord2char{$_[1][0]} . $coord2char{$_[1][1]}
479 },
480 );
481 } elsif (s/real//) {
482 return (
483 sub {
484 $_[1] =~ /^[+-]?[0-9]*\.?[0-9]*$/i
485 or $_[0]->error ("'Real' expected, got '$_[1]'");
486 $_[1]+0
487 },
488 sub {
489 $_[1]+0
490 },
491 );
492 } elsif (s/number//) {
493 return (
494 sub {
495 $_[1] =~ /^[+-]?[0-9]*$/i
496 or $_[0]->error ("'Number' expected, got '$_[1]'");
497 $_[1]+0
498 },
499 sub {
500 int $_[1]
501 },
502 );
503 } elsif (s/text// || s/simpletext//i) {
504 return (
505 sub {
506 { _text => $_[1] }
507 },
508 sub {
509 my $str = Encode::encode $_[0]{CA}, $_[1];
510 $str =~ s/([\:\]\\])/\\$1/g;
511 $str
512 },
513 );
514 } else {
515 die "FATAL: garbled DATA section, unknown type '$_'";
516 }
517 }
518 }
519
520 while (<DATA>) {
521 if (/^(\S+):\t(.*)/) {
522 if ($name eq "Restrictions") {
523 $group->{restrictions} = $value;
524 } elsif ($name eq "Property") {
525 $property->{$value} =
526 $prop = {
527 name => $value,
528 group => $group,
529 };
530 } elsif ($name ne "") {
531 $prop->{lc $name} = $value;
532 if ($name eq "Propvalue") {
533 ($prop->{in}, $prop->{out}) = _parsetype $value;
534 }
535 }
536 $name = $1;
537 $value = $2;
538 } elsif (/^\t\t(.*)/) {
539 $value .= "\n$1";
540 } elsif (/(\S.*)/) {
541 $group = {
542 name => $1,
543 };
544 } elsif (/^$/) {
545 # nop
546 } else {
547 die "FATAL: DATA section garbled\n";
548 }
549 }
550 }
551
552 1;
553
554 =head1 AUTHOR
555
556 Marc Lehmann <schmorp@schmorp.de>
557 Robin Redeker <elmex@ta-sa.org>
558
559 =cut
560
561 # now node descriptions follow
562
563 __DATA__
564 Move properties
565
566 Property: B
567 Propvalue: move
568 Propertytype: move
569 Function: Execute a black move. This is one of the most used properties
570 in actual collections. As long as
571 the given move is syntactically correct it should be executed.
572 It doesn't matter if the move itself is illegal
573 (e.g. recapturing a ko in a Go game).
574 Have a look at how to execute a Go-move.
575 B and W properties must not be mixed within a node.
576 Related: W, KO
577
578 Property: KO
579 Propvalue: none
580 Propertytype: move
581 Function: Execute a given move (B or W) even it's illegal. This is
582 an optional property, SGF viewers themselves should execute
583 ALL moves. It's purpose is to make it easier for other
584 applications (e.g. computer-players) to deal with illegal
585 moves. A KO property without a black or white move within
586 the same node is illegal.
587 Related: W, B
588
589 Property: MN
590 Propvalue: number
591 Propertytype: move
592 Function: Sets the move number to the given value, i.e. a move
593 specified in this node has exactly this move-number. This
594 can be useful for variations or printing.
595 Related: B, W, FG, PM
596
597 Property: W
598 Propvalue: move
599 Propertytype: move
600 Function: Execute a white move. This is one of the most used properties
601 in actual collections. As long as
602 the given move is syntactically correct it should be executed.
603 It doesn't matter if the move itself is illegal
604 (e.g. recapturing a ko in a Go game).
605 Have a look at how to execute a Go-move.
606 B and W properties must not be mixed within a node.
607 Related: B, KO
608
609 Setup properties
610 Restrictions: AB, AW and AE must have unique points, i.e. it is illegal to place different colors on the same point within one node.
611 AB, AW and AE values which don't change the board, e.g. placing a black stone with AB[] over a black stone that's already there, is bad style. Applications may want to delete these values and issue a warning.
612
613 Property: AB
614 Propvalue: list of stone
615 Propertytype: setup
616 Function: Add black stones to the board. This can be used to set up
617 positions or problems. Adding is done by 'overwriting' the
618 given point with black stones. It doesn't matter what
619 was there before. Adding a stone doesn't make any prisoners
620 nor any other captures (e.g. suicide). Thus it's possible
621 to create illegal board positions.
622 Points used in stone type must be unique.
623 Related: AW, AE, PL
624
625 Property: AE
626 Propvalue: list of point
627 Propertytype: setup
628 Function: Clear the given points on the board. This can be used
629 to set up positions or problems. Clearing is done by
630 'overwriting' the given points, so that they contain no
631 stones. It doesn't matter what was there before.
632 Clearing doesn't count as taking prisoners.
633 Points must be unique.
634 Related: AB, AW, PL
635
636 Property: AW
637 Propvalue: list of stone
638 Propertytype: setup
639 Function: Add white stones to the board. This can be used to set up
640 positions or problems. Adding is done by 'overwriting' the
641 given points with white stones. It doesn't matter what
642 was there before. Adding a stone doesn't make any prisoners
643 nor any other captures (e.g. suicide). Thus it's possible
644 to create illegal board positions.
645 Points used in stone type must be unique.
646 Related: AB, AE, PL
647
648 Property: PL
649 Propvalue: color
650 Propertytype: setup
651 Function: PL tells whose turn it is to play. This can be used when
652 setting up positions or problems.
653 Related: AE, AB, AW
654
655 Node annotation properties
656
657 Property: C
658 Propvalue: text
659 Propertytype: -
660 Function: Provides a comment text for the given node. The purpose of
661 providing both a node name and a comment is to have a short
662 identifier like "doesn't work" or "Dia. 15" that can be
663 displayed directly with the properties of the node, even if
664 the comment is turned off or shown in a separate window.
665 See text-type for more info.
666 Related: N, ST, V, UC, DM, HO
667
668 Property: DM
669 Propvalue: double
670 Propertytype: -
671 Function: The position is even. SGF viewers should display a
672 message. This property may indicate main variations in
673 opening libraries (joseki) too. Thus DM[2] indicates an
674 even result for both players and that this is a main
675 variation of this joseki/opening.
676 This property must not be mixed with UC, GB or GW
677 within a node.
678 Related: UC, GW, GB
679
680 Property: GB
681 Propvalue: double
682 Propertytype: -
683 Function: Something good for black. SGF viewers should display a
684 message. The property is not related to any specific place
685 on the board, but marks the whole node instead.
686 GB must not be mixed with GW, DM or UC within a node.
687 Related: GW, C, UC, DM
688
689 Property: GW
690 Propvalue: double
691 Propertytype: -
692 Function: Something good for white. SGF viewers should display a
693 message. The property is not related to any specific place
694 on the board, but marks the whole node instead.
695 GW must not be mixed with GB, DM or UC within a node.
696 Related: GB, C, UC, DM
697
698 Property: HO
699 Propvalue: double
700 Propertytype: -
701 Function: Node is a 'hotspot', i.e. something interesting (e.g.
702 node contains a game-deciding move).
703 SGF viewers should display a message.
704 The property is not related to any specific place
705 on the board, but marks the whole node instead.
706 Sophisticated applications could implement the navigation
707 command next/previous hotspot.
708 Related: GB, GW, C, UC, DM
709
710 Property: N
711 Propvalue: simpletext
712 Propertytype: -
713 Function: Provides a name for the node. For more info have a look at
714 the C-property.
715 Related: C, ST, V
716
717 Property: UC
718 Propvalue: double
719 Propertytype: -
720 Function: The position is unclear. SGF viewers should display a
721 message. This property must not be mixed with DM, GB or GW
722 within a node.
723 Related: DM, GW, GB
724
725 Property: V
726 Propvalue: real
727 Propertytype: -
728 Function: Define a value for the node. Positive values are good for
729 black, negative values are good for white.
730 The interpretation of particular values is game-specific.
731 In Go, this is the estimated score.
732 Related: C, N, RE
733
734 Move annotation properties
735 Restrictions: Move annotation properties without a move (B[] or W[]) within the same node are senseless and therefore illegal. Applications should delete such properties and issue a warning.
736 BM, TE, DO and IT are mutual exclusive, i.e. they must not be mixed within a single node.
737
738 Property: BM
739 Propvalue: double
740 Propertytype: move
741 Function: The played move is bad.
742 Viewers should display a message.
743 Related: TE, DO, IT
744
745 Property: DO
746 Propvalue: none
747 Propertytype: move
748 Function: The played move is doubtful.
749 Viewers should display a message.
750 Related: BM, TE, IT
751
752 Property: IT
753 Propvalue: none
754 Propertytype: move
755 Function: The played move is interesting.
756 Viewers should display a message.
757 Related: BM, DO, TE
758
759 Property: TE
760 Propvalue: double
761 Propertytype: move
762 Function: The played move is a tesuji (good move).
763 Viewers should display a message.
764 Related: BM, DO, IT
765
766 Markup properties
767 Restrictions: CR, MA, SL, SQ and TR points must be unique, i.e. it's illegal to have two or more of these markups on the same point within a node.
768
769 Property: AR
770 Propvalue: list of composed point point
771 Propertytype: -
772 Function: Viewers should draw an arrow pointing FROM the first point
773 TO the second point.
774 It's illegal to specify the same arrow twice,
775 e.g. (Go) AR[aa:bb][aa:bb]. Different arrows may have the same
776 starting or ending point though.
777 It's illegal to specify a one point arrow, e.g. AR[cc:cc]
778 as it's impossible to tell into which direction the
779 arrow points.
780 Related: TR, CR, LB, SL, MA, SQ, LN
781
782 Property: CR
783 Propvalue: list of point
784 Propertytype: -
785 Function: Marks the given points with a circle.
786 Points must be unique.
787 Related: TR, MA, LB, SL, AR, SQ, LN
788
789 Property: DD
790 Propvalue: elist of point
791 Propertytype: inherit
792 Function: Dim (grey out) the given points.
793 DD[] clears any setting, i.e. it undims everything.
794 Related: VW
795
796 Property: LB
797 Propvalue: list of composed point simpletext
798 Propertytype: -
799 Function: Writes the given text on the board. The text should be
800 centered around the given point. Note: there's no longer
801 a restriction to the length of the text to be displayed.
802 Have a look at the FF4 example file on possibilities
803 to display long labels (pictures five and six).
804 Points must be unique.
805 Related: TR, CR, MA, SL, AR, SQ, LN
806
807 Property: LN
808 Propvalue: list of composed point point
809 Propertytype: -
810 Function: Applications should draw a simple line form one point
811 to the other.
812 It's illegal to specify the same line twice,
813 e.g. (Go) LN[aa:bb][aa:bb]. Different lines may have the same
814 starting or ending point though.
815 It's illegal to specify a one point line, e.g. LN[cc:cc].
816 Related: TR, CR, MA, SL, AR, SQ, LB
817
818
819 Property: MA
820 Propvalue: list of point
821 Propertytype: -
822 Function: Marks the given points with an 'X'.
823 Points must be unique.
824 Related: TR, CR, LB, SL, AR, SQ, LN
825
826 Property: SL
827 Propvalue: list of point
828 Propertytype: -
829 Function: Selected points. Type of markup unknown
830 (though SGB inverts the colors of the given points).
831 Points must be unique.
832 Related: TR, CR, LB, MA, AR, LN
833
834 Property: SQ
835 Propvalue: list of point
836 Propertytype: -
837 Function: Marks the given points with a square.
838 Points must be unique.
839 Related: TR, CR, LB, SL, AR, MA, LN
840
841 Property: TR
842 Propvalue: list of point
843 Propertytype: -
844 Function: Marks the given points with a triangle.
845 Points must be unique.
846 Related: MA, CR, LB, SL, AR, LN
847
848 Root properties
849
850 Property: AP
851 Propvalue: composed simpletext simpletext
852 Propertytype: root
853 Function: Provides the name and version number of the application used
854 to create this gametree.
855 The name should be unique and must not be changed for
856 different versions of the same program.
857 The version number itself may be of any kind, but the format
858 used must ensure that by using an ordinary string-compare,
859 one is able to tell if the version is lower or higher
860 than another version number.
861 Here's the list of known applications and their names:
862
863 Application System Name
864 --------------------------- ----------- --------------------
865 [CGoban:1.6.2] Unix CGoban
866 [Hibiscus:2.1] Windows 95 Hibiscus Go Editor
867 [IGS:5.0] Internet Go Server
868 [Many Faces of Go:10.0] Windows 95 The Many Faces of Go
869 [MGT:?] DOS/Unix MGT
870 [NNGS:?] Unix No Name Go Server
871 [Primiview:3.0] Amiga OS3.0 Primiview
872 [SGB:?] Macintosh Smart Game Board
873 [SmartGo:1.0] Windows SmartGo
874
875 Related: FF, GM, SZ, ST, CA
876
877 Property: CA
878 Propvalue: simpletext
879 Propertytype: root
880 Function: Provides the used charset for SimpleText and Text type.
881 Default value is 'ISO-8859-1' aka 'Latin1'.
882 Only charset names (or their aliases) as specified in RFC 1345
883 (or updates thereof) are allowed.
884 Basically this field uses the same names as MIME messages in
885 their 'charset=' field (in Content-Type).
886 RFC's can be obtained via FTP from DS.INTERNIC.NET,
887 NIS.NSF.NET, WUARCHIVE.WUSTL.EDU, SRC.DOC.IC.AC.UK
888 or FTP.IMAG.FR.
889 Related: FF, C, text type
890
891 Property: FF
892 Propvalue: number (range: 1-4)
893 Propertytype: root
894 Function: Defines the used file format. For difference between those
895 formats have a look at the history of SGF.
896 Default value: 1
897 Applications must be able to deal with different file formats
898 within a collection.
899 Related: GM, SZ, ST, AP, CA
900
901 Property: GM
902 Propvalue: number (range: 1-16)
903 Propertytype: root
904 Function: Defines the type of game, which is stored in the current
905 gametree. The property should help applications
906 to reject games, they cannot handle.
907 Valid numbers are: Go = 1, Othello = 2, chess = 3,
908 Gomoku+Renju = 4, Nine Men's Morris = 5, Backgammon = 6,
909 Chinese chess = 7, Shogi = 8, Lines of Action = 9,
910 Ataxx = 10, Hex = 11, Jungle = 12, Neutron = 13,
911 Philosopher's Football = 14, Quadrature = 15, Trax = 16,
912 Tantrix = 17, Amazons = 18, Octi = 19, Gess = 20.
913 Default value: 1
914 Different kind of games may appear within a collection.
915 Related: FF, SZ, ST, AP, CA
916
917 Property: ST
918 Propvalue: number (range: 0-3)
919 Propertytype: root
920 Function: Defines how variations should be shown (this is needed to
921 synchronize the comments with the variations). If ST is omitted
922 viewers should offer the possibility to change the mode online.
923 Basically most programs show variations in two ways:
924 as markup on the board (if the variation contains a move)
925 and/or as a list (in a separate window).
926 The style number consists two options.
927 1) show variations of successor node (children) (value: 0)
928 show variations of current node (siblings) (value: 1)
929 affects markup & list
930 2) do board markup (value: 0)
931 no (auto-) board markup (value: 2)
932 affects markup only.
933 Using no board markup could be used in problem collections
934 or if variations are marked by subsequent properties.
935 Viewers should take care, that the automatic variation
936 board markup DOESN'T overwrite any markup of other
937 properties.
938 The final number is calculated by adding the values of each
939 option. Example: 3 = no board markup/variations of current node
940 1 = board markup/variations of current node
941 Default value: 0
942 Related: C, FF, GM, SZ, AP, CA
943
944 Property: SZ
945 Propvalue: number
946 Propertytype: root
947 Function: Defines the size of the board. If only a single value
948 is given, the board is a square; with two numbers given,
949 rectangular boards are possible.
950 If a rectangular board is specified, the first number specifies
951 the number of columns, the second provides the number of rows.
952 Square boards must not be defined using the compose type
953 value: e.g. SZ[19:19] is illegal.
954 The valid range for SZ is any size greater or equal to 1x1.
955 For Go games the maximum size is limited to 52x52.
956 Default value: game specific
957 for Go: 19 (square board)
958 for Chess: 8 (square board)
959 Different board sizes may appear within a collection.
960 See move-/point-type for more info.
961 Related: FF, GM, ST, AP, CA
962
963 Game info properties
964
965 Property: AN
966 Propvalue: simpletext
967 Propertytype: game-info
968 Function: Provides the name of the person, who made the annotations
969 to the game.
970 Related: US, SO, CP
971
972 Property: BR
973 Propvalue: simpletext
974 Propertytype: game-info
975 Function: Provides the rank of the black player.
976 For Go (GM[1]) the following format is recommended:
977 "..k" or "..kyu" for kyu ranks and
978 "..d" or "..dan" for dan ranks.
979 Go servers may want to add '?' for an uncertain rating and
980 '*' for an established rating.
981 Related: PB, BT, WR
982
983 Property: BT
984 Propvalue: simpletext
985 Propertytype: game-info
986 Function: Provides the name of the black team, if game was part of a
987 team-match (e.g. China-Japan Supermatch).
988 Related: PB, PW, WT
989
990 Property: CP
991 Propvalue: simpletext
992 Propertytype: game-info
993 Function: Any copyright information (e.g. for the annotations) should
994 be included here.
995 Related: US, SO, AN
996
997 Property: DT
998 Propvalue: simpletext
999 Propertytype: game-info
1000 Function: Provides the date when the game was played.
1001 It is MANDATORY to use the ISO-standard format for DT.
1002 Note: ISO format implies usage of the Gregorian calendar.
1003 Syntax:
1004 "YYYY-MM-DD" year (4 digits), month (2 digits), day (2 digits)
1005 Do not use other separators such as "/", " ", "," or ".".
1006 Partial dates are allowed:
1007 "YYYY" - game was played in YYYY
1008 "YYYY-MM" - game was played in YYYY, month MM
1009 For games that last more than one day: separate other dates
1010 by a comma (no spaces!); following shortcuts may be used:
1011 "MM-DD" - if preceded by YYYY-MM-DD, YYYY-MM, MM-DD, MM or DD
1012 "MM" - if preceded by YYYY-MM or MM
1013 "DD" - if preceded by YYYY-MM-DD, MM-DD or DD
1014 Shortcuts acquire the last preceding YYYY and MM (if
1015 necessary).
1016 Note: interpretation is done from left to right.
1017 Examples:
1018 1996-05,06 = played in May,June 1996
1019 1996-05-06,07,08 = played on 6th,7th,8th May 1996
1020 1996,1997 = played in 1996 and 1997
1021 1996-12-27,28,1997-01-03,04 = played on 27th,28th
1022 of December 1996 and on 3rd,4th January 1997
1023 Note: it's recommended to use shortcuts whenever possible,
1024 e.g. 1997-05-05,06 instead of 1997-05-05,1997-05-06
1025 Related: EV, RO, PC, RU, RE, TM
1026
1027 Property: EV
1028 Propvalue: simpletext
1029 Propertytype: game-info
1030 Function: Provides the name of the event (e.g. tournament).
1031 Additional information (e.g. final, playoff, ..)
1032 shouldn't be included (see RO).
1033 Related: GC, RO, DT, PC, RU, RE, TM
1034
1035 Property: GN
1036 Propvalue: simpletext
1037 Propertytype: game-info
1038 Function: Provides a name for the game. The name is used to
1039 easily find games within a collection.
1040 The name should therefore contain some helpful information
1041 for identifying the game. 'GameName' could also be used
1042 as the file-name, if a collection is split into
1043 single files.
1044 Related: GC, EV, DT, PC, RO, ID
1045
1046 Property: GC
1047 Propvalue: text
1048 Propertytype: game-info
1049 Function: Provides some extra information about the following game.
1050 The intend of GC is to provide some background information
1051 and/or to summarize the game itself.
1052 Related: GN, ON, AN, CP
1053
1054 Property: ON
1055 Propvalue: simpletext
1056 Propertytype: game-info
1057 Function: Provides some information about the opening played
1058 (e.g. san-ren-sei, Chinese fuseki, etc.).
1059 Related: GN, GC
1060
1061 Property: OT
1062 Propvalue: simpletext
1063 Propertytype: game-info
1064 Function: Describes the method used for overtime (byo-yomi).
1065 Examples: "5 mins Japanese style, 1 move / min",
1066 "25 moves / 10 min".
1067 Related: TM, BL, WL, OB, OW
1068
1069 Property: PB
1070 Propvalue: simpletext
1071 Propertytype: game-info
1072 Function: Provides the name of the black player.
1073 Related: PW, BT, WT
1074
1075 Property: PC
1076 Propvalue: simpletext
1077 Propertytype: game-info
1078 Function: Provides the place where the games was played.
1079 Related: EV, DT, RO, RU, RE, TM
1080
1081 Property: PW
1082 Propvalue: simpletext
1083 Propertytype: game-info
1084 Function: Provides the name of the white player.
1085 Related: PB, BT, WT
1086
1087 Property: RE
1088 Propvalue: simpletext
1089 Propertytype: game-info
1090 Function: Provides the result of the game. It is MANDATORY to use the
1091 following format:
1092 "0" (zero) or "Draw" for a draw (jigo),
1093 "B+" ["score"] for a black win and
1094 "W+" ["score"] for a white win
1095 Score is optional (some games don't have a score e.g. chess).
1096 If the score is given it has to be given as a real value,
1097 e.g. "B+0.5", "W+64", "B+12.5"
1098 Use "B+R" or "B+Resign" and "W+R" or "W+Resign" for a win by
1099 resignation. Applications must not write "Black resigns".
1100 Use "B+T" or "B+Time" and "W+T" or "W+Time" for a win on time,
1101 "B+F" or "B+Forfeit" and "W+F" or "W+Forfeit" for a win by
1102 forfeit,
1103 "Void" for no result or suspended play and
1104 "?" for an unknown result.
1105
1106 Related: EV, DT, PC, RO, RU, TM
1107
1108 Property: RO
1109 Propvalue: simpletext
1110 Propertytype: game-info
1111 Function: Provides round-number and type of round. It should be
1112 written in the following way: RO[xx (tt)], where xx is the
1113 number of the round and (tt) the type:
1114 final, playoff, league, ...
1115 Related: EV, DT, PC, RU, RE, TM
1116
1117 Property: RU
1118 Propvalue: simpletext
1119 Propertytype: game-info
1120 Function: Provides the used rules for this game.
1121 Because there are many different rules, SGF requires
1122 mandatory names only for a small set of well known rule sets.
1123 Note: it's beyond the scope of this specification to give an
1124 exact specification of these rule sets.
1125 Mandatory names for Go (GM[1]):
1126 "AGA" (rules of the American Go Association)
1127 "GOE" (the Ing rules of Goe)
1128 "Japanese" (the Nihon-Kiin rule set)
1129 "NZ" (New Zealand rules)
1130
1131 Related: EV, DT, PC, RO, RE, TM
1132
1133 Property: SO
1134 Propvalue: simpletext
1135 Propertytype: game-info
1136 Function: Provides the name of the source (e.g. book, journal, ...).
1137 Related: US, AN, CP
1138
1139 Property: TM
1140 Propvalue: real
1141 Propertytype: game-info
1142 Function: Provides the time limits of the game.
1143 The time limit is given in seconds.
1144 Related: EV, DT, PC, RO, RU, RE
1145
1146 Property: US
1147 Propvalue: simpletext
1148 Propertytype: game-info
1149 Function: Provides the name of the user (or program), who entered
1150 the game.
1151 Related: SO, AN, CP
1152
1153 Property: WR
1154 Propvalue: simpletext
1155 Propertytype: game-info
1156 Function: Provides the rank of the white player. For recommended
1157 format see BR.
1158 Related: PW, WT, BR
1159
1160 Property: WT
1161 Propvalue: simpletext
1162 Propertytype: game-info
1163 Function: Provide the name of the white team, if game was part of a
1164 team-match (e.g. China-Japan Supermatch).
1165 Related: PB, PW, BT
1166
1167 Timing properties
1168
1169 Property: BL
1170 Propvalue: real
1171 Propertytype: move
1172 Function: Time left for black, after the move was made.
1173 Value is given in seconds.
1174 Related: TM, OT, WL, OB, OW
1175
1176 Property: OB
1177 Propvalue: number
1178 Propertytype: move
1179 Function: Number of black moves left (after the move of this node was
1180 played) to play in this byo-yomi period.
1181 Related: TM, OT, BL, WL, OW
1182
1183 Property: OW
1184 Propvalue: number
1185 Propertytype: move
1186 Function: Number of white moves left (after the move of this node was
1187 played) to play in this byo-yomi period.
1188 Related: TM, OT, BL, WL, OB
1189
1190 Property: WL
1191 Propvalue: real
1192 Propertytype: move
1193 Function: Time left for white after the move was made.
1194 Value is given in seconds.
1195 Related: TM, OT, BL, OB, OW
1196
1197 Miscellaneous properties
1198
1199 Property: FG
1200 Propvalue: composed number SimpleText
1201 Propertytype: -
1202 Function: The figure property is used to divide a game into
1203 different figures for printing: a new figure starts at the
1204 node containing a figure property.
1205 If the value is not empty then
1206 - Simpletext provides a name for the diagram
1207 - Number specifies some flags (for printing).
1208 These flags are:
1209 - coordinates on/off (value: 0/1)
1210 - diagram name on/off (value: 0/2)
1211 - list moves not shown in figure on/off (value: 0/4)
1212 Some moves can't be shown in a diagram (e.g. ko
1213 captures in Go) - these moves may be listed as text.
1214 - remove captured stones on/off (value: 0/256)
1215 'remove off' means: keep captured stones in the
1216 diagram and don't overwrite stones played earlier -
1217 this is the way diagrams are printed in books.
1218 'remove on' means: capture and remove the stones from
1219 the display - this is the usual viewer mode.
1220 This flag is specific to Go (GM[1]).
1221 - hoshi dots on/off (value: 0/512)
1222 This flag is specific to Go (GM[1]).
1223 - Ignore flags on/off (value: 32768)
1224 If on, then all other flags should be ignored and
1225 the application should use its own defaults.
1226 The final number is calculated by summing up all flag values.
1227 E.g. 515 = coordinates and diagram name off, remove captured
1228 stones, list unshown moves, hoshi dots off;
1229 257 = coordinates off, diagram name on, list unshown moves,
1230 don't remove captured stones, hoshi dots on.
1231 (this is how diagrams are printed in e.g. Go World)
1232 Note: FG combined with VW, MN and PM are mighty tools to print
1233 and compile diagrams.
1234 Related: MN, PM, VW
1235
1236 Property: PM
1237 Propvalue: number
1238 Propertytype: inherit
1239 Function: This property is used for printing.
1240 It specifies how move numbers should be printed.
1241 0 ... don't print move numbers
1242 1 ... print move numbers as they are
1243 2 ... print 'modulo 100' move numbers
1244 This mode is usually used in books or magazines.
1245 Note: Only the first move number is calculated
1246 'modulo 100' and the obtained number is increased
1247 for each move in the diagram.
1248 E.g. A figure containing moves
1249 32-78 is printed as moves 32-78
1250 102-177 is printed as moves 2-77
1251 67-117 is printed as moves 67-117
1252 154-213 is printed as moves 54-113
1253 Default value: 1
1254 Related: MN, FG
1255
1256 Property: VW
1257 Propvalue: elist of point
1258 Propertytype: inherit
1259 Function: View only part of the board. The points listed are
1260 visible, all other points are invisible.
1261 Note: usually the point list is given in compressed
1262 format (see 'point' type)!
1263 Points have to be unique.
1264 Have a look at the picture to get an idea.
1265 VW[] clears any setting, i.e. the whole board is
1266 visible again.
1267 Related: DD, PM, FG
1268
1269 Go properties
1270 Restrictions: TW and TB points must be unique, i.e. it's illegal to list the same point in TB and TW within the same node.
1271 Gametype: 1
1272
1273 Property: HA
1274 Propvalue: number
1275 Propertytype: game-info
1276 Function: Defines the number of handicap stones (>=2).
1277 If there is a handicap, the position should be set up with
1278 AB within the same node.
1279 HA itself doesn't add any stones to the board, nor does
1280 it imply any particular way of placing the handicap stones.
1281 Related: KM, RE, RU
1282
1283 Property: KM
1284 Propvalue: real
1285 Propertytype: game-info
1286 Function: Defines the komi.
1287 Related: HA, RE, RU
1288
1289 Property: TB
1290 Propvalue: elist of point
1291 Propertytype: -
1292 Function: Specifies the black territory or area (depends on
1293 rule set used).
1294 Points must be unique.
1295 Related: TW
1296
1297 Property: TW
1298 Propvalue: elist of point
1299 Propertytype: -
1300 Function: Specifies the white territory or area (depends on
1301 rule set used).
1302 Points must be unique.
1303 Related: TB
1304
1305 Octi properties
1306 Gametype: 19
1307
1308 Property: RU (rules)
1309 Propvalue: simpletext
1310 Propertytype: game-info
1311 Function: Valid values are one major variation ("full", "fast",
1312 or "kids") followed by a colon and a comma separated
1313 elist of variations ("edgeless", "superprong", etc.).
1314
1315 The colon may be omitted if either side is empty.
1316 The default is 2-player full, no variations.
1317 The 4-player game is not currently available.
1318
1319 Property: BO (black octisquares)
1320 Propvalue: list of point
1321 Propertytype: game-info
1322 Function: The position of Black's octi squares. Black will be
1323 setup with one empty pod on each of these points.
1324 It is illegal to list the same point twice.
1325 Traditionally, Black sits at the south end of the board.
1326 Related: WO
1327
1328 Property: WO (white octisquares)
1329 Propvalue: list of point
1330 Propertytype: game-info
1331 Function: The position of White's octi squares. White will be
1332 setup with one empty pod on each of these points.
1333 It is illegal to list the same point twice.
1334 Traditionally, White sits at the north end of the board.
1335 Related: BO
1336
1337 Property: NP (number of prongs)
1338 Propvalue: number
1339 Propertytype: game-info
1340 Function: This is the number of prongs each players has at the
1341 start of the game.
1342 The default will be derived from the rules.
1343 Related: NR
1344
1345 Property: NR (number of reserve)
1346 Propvalue: number
1347 Propertytype: game-info
1348 Function: This is the number of pods in each players reserve at
1349 the start of the game.
1350 The default will be derived from the rules.
1351 Related: NP, NS
1352
1353 Property: NS (number of superprongs)
1354 Propvalue: number
1355 Propertytype: game-info
1356 Function: This is the number of superprongs each players has at
1357 the start of the game.
1358 The default will be derived from the rules.
1359 Related: NR
1360
1361 Property: AS (arrow stone)
1362 Propvalue: list of composed stone ':' point
1363 Propertytype: -
1364 Function: Most of the same restriction from AR apply.
1365 The same arrow must not occur twice; however, two arrows
1366 from different stones at the same point may have arrows
1367 to the same destination. Single point arrows are also
1368 illegal.
1369 Related: AR
1370
1371 Property: CS (circle stone)
1372 Propvalue: list of stone
1373 Propertytype: -
1374 Function: Marks the given stones, each with a circle.
1375 Related: CR
1376
1377 Property: MS (mark stone)
1378 Propvalue: list of stone
1379 Propertytype: -
1380 Function: Marks the given stones, each with an ex.
1381 Related: MA
1382
1383 Property: SS (square stone)
1384 Propvalue: list of stone
1385 Propertytype: -
1386 Function: Marks the given stones, each with a square.
1387 Related: SQ
1388
1389 Property: TS (triangle stone)
1390 Propvalue: list of stone
1391 Propertytype: -
1392 Function: Marks the given stones, each with a triangle.
1393 Related: TR
1394
1395 Property: RP (remove pod)
1396 Propvalue: list of stone
1397 Propertytype: setup
1398 Function: Removes a stone from the board.
1399 More selective than AddEmpty.
1400 Related: AE
1401
1402 Backgammon properties
1403 Gametype: 6
1404
1405 Property: CO
1406 Propvalue: simpletext
1407 Propertytype: setup
1408 Function: Set the position of the doubling cube. The value
1409 should be `b' (black), `w' (white), `c' (centred), or `n'
1410 (none -- for cubeless or Crawford games).
1411 Related: CV
1412
1413 Property: CV
1414 Propvalue: number
1415 Propertytype: setup
1416 Function: Set the value of the doubling cube. This value
1417 defaults to 1 at the beginning of the game, but a CV property
1418 should be added when setting up a position where a double has
1419 been made, or at the beginning of a money game if automatic
1420 doubles occur.
1421 Related: CP
1422
1423 Property: DI
1424 Propvalue: number
1425 Propertytype: setup
1426 Function: Set the dice without moving (this could be useful for
1427 creating problem positions, e.g. DI[31])
1428 Related: CO
1429
1430 Property: MI
1431 Propvalue: list of composed simpletext ':' simpletext
1432 Propertytype: game-info
1433 Function: Specifies information about the match the game belongs to.
1434 This property should specify a list of tag/value pairs, where
1435 the allowable tags are case-insensitive, and include:
1436
1437 length - the match length (number of points); value should
1438 be a number
1439 game - the number of this game within the match (the
1440 first game is 1); value should be a number
1441 bs - the score for Black at the start of the game;
1442 value should be a number
1443 ws - the score for White at the start of the game;
1444 value should be a number
1445
1446 Unknown tags should be ignored (a warning may be produced).
1447 The order of tags in the list is not significant. An example
1448 MI property is:
1449 MI[length:7][game:3][ws:2][bs:1]
1450 Related: EV, GN, RE, RO
1451
1452 Property: RE
1453 Propvalue: simpletext
1454 Propertytype: game-info
1455 Function: The general RE property has the following
1456 modification in backgammon games: in the case of a
1457 resignation, the value should also specify the number of
1458 points before the R(esign). Here are three example RE
1459 properties:
1460
1461 RE[B+6R] -- White resigns a backgammon on a 2
1462 cube (worth 6 points).
1463 RE[W+2Resign] -- Black resigns a gammon on a 1 cube
1464 (worth 2 points).
1465 RE[W+4] -- Black drops a redouble to 8 (note
1466 this is considered a normal loss, not
1467 a resignation).
1468 Related: RE
1469
1470 Property: RU
1471 Propvalue: simpletext
1472 Propertytype: game-info
1473 Function: Backgammon-specific values for the general RU property
1474 include the following:
1475
1476 [Crawford] -- the Crawford rule is being used in this match,
1477 although this is not the Crawford game.
1478 [Crawford:CrawfordGame] -- this IS the Crawford game.
1479 [Jacoby] -- the Jacoby rule is in use for this game.
1480 Related: RU
1481
1482 Lines of Action properties
1483 Gametype: 9
1484
1485 Property: AS
1486 Propvalue: SimpleText
1487 Propertytype: -
1488 Function: Adding stones - the color of the player who is adding
1489 stones to the board. The valid strings are 'Black', 'White'
1490 or 'None'. The puropse of this property is to define a
1491 board position where the human is expected to continue placing
1492 stones on the board through some user interface.
1493
1494 Property: IP
1495 Propvalue: SimpleText
1496 Propertytype: game-info
1497 Function: Designates the initial position in the game to be
1498 displayed by the viewer.
1499 The only value currently supported is 'End', which causes
1500 the viewer to initially display the final position of the game.
1501 The default is to display the position after setup but before
1502 any moves.
1503
1504 Property: IY
1505 Propvalue: SimpleText
1506 Propertytype: game-info
1507 Function: Invert Y axis. Values are 'true' or 'false'.
1508 If 'true', the board should be displayed with numbers
1509 increasing in value from bottom to top of the screen.
1510 Default: 'false'
1511
1512 Property: SE
1513 Propvalue: point
1514 Propertytype: -
1515 Function: Mark the given point and up to 8 additional points,
1516 depending on where the provided point (stone) could legally
1517 move.
1518
1519 Property: SU
1520 Propvalue: SimpleText
1521 Propertytype: game-info
1522 Function: Setup type - designates the intial placement of pieces,
1523 and also the implicitly the variation on the basic rules to be
1524 employed. The currently valid values include the following
1525 strings:
1526 'Standard', 'Scrambled-eggs', 'Parachute', 'Gemma' and 'Custom'
1527 (the initial board is empty, AB and AW properties
1528 will be used to establish the starting position).
1529 Default: 'Standard'
1530 For details on the setups and rule variations, consult the
1531 LOA home pages.
1532
1533 Hex properties
1534 Gametype: 11
1535
1536 Property: IS
1537 Propvalue: list of composed SimpleText ':' SimpleText
1538 Propertytype: root
1539 Function: This property allows applications to store and read
1540 an initial viewer setting. The property value is a list of
1541 "keyword followed by ':' followed by either 'on' or 'off'".
1542 Valid keywords are:
1543 'tried' - identify future moves that have been tried?
1544 'marked' - show good/bad move markings?
1545 'lastmove' - identify the last cell played?
1546 'headings' - display column/row headings (a b.., 1 2..)?
1547 'lock' - lock the game against new moves (for analysis)?
1548 This property is allowed in the root node only.
1549 Example: IS[tried:on][lock:off][marked:off]
1550
1551 Property: IP
1552 Propvalue: SimpleText
1553 Propertytype: game-info
1554 Function: Designates the initial position that the viewer
1555 should display. It will most frequently indicate the
1556 current position of play in the game. This is necessary
1557 because future possible moves may have been explored,
1558 and the user must be able to distinguish real moves
1559 actually made from exploratory moves. More than one IP[]
1560 property in a game is illegal, and the behaviour undefined.
1561 The property value should be empty (""); it is specified
1562 as SimpleText for compatibility.
1563
1564 Amazons properties
1565 Gametype: 18
1566
1567 Property: AA
1568 Propvalue: list of point
1569 Propertytype: setup
1570 Function: Adding arrows to the board. This can be used to set up
1571 positions or problems.
1572
1573 End: this marks the end
1574