Remove Move.h (moved to Types.h)
This commit is contained in:
parent
e00f9231fb
commit
5507db23dd
|
|
@ -5,9 +5,6 @@
|
||||||
#include "Config.h"
|
#include "Config.h"
|
||||||
|
|
||||||
#include "Board.h"
|
#include "Board.h"
|
||||||
#include "Move.h"
|
|
||||||
#include "Movegen.h"
|
|
||||||
#include "Types.h"
|
|
||||||
#include "Uci.h"
|
#include "Uci.h"
|
||||||
|
|
||||||
void setup() {
|
void setup() {
|
||||||
|
|
|
||||||
2
Board.h
2
Board.h
|
|
@ -3,7 +3,6 @@
|
||||||
|
|
||||||
#include "Types.h"
|
#include "Types.h"
|
||||||
#include "Panic.h"
|
#include "Panic.h"
|
||||||
#include "Move.h"
|
|
||||||
|
|
||||||
namespace Board {
|
namespace Board {
|
||||||
|
|
||||||
|
|
@ -289,7 +288,6 @@ namespace Board {
|
||||||
field[PTR_SIDE_AND_CASTLERIGHT] ^= 0x01;
|
field[PTR_SIDE_AND_CASTLERIGHT] ^= 0x01;
|
||||||
field[PTR_ENPASSANT] = u.captured >> 4;
|
field[PTR_ENPASSANT] = u.captured >> 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
15
Move.h
15
Move.h
|
|
@ -1,15 +0,0 @@
|
||||||
#ifndef __MOVE_H_INC
|
|
||||||
#define __MOVE_H_INC
|
|
||||||
|
|
||||||
#include "Types.h"
|
|
||||||
|
|
||||||
struct Move {
|
|
||||||
byte sq_from; // 0x88
|
|
||||||
byte sq_to; // 0x88
|
|
||||||
Piece pc_prom; // 0b(4unused)(1color)(3type)
|
|
||||||
};
|
|
||||||
|
|
||||||
//Move move_from_str(char* s) {
|
|
||||||
//}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
@ -2,7 +2,6 @@
|
||||||
#define __MOVEGEN_H_INC
|
#define __MOVEGEN_H_INC
|
||||||
|
|
||||||
#include "Types.h"
|
#include "Types.h"
|
||||||
#include "Move.h"
|
|
||||||
|
|
||||||
const static byte SLIDE_OFFSETS[] = {255, 1, 240, 16, 15, 17, 241, 239};
|
const static byte SLIDE_OFFSETS[] = {255, 1, 240, 16, 15, 17, 241, 239};
|
||||||
const static byte KNIGHT_OFFSETS[] = {225, 31, 223, 33, 238, 18, 242, 14};
|
const static byte KNIGHT_OFFSETS[] = {225, 31, 223, 33, 238, 18, 242, 14};
|
||||||
|
|
|
||||||
5
Tasks.h
5
Tasks.h
|
|
@ -1,6 +1,9 @@
|
||||||
#ifndef __TASKS_H_INC
|
#ifndef __TASKS_H_INC
|
||||||
#define __TASKS_H_INC
|
#define __TASKS_H_INC
|
||||||
|
|
||||||
|
#include "Types.h"
|
||||||
|
#include "Movegen.h"
|
||||||
|
|
||||||
unsigned long pseudo_perft(byte depth) {
|
unsigned long pseudo_perft(byte depth) {
|
||||||
// only checks pseudolegality
|
// only checks pseudolegality
|
||||||
// but, it should work overall
|
// but, it should work overall
|
||||||
|
|
@ -100,7 +103,7 @@ void debug_ep() {
|
||||||
|
|
||||||
void bench() {
|
void bench() {
|
||||||
// TODO reduce code size of this (by moving repeated constants from here to PROGMEM and loops?)
|
// TODO reduce code size of this (by moving repeated constants from here to PROGMEM and loops?)
|
||||||
|
|
||||||
unsigned long startTime = micros();
|
unsigned long startTime = micros();
|
||||||
|
|
||||||
Board::make({0x14, 0x34, P_EMPTY});
|
Board::make({0x14, 0x34, P_EMPTY});
|
||||||
|
|
|
||||||
10
Types.h
10
Types.h
|
|
@ -40,4 +40,14 @@ char piece_to_char(Piece p) {
|
||||||
return CHAR_STRS[p];
|
return CHAR_STRS[p];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
struct Move {
|
||||||
|
byte sq_from; // 0x88
|
||||||
|
byte sq_to; // 0x88
|
||||||
|
Piece pc_prom; // 0b(4unused)(1color)(3type)
|
||||||
|
};
|
||||||
|
|
||||||
|
//Move move_from_str(char* s) {
|
||||||
|
//}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
7
Uci.h
7
Uci.h
|
|
@ -37,11 +37,18 @@ namespace Uci {
|
||||||
|
|
||||||
uci_return uci_perft() {
|
uci_return uci_perft() {
|
||||||
int depth = Serial.parseInt();
|
int depth = Serial.parseInt();
|
||||||
|
|
||||||
|
unsigned long startTime = millis();
|
||||||
unsigned long result = pseudo_perft(depth);
|
unsigned long result = pseudo_perft(depth);
|
||||||
|
unsigned long elapsed = millis() - startTime;
|
||||||
|
|
||||||
Serial.print(F("perft("));
|
Serial.print(F("perft("));
|
||||||
Serial.print(depth);
|
Serial.print(depth);
|
||||||
Serial.print(F(") result: "));
|
Serial.print(F(") result: "));
|
||||||
Serial.println(result);
|
Serial.println(result);
|
||||||
|
Serial.print(F("Completed in "));
|
||||||
|
Serial.print(elapsed);
|
||||||
|
Serial.println(F("ms"));
|
||||||
}
|
}
|
||||||
|
|
||||||
const char UCI_COMMAND_uci[] PROGMEM = "uci";
|
const char UCI_COMMAND_uci[] PROGMEM = "uci";
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue