4 * ----------------------------------------------------------------------
5 * Copyright (c) 1993, 1994, 1995 Matthias Mutz
6 * Copyright (c) 1999 Michael Vanier and the Free Software Foundation
8 * GNU SHOGI is based on GNU CHESS
10 * Copyright (c) 1988, 1989, 1990 John Stanback
11 * Copyright (c) 1992 Free Software Foundation
13 * This file is part of GNU SHOGI.
15 * GNU Shogi is free software; you can redistribute it and/or modify it
16 * under the terms of the GNU General Public License as published by the
17 * Free Software Foundation; either version 3 of the License,
18 * or (at your option) any later version.
20 * GNU Shogi is distributed in the hope that it will be useful, but WITHOUT
21 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
22 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
25 * You should have received a copy of the GNU General Public License along
26 * with GNU Shogi; see the file COPYING. If not, see
27 * <http://www.gnu.org/licenses/>.
28 * ----------------------------------------------------------------------
36 #define MAX_NAME 16 /* maximum length of opening name */
37 #define MAX_SEQUENCE 4 /* maximum number of sequences
38 * for an opening type */
40 #define CANNOT_REACH (-1)
41 #define NOT_TO_REACH (-2)
42 #define IS_REACHED (-3)
43 #define IS_SUCCESSOR (-4)
45 #define END_OF_SEQUENCES (-1)
46 #define END_OF_PATTERNS (-2)
47 #define END_OF_LINKS (-3)
48 #define END_OF_FIELDS (-4)
61 small_short distance[2];
62 short reachedGameCnt[2];
69 struct OpeningSequence_rec
72 short first_pattern[MAX_SEQUENCE];
76 extern struct Pattern_rec Pattern[];
77 extern struct OpeningSequence_rec OpeningSequence[];
80 piece_to_pattern_distance(short side, short piece,
81 short pside, short pattern);
84 pattern_distance(short pside, short pattern);
87 board_to_pattern_distance(short pside, short osequence,
88 short pmplty, short GameCnt);
91 locate_opening_sequence(short pside, char *s, short GameCnt);
94 DisplayPattern(FILE *fd, short first_field);
97 update_advance_bonus(short pside, short os);
100 GetOpeningPatterns(short *max_opening_sequence);
103 ShowOpeningPatterns(short max_opening_sequence);
107 ValueOfOpeningName(char *name);
109 extern small_short pattern_data[];
112 #endif /* _PATTERN_H_ */