1 /* #define TEST_PATTERN */
2 /* #define DEBUG_PATTERN */
5 #define MAX_PATTERN 20 /* maximum number of pieces in pattern */
6 #define MAX_NEXT 6 /* maximum number of links */
7 #define MAX_NAME 20 /* maximum length of opening name */
11 struct PatternField_rec
{
12 small_short side
, piece
, square
;
18 PatternField field
[MAX_PATTERN
];
22 struct PatternSequence_rec
{
24 small_short next
[MAX_NEXT
];
25 small_short distance
[2];
26 small_short reachedGameCnt
[2];
28 PatternFields patternfields
;
29 struct PatternSequence_rec
*next_pattern
;
34 struct OpeningPattern_rec
{
37 PatternSequence
*sequence
;
38 struct OpeningPattern_rec
*next
;
42 extern OpeningPattern
*Patterns
;
52 string_to_patternfields
53 (char *s
, PatternFields
*pattern
);
57 piece_to_pattern_distance
58 (short side
, short piece
, short pside
, PatternFields
*pattern
);
62 pattern_distance (short pside
, PatternFields
*pattern
);
66 board_to_pattern_distance
67 (short pside
, OpeningPattern
*opattern
, short pmplty
, short GameCnt
);
70 OpeningPattern
*locate_opening_pattern(short pside
, char *s
, short GameCnt
);
74 DisplayPattern (PatternFields
*pattern
);
78 GetOpeningPatterns ();
82 ShowOpeningPatterns ();
85 void update_advance_bonus (short pside
, OpeningPattern
*p
);