Hello friends,
So i have been working on this project of mine. Basicly im trying to make my own version of the square off chessboard ( https://squareoffnow.com/ )
i'm trying to write my own chess engine for arduino, since i cant seem to find one online.
I do have some code written down, but i keep getting this one error that i just can't seem to fix. the error states: "expected declaration before '}' token error."
does anyone here know what i am doing wrong? i have left my code down under here. the red part is where i am getting the error.
thanks in advance!
ps. if anyone does know a working chess engine for arduino, i would love it if you could share it with me! i would save me a big headache!
#ifndef DEFS_H
#define DEFS_Htypedef unsigned long long U64;
#define NAME "wilson"
#define BRD_SQ_NUM 120#define MAXGAMEMOVES 1800
enum { EMPTY, wP,wN,wB,wR,wQ,wK,bP,bN,bB,bR,bQ,bK };
enum { FILE_A,FILE_B,FILE_C,FILE_D,FILE_E,FILE_F,FILE_G,FILE_H,FILE_NONE };
enum { RANK_1,RANK_2,RANK_3,RANK_4,RANK_5,RANK_6,RANK_7,RANK_8,RANK_NONE};enum {WHITE, BLACK, BOTH};
enum {
AA1 = 21,B1,C1,D1,E1,F1,G1,H1,
AA2 = 31,B2,C2,D2,E2,F2,G2,H2,
AA3 = 41,B3,C3,D3,E3,F3,G3,H3,
AA4 = 51,B4,C4,D4,E4,F4,G4,H4,
AA5 = 61,B5,C5,D5,E5,F5,G5,H5,
AA6 = 71,B6,C6,D6,E6,F6,G6,H6,
AA7 = 81,B7,C7,D7,E7,F7,G7,H7,
AA8 = 91,B8,C8,D8,E8,F8,G8,H8,NO_SQ
};enum { FALSE, TRUE };
enum { WKCA = 1, WQCA = 2, BKCA=4, BQCA=8};
typedef struct {
int move;
int castePerm;
int enPas;
int fiftyMove;
U64 posKey;} S_UNDO;
typedef struct {
int pieces [BRD_SQ_NUM];
U64 pawns[3];int kingSq[2];
int side;
int enPas;
int fiftyMove;int ply;
int hisPly;int castlePerm;
U64 posKey;
int pceNum [13];
int bigPce [3];
int majPce[3];
int minPce [3];S_UNDO history[MAXGAMEMOVES];
} S_BOARD;
// macros //
#define FR2SQ(f,r) ( (21 + (f)) + ( (r)*10))//globals
extern int sq120ToSq64 [BRD_SQ_NUM];
extern int sq64ToSq120[64];//functions
extern void allInIt ();
#endif
defs.h (1.36 KB)
init.c (606 Bytes)
makefile.ino (24 Bytes)
testserver.ino (130 Bytes)
wilson.ino (104 Bytes)