-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUtil.h
More file actions
34 lines (23 loc) · 968 Bytes
/
Util.h
File metadata and controls
34 lines (23 loc) · 968 Bytes
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
#ifndef UTIL_H
#define UTIL_H
#include "Defs.h"
#include <iostream>
#include <sstream>
#include <list>
int parseSquare(std::string s);
int parseMove(std::string m, bool uci = false);
std::string indexToSquare(int i);
std::string getMoveString(Move m);
std::string getMoveStringRaw(Move m, bool uci);
// Returns a Piece object given a character in the set "PNBRQKpnbrqk"
char getCharacterFromPiece(Piece p);
Piece getPieceFromCharacter(char c);
// Two ways to initialize a Position object
Position defaultPosition();
bool getPositionFromFEN(Position & pos, std::string fen); // Returns false if invalid FEN string
bool getPositionFromEPD(Position & pos, std::string epd); // Returns false if invalid EPD string
void printBoard(std::ostream & os, const Position & p);
// Print values in a Position object. For testing/debugging.
void printPosition(std::ostream & os, const Position & p);
bool checkPosition(const Position & p, std::ostream & os);
#endif