ArduChess/ArduChess.ino

76 lines
1.2 KiB
C++

#pragma GCC optimize ("-O3")
#include <Arduino.h>
#include "Config.h"
#include "Board.h"
#include "Move.h"
#include "Movegen.h"
#include "Types.h"
Board b = Board();
void bench() {
b = Board();
int startTime = micros();
b.make({0x14, 0x34, P_EMPTY});
b.make({0x64, 0x54, P_EMPTY});
b.make({0x34, 0x44, P_EMPTY});
b.make({0x63, 0x43, P_EMPTY});
b.make({0x44, 0x53, P_EMPTY});
b.unmake();
b.unmake();
b.unmake();
b.unmake();
b.unmake();
int elapsed = micros() - startTime;
Serial.print(elapsed);
Serial.println(F("microseconds for 5 moves"));
}
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
bench();
Serial.println(F("hello"));
b = Board();
int startTime = micros();
b.print();
b.make({0x14, 0x34, P_EMPTY});
b.print();
b.make({0x64, 0x54, P_EMPTY});
b.print();
b.make({0x34, 0x44, P_EMPTY});
b.print();
b.make({0x63, 0x43, P_EMPTY});
b.print();
b.make({0x44, 0x53, P_EMPTY});
b.print();
b.unmake();
b.print();
b.unmake();
b.print();
b.unmake();
b.print();
b.unmake();
b.print();
b.unmake();
b.print();
int elapsed = micros() - startTime;
Serial.print(elapsed);
Serial.println(F("microseconds for 5 moves"));
}
void loop() {
// put your main code here, to run repeatedly:
}