Skip to content

Instantly share code, notes, and snippets.

@Raagh
Created April 14, 2020 18:24
Show Gist options
  • Save Raagh/b7a86d0961473293e5ca5a053a2fb043 to your computer and use it in GitHub Desktop.
Save Raagh/b7a86d0961473293e5ca5a053a2fb043 to your computer and use it in GitHub Desktop.
Functional Snake Game - Part 2
const COLUMNS = 15
const ROWS = 15
const SPEED = 125
let uglyMutableState = initialState
const displayState = display(COLUMNS, ROWS)
const runGameLoop = () => {
setInterval(() => {
displayState(uglyMutableState)
}, SPEED)
}
runGameLoop()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment