summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKai Stevenson <kai@kaistevenson.com>2023-02-06 16:05:45 -0800
committerKai Stevenson <kai@kaistevenson.com>2023-02-06 16:05:45 -0800
commitc29474c03667bcbe99e48fd565ce6736233175d1 (patch)
tree022488e3bbdc71dbc419add106d95faf0c0fe5db
parent76eeb585ed13fe96321489641a485ce387823db9 (diff)
changed obstacle colour, changed obstacle quantity math
-rw-r--r--snake.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/snake.c b/snake.c
index 3bb0bd7..7465e3f 100644
--- a/snake.c
+++ b/snake.c
@@ -90,7 +90,7 @@ int main(int argc, char **argv) {
}
}
/* check argument compatibility */
- if(obstacles * 2 > boardSize) {
+ if((obstacles * obstacleSize) * 3 > pow(boardSize, 2)) {
fprintf(stderr, "%stoo many obstacles. Please try again.%s\n", RED, COLOR_RESET);
exit(1);
}
@@ -356,7 +356,7 @@ void draw_board() {
}
else if(type == 4) {
/* obstacle */
- printf("%s# %s", MAG, COLOR_RESET);
+ printf("%s# %s", RED, COLOR_RESET);
}
}
printf("\n");