fp-games
fp-games copied to clipboard
Apple position
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))
Hey @som911 I would love to contribute in this issue Please elaborate which file needs this change
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 :)