Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is Cornelius afraid of 0's? #7

Open
ChaelCodes opened this issue Sep 22, 2021 · 5 comments
Open

Is Cornelius afraid of 0's? #7

ChaelCodes opened this issue Sep 22, 2021 · 5 comments

Comments

@ChaelCodes
Copy link
Owner

Description

I've been watching Cornelius for a while, and I think Cornelius is afraid of the 0 location on the x and y axis of the board!

cornelius wiggles away from zero cornelius would rather eat themself than go onto the 0 x axis. more wiggly cornelius avoiding 0 on x and y Cornelius avoids scary 0s and runs into the wall more wiggly cornelius

This makes perfect sense. Cornelius is a very superstitious snek, and 0 is an unlucky number. Dividing by zero is death for a Battlesnake, and everyone knows most off-by-one errors happen near 0.

Changes

What can we do to help Cornelius feel safe on the 0 x/y axis?

@Caleb-T-Owens
Copy link
Contributor

Coord { y: 0, .. } => false,
does this not need to be -1 because what that is saying is that 0 is an illigal move

@ChaelCodes
Copy link
Owner Author

Yeah!! That's what I did wrong. 🤣 @matthewd actually mentioned it several times on stream, but I didn't write a todo and procrastinated on fixing it. At the end of the stream, I totally forgot. So now CorneliusCodes is canonically afraid of 0.

@Caleb-T-Owens
Copy link
Contributor

the poor love

@Caleb-T-Owens
Copy link
Contributor

What I might do given I have some time, I'll write a contingency plan for corny to follow if he gets stuck forced out of his comfort zone

@Caleb-T-Owens
Copy link
Contributor

My solution is going to allow the creation of various "contingency plans" that get used if safe route is found, and it will run through the plans, trying to plan to see if there is a possible escape at all. I'm going to implement just the 0, 0 plan, but some other planes that could be added for Corny to follow are: Move to where a snake tail end is, and Move to where a snake head could be ( since potential head spots are going to be made illegal )

I see this as a way to add some heuristic scrambling where behavior defined here may not succeed in all cases, but is generally better than not submitting a move (as currently if the .unwrap() on the move fails, it throws it)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants