From f9d0e9fb0125bc6c93109d193e4a28a3eda64c3a Mon Sep 17 00:00:00 2001 From: DarthMooMancer <107283522+DarthMooMancer@users.noreply.github.com> Date: Thu, 9 Oct 2025 12:49:25 -0400 Subject: [PATCH] cleaning up comments --- src/element.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/element.cpp b/src/element.cpp index e927b46..08d30af 100644 --- a/src/element.cpp +++ b/src/element.cpp @@ -1,6 +1,6 @@ #include "element.hpp" -#include #include +#include #include int _score = 0; @@ -54,11 +54,6 @@ void move_tail_indicies(Point** buffer) { } } -void _append_tail(Point** buffer) { - memmove(buffer + 4, buffer + 3, (_snake_size - 3) * sizeof(Point*)); - buffer[3] = new Point { ROW, COL, '@' }; -} - void on_fruit_eaten(Point* (*board)[COL], Point** buffer) { int row, col; if(buffer[2]->m_row == buffer[0]->m_row && buffer[2]->m_col == buffer[0]->m_col) { @@ -67,7 +62,8 @@ void on_fruit_eaten(Point* (*board)[COL], Point** buffer) { col = (rand() % COL); } while (board[row][col] != nullptr); buffer[2]->set_new_point(row, col); - _append_tail(buffer); + memmove(buffer + 4, buffer + 3, (_snake_size - 3) * sizeof(Point*)); + buffer[3] = new Point { ROW, COL, '@' }; _score++; _snake_size++; }