cleaning up comments

This commit is contained in:
DarthMooMancer
2025-10-09 12:49:25 -04:00
parent 6c6605fcb5
commit f9d0e9fb01
+3 -7
View File
@@ -1,6 +1,6 @@
#include "element.hpp"
#include <cstdlib>
#include <cstring>
#include <cstdlib>
#include <ctime>
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++;
}