summary refs log tree commit diff homepage
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2021-01-29 02:20:01 -0500
committerJune McEnroe <june@causal.agency>2021-01-29 02:20:01 -0500
commit4fcaec541f75b78126095e3b7b2b74ac55a950fd (patch)
treee0005ee62711afe5b40a5c6551e05c5225cc4226
parentDon't let the snake snap its own neck (diff)
downloadplay-4fcaec541f75b78126095e3b7b2b74ac55a950fd.tar.gz
play-4fcaec541f75b78126095e3b7b2b74ac55a950fd.zip
Give the snake a tail
-rw-r--r--snake.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/snake.c b/snake.c
index 4b36ff9..62f660f 100644
--- a/snake.c
+++ b/snake.c
@@ -159,7 +159,11 @@ static void draw(void) {
 		}
 	}
 	for (uint i = 0; i < snake.len; ++i) {
-		mvaddch(snake.y[i], snake.x[i], '#' | COLOR_PAIR(2));
+		if (i + 1 < snake.len) {
+			mvaddch(snake.y[i], snake.x[i], '#' | COLOR_PAIR(2));
+		} else {
+			mvaddch(snake.y[i], snake.x[i], '*' | COLOR_PAIR(2));
+		}
 	}
 	mvaddch(head.y, head.x, '@' | A_BOLD);
 	move(head.y, head.x);