I see that I added board.h that I did not need to do at step 19 to data.cpp because data.cpp include extglobals.h that include board.h so I delete it.
I want to add
for (int i = 0; i < 64; i++) square = EMPTY; to the init function in board.cpp but EMPTY is not defined
so I need to add it to extglobals.h and also to define the value of EMPTY to be 0 in globals.h
content of globals.h
Code: Select all
#pragma once
#include "defines.h"//needed to include it so the compiler can know that MAX_CMD_BUFF is the constant I defined there
#include "board.h"
char CMD_BUFF[MAX_CMD_BUFF];
int CMD_BUFF_COUNT = 0;
BitMap BITSET[64];//added at step 18
int BOARDINDEX[9][9]; // index 0 is not used, only 1..8. added at step 19
Board board;//added at step 19
extern const unsigned char EMPTY = 0; // 0000 added in step 20
Code: Select all
#pragma once
#include "defines.h"
#include "board.h"//added at step 19
extern char CMD_BUFF[];
extern int CMD_BUFF_COUNT;
extern Board board;//added at step 19
extern BitMap BITSET[];//added at step 18
extern int BOARDINDEX[9][9]; //added at step 19
extern const unsigned char EMPTY;//added at step 20Code: Select all
//I added this file at step 19
#include "extglobals.h"//added in step 20
void Board::init()
{
for (int i = 0; i < 64; i++) square[i] = EMPTY;//added in step 20
}