sgf2gtp.pl: Fix [ii] conversion
[pachi/peepo.git] / stone.h
blobf1648631bc105fcc5b8cfc6ad5571a74fc04154a
1 #ifndef ZZGO_STONE_H
2 #define ZZGO_STONE_H
4 enum stone {
5 S_NONE,
6 S_BLACK,
7 S_WHITE,
8 S_OFFBOARD,
9 S_MAX,
12 static char stone2char(enum stone s);
13 char *stone2str(enum stone s); /* static string */
14 enum stone str2stone(char *str);
16 static enum stone stone_other(enum stone s);
19 static inline char
20 stone2char(enum stone s)
22 return ".XO#"[s];
25 static inline enum stone
26 stone_other(enum stone s)
28 switch (s) {
29 case S_BLACK: return S_WHITE;
30 case S_WHITE: return S_BLACK;
31 default: return s;
35 #endif