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 apple position can stand on a snake position.
const nextApple = state => willEat(state) ? validApplePos(state)(rndPos(state)) : state.appleconst validApplePos = (state) => (randPos) => state.snake.find( pointEq(randPos) ) === undefined ? randPos : validApplePos(state)(rndPos(state))