Add rudimentary drop_tile and interactive mode
Adds basic drop_tile implementation. Though doesn't check for wins Adds an interactive mode for testing drop_tile, which allows the player to input which tile-space to drop on.
This commit is contained in:
parent
5e86f3ccb9
commit
28a3188ea3
3 changed files with 39 additions and 7 deletions
|
|
@ -4,9 +4,9 @@
|
|||
#include <stddef.h>
|
||||
|
||||
enum Tile {
|
||||
BLACK = -1,
|
||||
EMPTY = 0,
|
||||
RED,
|
||||
BLACK
|
||||
RED = 1,
|
||||
};
|
||||
|
||||
struct Board {
|
||||
|
|
@ -17,7 +17,7 @@ struct Board {
|
|||
enum Tile next_player;
|
||||
};
|
||||
|
||||
#define IDX(i, j, board) (board->tilemap[j*(board->height) + i])
|
||||
#define IDX(i, j, board) (board->tilemap[j*(board->width) + i])
|
||||
|
||||
// Returns a board struct with height and width based on parameters
|
||||
struct Board *make_board(size_t height, size_t width);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue