aboutsummaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/main.c b/src/main.c
index d74335c..9d3205d 100644
--- a/src/main.c
+++ b/src/main.c
@@ -23,6 +23,8 @@ int is_center_index(int index) {
}
int is_allowed_placement(char* tile, int index, char* board) {
+ if (board[index] != EMPTY) return 0;
+
for (int i = 0; i < 4; i++) {
char neighbor = board[index + neighbor_increments[i]];
if (neighbor != EMPTY && neighbor != tile[i + 1]) return 0;