-
Notifications
You must be signed in to change notification settings - Fork 0
/
notation.h
47 lines (35 loc) · 1.46 KB
/
notation.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/*
Isoquant, a UCI-compliant chess playing engine
Copyright (C) 2004-2008 Tord Romstad
Copyright (C) 2008-2014 Marco Costalba, Joona Kiiski, Tord Romstad
Copyright (C) 2015-2016 William McKibbin
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License,
or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, see <http://www.gnu.org/licenses>.
*/
#ifndef NOTATION_H_INCLUDED
#define NOTATION_H_INCLUDED
#include <string>
#include "types.h"
class Position;
std::string score_to_uci(Value v, Value alpha = -VALUE_INFINITE, Value beta = VALUE_INFINITE);
Move move_from_uci(const Position& pos, std::string& str);
const std::string move_to_uci(Move m, bool chess960);
inline char to_char(File f, bool tolower = true) {
return char(f - FILE_A + (tolower ? 'a' : 'A'));
}
inline char to_char(Rank r) {
return char(r - RANK_1 + '1');
}
inline const std::string to_string(Square s) {
char ch[] = { to_char(file_of(s)), to_char(rank_of(s)), 0 };
return ch;
}
#endif // #ifndef NOTATION_H_INCLUDED