Snake render grid lines without extra space after last '#'
This commit is contained in:
parent
d613da4b6c
commit
4363118d9d
|
@ -81,8 +81,9 @@ void setup_grid()
|
||||||
printf("\e[H\e[J");
|
printf("\e[H\e[J");
|
||||||
|
|
||||||
// Render top line
|
// Render top line
|
||||||
for (int x = 0; x < g_grid_size.x + 2; x++)
|
putchar('#');
|
||||||
printf("# ");
|
for (int x = 1; x < g_grid_size.x + 2; x++)
|
||||||
|
printf(" #");
|
||||||
putchar('\n');
|
putchar('\n');
|
||||||
|
|
||||||
// Render side lines
|
// Render side lines
|
||||||
|
@ -90,8 +91,9 @@ void setup_grid()
|
||||||
printf("#\e[%dC#\n", g_grid_size.x * 2 + 1);
|
printf("#\e[%dC#\n", g_grid_size.x * 2 + 1);
|
||||||
|
|
||||||
// Render Bottom line
|
// Render Bottom line
|
||||||
for (int x = 0; x < g_grid_size.x + 2; x++)
|
putchar('#');
|
||||||
printf("# ");
|
for (int x = 1; x < g_grid_size.x + 2; x++)
|
||||||
|
printf(" #");
|
||||||
putchar('\n');
|
putchar('\n');
|
||||||
|
|
||||||
// Render snake head
|
// Render snake head
|
||||||
|
|
Loading…
Reference in New Issue