some defaults and the beggining of the init method
This commit is contained in:
@@ -0,0 +1,8 @@
|
|||||||
|
#include "chess.h"
|
||||||
|
#include <stdbool.h>
|
||||||
|
|
||||||
|
int board[BOARD_VERTICAL][BOARD_HORIZONTAL];
|
||||||
|
|
||||||
|
bool init_board() {
|
||||||
|
|
||||||
|
}
|
||||||
+34
@@ -0,0 +1,34 @@
|
|||||||
|
#ifndef CHESS_H
|
||||||
|
#define CHESS_H
|
||||||
|
|
||||||
|
/* the "board" is the playable area on which
|
||||||
|
* pieces move. pieces are represented by numbers:
|
||||||
|
* 0 - no piece
|
||||||
|
* 1 - pawn
|
||||||
|
* 2 - rook
|
||||||
|
* 3 - knight
|
||||||
|
* 4 - bishop
|
||||||
|
* 5 - queen
|
||||||
|
* 6 - king
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define BOARD_HORIZONTAL 8
|
||||||
|
#define BOARD_VERTICAL 8
|
||||||
|
//int board[BOARD_VERTICAL][BOARD_HORIZONTAL];
|
||||||
|
|
||||||
|
// the default arrangment of pieces on the board
|
||||||
|
#define BOARD_DEFAULT_CONFIG \
|
||||||
|
{\
|
||||||
|
{2,3,4,5,6,4,3,2}\
|
||||||
|
{1,1,1,1,1,1,1,1}\
|
||||||
|
{0,0,0,0,0,0,0,0}\
|
||||||
|
{0,0,0,0,0,0,0,0}\
|
||||||
|
{0,0,0,0,0,0,0,0}\
|
||||||
|
{1,1,1,1,1,1,1,1}\
|
||||||
|
{2,3,4,5,6,4,3,2}\
|
||||||
|
}
|
||||||
|
|
||||||
|
// initializes the board with the default configuration of pieces
|
||||||
|
bool init_board();
|
||||||
|
|
||||||
|
#endif // CHESS_H
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
#ifndef UTIL_H
|
||||||
|
#define UTIL_H
|
||||||
|
|
||||||
|
#endif // UTIL_H
|
||||||
Reference in New Issue
Block a user