jag

snake_c

public

Small snake game in C

Star0
Watch0

Commit 013ddd4ca3f1

tarball

Jaglekon <58274093+Jaglekon@users.noreply.github.com>2026-04-02 17:16 UTC

1 file changed+6-6
score actually
Modified file: snake.c+6 additions−6 deletions
@@ -503,7 +503,7 @@ end_of_program:
503503 printf("\r_");
504504 fflush(stdout);
505505
506- uint8_t number_charcters = 0;
506+ uint8_t number_characters = 0;
507507
508508 while(true) {
509509 char string[STRING_LEN] = {};
@@ -512,18 +512,18 @@ end_of_program:
512512 if (length_string > 0) {
513513
514514 if (string[0] == '\n'){
515- leader_board[i].name[number_charcters] = '\0';
515+ leader_board[i].name[number_characters] = '\0';
516516 break;
517517 }
518518
519- if (string[0] == 127 && number_charcters > 0) {
519+ if (string[0] == 127 && number_characters > 0) {
520520 printf("\033[%c \033[%c\033[%c_", LEFT_CODE, LEFT_CODE, LEFT_CODE);
521- leader_board[i].name[--number_charcters] = '\0';
521+ leader_board[i].name[--number_characters] = '\0';
522522 }
523523
524- if (isalnum(string[0]) && number_charcters < SCORE_LEN - 1) {
524+ if (isalnum(string[0]) && number_characters < SCORE_LEN - 2) {
525525 printf("\033[%c%c_", LEFT_CODE, string[0]);
526- leader_board[i].name[number_charcters++] = string[0];
526+ leader_board[i].name[number_characters++] = string[0];
527527 }
528528 }
529529 fflush(stdout);