Created
April 14, 2020 18:27
-
-
Save Raagh/6b30c080c4644404bc8edc2cc25acea4 to your computer and use it in GitHub Desktop.
Functional Snake Game - Part 2 - nextApple
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const nextApple = r.curry((cols, rows, state) => | |
willEat(r.head(state.snake), state.apple) | |
? { ...state, apple: point(randomPos(cols), randomPos(rows)) } | |
: state | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment