viable step gate

This commit is contained in:
ethan merchant 2024-11-22 07:14:30 -05:00
parent 4762ebc184
commit 64e7b2ea2f

View file

@ -212,9 +212,11 @@ static class Mono
// step from head using directions towards the tail
// and stop at either 1 cell away from the tail or 5 spaces away from the head
bool viable = false;
bool viable_step = false;
XYZi cell = snake[0];
for (int step = 0; step < 5; step++)
{
viable_step = false;
int min_dist = 100;
XYZi min_cell = new();
int[] dir_indices = GetShuffledIndices(directions);
@ -228,9 +230,13 @@ static class Mono
min_dist = tail_dist;
min_cell = dir_cell;
viable = true;
viable_step = true;
}
}
cell = min_cell;
if (viable_step)
{
cell = min_cell;
}
// if (min_dist <= 1)
// {
// break;