-
Notifications
You must be signed in to change notification settings - Fork 89
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
Apple position #7
Comments
Hey @som911 |
Thank you very much @som911 and @maddy020. I very much appreciate your time and enthusiasm <3 Since this is a repo that's connected to a YouTube video I think it makes sense to leave the code as it was originally written. Hope you understand :) |
Wait, I forgot that I had already merged a PR and promised to merge another. I'll reopen and merge your PR :) Thank you for your time :) |
The apple position can stand on a snake position.
const nextApple = state => willEat(state) ? validApplePos(state)(rndPos(state)) : state.apple
const validApplePos = (state) => (randPos) => state.snake.find( pointEq(randPos) ) === undefined ? randPos : validApplePos(state)(rndPos(state))
The text was updated successfully, but these errors were encountered: