4 * ----------------------------------------------------------------------
5 * Copyright (c) 1993, 1994, 1995 Matthias Mutz
6 * Copyright (c) 1999 Michael Vanier and the Free Software Foundation
7 * Copyright (c) 2008, 2013, 2014 Yann Dirson and the Free Software Foundation
9 * GNU SHOGI is based on GNU CHESS
11 * Copyright (c) 1988, 1989, 1990 John Stanback
12 * Copyright (c) 1992 Free Software Foundation
14 * This file is part of GNU SHOGI.
16 * GNU Shogi is free software; you can redistribute it and/or modify it
17 * under the terms of the GNU General Public License as published by the
18 * Free Software Foundation; either version 3 of the License,
19 * or (at your option) any later version.
21 * GNU Shogi is distributed in the hope that it will be useful, but WITHOUT
22 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
23 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
26 * You should have received a copy of the GNU General Public License along
27 * with GNU Shogi; see the file COPYING. If not, see
28 * <http://www.gnu.org/licenses/>.
29 * ----------------------------------------------------------------------
37 #define MAX_NAME 16 /* maximum length of opening name */
38 #define MAX_SEQUENCE 4 /* maximum number of sequences
39 * for an opening type */
41 #define CANNOT_REACH (-1)
42 #define NOT_TO_REACH (-2)
43 #define IS_REACHED (-3)
44 #define IS_SUCCESSOR (-4)
46 #define END_OF_SEQUENCES (-1)
47 #define END_OF_PATTERNS (-2)
48 #define END_OF_LINKS (-3)
49 #define END_OF_FIELDS (-4)
62 small_short distance
[2];
63 short reachedGameCnt
[2];
70 struct OpeningSequence_rec
73 short first_pattern
[MAX_SEQUENCE
];
77 extern struct Pattern_rec Pattern
[];
78 extern struct OpeningSequence_rec OpeningSequence
[];
81 piece_to_pattern_distance(short side
, short piece
,
82 short pside
, short pattern
);
85 pattern_distance(short pside
, short pattern
);
88 board_to_pattern_distance(short pside
, short osequence
,
89 short pmplty
, short GameCnt
);
92 locate_opening_sequence(short pside
, char *s
, short GameCnt
);
95 DisplayPattern(FILE *fd
, short first_field
);
98 update_advance_bonus(short pside
, short os
);
101 GetOpeningPatterns(short *max_opening_sequence
);
104 ShowOpeningPatterns(short max_opening_sequence
);
108 ValueOfOpeningName(char *name
);
110 extern small_short pattern_data
[];
113 #endif /* _PATTERN_H_ */