Lines Matching refs:length
21 uint8_t length; member
191 snake.length = MIN_LENGTH; in greedySnake_init()
199 for (uint8_t i = 0; i < snake.length; i++) { in greedySnake_init()
221 for (; i < snake.length - 2; i++) { in draw_snake()
239 for (i = 0; i < snake.length; i++) { in gen_food()
243 if (i == snake.length) { in gen_food()
296 if (snake.XPos[snake.length - 1] < 0 || in check_snake_alive()
297 snake.XPos[snake.length - 1] >= snake_game.pos_x_max || in check_snake_alive()
298 snake.YPos[snake.length - 1] < 0 || in check_snake_alive()
299 snake.YPos[snake.length - 1] >= snake_game.pos_y_max) { in check_snake_alive()
302 for (int i = 0; i < snake.length - 1; i++) { in check_snake_alive()
303 if (snake.XPos[snake.length - 1] == snake.XPos[i] && in check_snake_alive()
304 snake.YPos[snake.length - 1] == snake.YPos[i]) { in check_snake_alive()
318 for (i = 0; i < snake.length - 1; i++) { in Snake_Run()
322 snake.XPos[snake.length - 1] = snake.XPos[snake.length - 2] + 1; in Snake_Run()
323 snake.YPos[snake.length - 1] = snake.YPos[snake.length - 2] - 0; in Snake_Run()
329 for (i = 0; i < snake.length - 1; i++) { in Snake_Run()
333 snake.XPos[snake.length - 1] = snake.XPos[snake.length - 2] - 1; in Snake_Run()
334 snake.YPos[snake.length - 1] = snake.YPos[snake.length - 2] + 0; in Snake_Run()
340 for (i = 0; i < snake.length - 1; i++) { in Snake_Run()
344 snake.XPos[snake.length - 1] = snake.XPos[snake.length - 2] + 0; in Snake_Run()
345 snake.YPos[snake.length - 1] = snake.YPos[snake.length - 2] + 1; in Snake_Run()
351 for (i = 0; i < snake.length - 1; i++) { in Snake_Run()
355 snake.XPos[snake.length - 1] = snake.XPos[snake.length - 2] + 0; in Snake_Run()
356 snake.YPos[snake.length - 1] = snake.YPos[snake.length - 2] - 1; in Snake_Run()
373 if (snake.XPos[snake.length - 1] == food.x && in check_food_eaten()
374 snake.YPos[snake.length - 1] == food.y) { in check_food_eaten()
375 snake.length++; in check_food_eaten()
376 snake.XPos[snake.length - 1] = food.x; in check_food_eaten()
377 snake.YPos[snake.length - 1] = food.y; in check_food_eaten()