Add missing copyright info to *-common.c, added by the minishogi patches.
[gnushogi.git] / gnushogi / pattern-common.c
1 /*
2  * FILE: pattern-common.c
3  *
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
8  *
9  * GNU SHOGI is based on GNU CHESS
10  *
11  * Copyright (c) 1988, 1989, 1990 John Stanback
12  * Copyright (c) 1992 Free Software Foundation
13  *
14  * This file is part of GNU SHOGI.
15  *
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.
20  *
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
24  * for more details.
25  *
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  * ----------------------------------------------------------------------
30  *
31  */
32 #include "gnushogi.h"
33 #include "pattern.h"
34
35 short
36 ValueOfOpeningName (char *name)
37 {
38     short i;
39     i = (name[0] == 'C') ? 0 : 100;
40
41     switch (name[7])
42     {
43     case 'S':
44         i += 10;
45         break;
46
47     case 'R':
48         i += 20;
49         break;
50
51     case 'U':
52         i += 30;
53         break;
54
55     default:
56         i += 40;
57         break;
58     }
59
60     switch (name[9])
61     {
62     case 'S':
63         i += 1;
64         break;
65
66     case 'R':
67         i += 2;
68         break;
69
70     case 'U':
71         i += 3;
72         break;
73
74     default:
75         i += 4;
76         break;
77     }
78
79     return i;
80 }