Skip to content

Commit 1b49356

Browse files
committed
Height of map ++ to avoid weird bug
1 parent 7bdae85 commit 1b49356

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

c/Snake/clear_version/GlobalVar.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#define HEAD_STRING "@"
1212
#define BODY 'O' // The shape of snake body
1313
#define BODY_STRING "O"
14-
char a[HEIGHT][WIDTH] = {{BODY, BODY, BODY, HEAD}}; // The initial char is 0
14+
char a[HEIGHT + 1][WIDTH] = {{BODY, BODY, BODY, HEAD}}; // The initial char is 0
1515
char *p[HEIGHT * WIDTH] = {&a[0][3], &a[0][2], &a[0][1],
1616
&a[0][0]}; // p[0] stand for snake head
1717

0 commit comments

Comments
 (0)