You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 7, 2022. It is now read-only.
@Taneb has suggested that instead of storing a previous tail cell, snake growth is handled by setting a boolean flag to indicate growing the snake on the next turn.
turnN: has a snakeA controlled by playerA. moveN: playerA moves onto a cell that contains food1. turnN+1:
snakeA has moved to have the head on that food1 cell.
food1 has been removed and a new food spawned.
moveN: playerA chooses any move. turnN+2:
snakeA's head has performed that move.
snakeA's previous rear segment has advanced by 1.
a new segment has been added to snakeA where that rear segment was.
Assess implications for collision detection. These rules need clearly encoding so AIs can be created that correctly reason about the world.
The text was updated successfully, but these errors were encountered:
At present Game::snake_eatinghttps://github.com/sirpent-team/sirpent-rust/blob/master/src/game.rs#L147-L157 is used to grow the snake immediately when a food is eaten. For context, snake_eating takes a TurnState that we're transitioning to. The self.turn_state during its execution is the turn being transitioned from.
Both methods and that field will want some changes, at least. The actual delayed snake growth should happen in Game::advance_turnaround the same time as snake_movement. I'd suggest performing snake_movementthen growing snakes then doing remove_snakes.
@Taneb has suggested that instead of storing a previous tail cell, snake growth is handled by setting a boolean flag to indicate growing the snake on the next turn.
Assess implications for collision detection. These rules need clearly encoding so AIs can be created that correctly reason about the world.
The text was updated successfully, but these errors were encountered: