Remove Move.h (moved to Types.h)

This commit is contained in:
Quinten Kock 2020-06-20 03:38:03 +02:00
parent e00f9231fb
commit 5507db23dd
7 changed files with 21 additions and 22 deletions

View File

@ -5,9 +5,6 @@
#include "Config.h"
#include "Board.h"
#include "Move.h"
#include "Movegen.h"
#include "Types.h"
#include "Uci.h"
void setup() {

View File

@ -3,7 +3,6 @@
#include "Types.h"
#include "Panic.h"
#include "Move.h"
namespace Board {
@ -289,7 +288,6 @@ namespace Board {
field[PTR_SIDE_AND_CASTLERIGHT] ^= 0x01;
field[PTR_ENPASSANT] = u.captured >> 4;
}
}

15
Move.h
View File

@ -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

View File

@ -2,7 +2,6 @@
#define __MOVEGEN_H_INC
#include "Types.h"
#include "Move.h"
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};

View File

@ -1,6 +1,9 @@
#ifndef __TASKS_H_INC
#define __TASKS_H_INC
#include "Types.h"
#include "Movegen.h"
unsigned long pseudo_perft(byte depth) {
// only checks pseudolegality
// but, it should work overall
@ -100,7 +103,7 @@ void debug_ep() {
void bench() {
// TODO reduce code size of this (by moving repeated constants from here to PROGMEM and loops?)
unsigned long startTime = micros();
Board::make({0x14, 0x34, P_EMPTY});

10
Types.h
View File

@ -40,4 +40,14 @@ char piece_to_char(Piece 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

7
Uci.h
View File

@ -37,11 +37,18 @@ namespace Uci {
uci_return uci_perft() {
int depth = Serial.parseInt();
unsigned long startTime = millis();
unsigned long result = pseudo_perft(depth);
unsigned long elapsed = millis() - startTime;
Serial.print(F("perft("));
Serial.print(depth);
Serial.print(F(") result: "));
Serial.println(result);
Serial.print(F("Completed in "));
Serial.print(elapsed);
Serial.println(F("ms"));
}
const char UCI_COMMAND_uci[] PROGMEM = "uci";