From a75449b1d9d5012991db123f62a208860b3cd590 Mon Sep 17 00:00:00 2001 From: eug-vs Date: Tue, 29 Mar 2022 14:21:54 +0300 Subject: fix: don't allow overlapping tiles --- src/main.c | 2 ++ 1 file changed, 2 insertions(+) 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; -- cgit v1.2.3