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:
Julia Lange 2024-07-14 03:51:47 -07:00
parent 5e86f3ccb9
commit 28a3188ea3
Signed by: Julia
SSH key fingerprint: SHA256:5DJcfxa5/fKCYn57dcabJa2vN2e6eT0pBerYi5SUbto
3 changed files with 39 additions and 7 deletions

View file

@ -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);