src/chess/rules.c

changeset 69
c8f2c280cff7
parent 68
b34de5ce7d0e
equal deleted inserted replaced
68:b34de5ce7d0e 69:c8f2c280cff7
202 case KING: return 'K'; 202 case KING: return 'K';
203 default: return '\0'; 203 default: return '\0';
204 } 204 }
205 } 205 }
206 206
207 unsigned char* getpieceunicode(uint8_t piece) {
208 switch (piece & PIECE_MASK) {
209 case PAWN: return "\u265f";
210 case ROOK: return "\u265c";
211 case KNIGHT: return "\u265e";
212 case BISHOP: return "\u265d";
213 case QUEEN: return "\u265b";
214 case KING: return "\u265a";
215 default: return "";
216 }
217 }
218
207 uint8_t getpiece(char c) { 219 uint8_t getpiece(char c) {
208 switch (c) { 220 switch (c) {
209 case 'R': return ROOK; 221 case 'R': return ROOK;
210 case 'N': return KNIGHT; 222 case 'N': return KNIGHT;
211 case 'B': return BISHOP; 223 case 'B': return BISHOP;

mercurial