4 * ----------------------------------------------------------------------
6 * Copyright (c) 2012 Free Software Foundation
8 * GNU SHOGI is based on GNU CHESS
10 * This file is part of GNU SHOGI.
12 * GNU Shogi is free software; you can redistribute it and/or modify it
13 * under the terms of the GNU General Public License as published by the
14 * Free Software Foundation; either version 3 of the License,
15 * or (at your option) any later version.
17 * GNU Shogi is distributed in the hope that it will be useful, but WITHOUT
18 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
19 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 * You should have received a copy of the GNU General Public License along
23 * with GNU Shogi; see the file COPYING. If not, see
24 * <http://www.gnu.org/licenses/>.
25 * ----------------------------------------------------------------------
33 #define MAX_NAME 16 /* maximum length of opening name */
34 #define MAX_SEQUENCE 4 /* maximum number of sequences
35 * for an opening type */
37 #define CANNOT_REACH (-1)
38 #define NOT_TO_REACH (-2)
39 #define IS_REACHED (-3)
40 #define IS_SUCCESSOR (-4)
42 #define END_OF_SEQUENCES (-1)
43 #define END_OF_PATTERNS (-2)
44 #define END_OF_LINKS (-3)
45 #define END_OF_FIELDS (-4)
58 small_short distance[2];
59 short reachedGameCnt[2];
66 struct OpeningSequence_rec
69 short first_pattern[MAX_SEQUENCE];
73 extern struct Pattern_rec Pattern[];
74 extern struct OpeningSequence_rec OpeningSequence[];
77 piece_to_pattern_distance(short side, short piece,
78 short pside, short pattern);
81 pattern_distance(short pside, short pattern);
84 board_to_pattern_distance(short pside, short osequence,
85 short pmplty, short GameCnt);
88 locate_opening_sequence(short pside, char *s, short GameCnt);
91 DisplayPattern(FILE *fd, short first_field);
94 update_advance_bonus(short pside, short os);
97 GetOpeningPatterns(short *max_opening_sequence);
100 ShowOpeningPatterns(short max_opening_sequence);
104 ValueOfOpeningName(char *name);
106 extern small_short pattern_data[];
109 #endif /* _PATTERN_H_ */