diff --git a/src/main.c b/src/main.c index cb52e00..570ad51 100644 --- a/src/main.c +++ b/src/main.c @@ -28,7 +28,7 @@ Food generateFood(Player *player) void resetCoordinates(void) { - printf("\033[0;0H"); + printf("\e[1;1H\e[2J"); } int main(int argc, char **argv) diff --git a/src/player.c b/src/player.c index 9170645..3cab937 100644 --- a/src/player.c +++ b/src/player.c @@ -36,7 +36,7 @@ bool playerCheckSelfCollision(Player *player) PlayerNode *nodei, *nodej; for (nodei = player->tail; nodei != NULL; nodei = nodei->next) for (nodej = nodei->next; nodej != NULL; nodej = nodej->next) - if (nodei->x == nodej->x && nodei->y == nodej->x) + if (nodei->x == nodej->x && nodei->y == nodej->y) return true; return false; }