-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUtil.h
33 lines (22 loc) · 828 Bytes
/
Util.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
#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);
int parseFEN(std::string f);
std::string indexToSquare(int i);
std::string getMoveString(Move m);
// 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 -1 if invalid FEN 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