Skip to content

Instantly share code, notes, and snippets.

@mukeshsolanki
Created May 27, 2022 05:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mukeshsolanki/34b43d51336d2f98278675663785f535 to your computer and use it in GitHub Desktop.
Save mukeshsolanki/34b43d51336d2f98278675663785f535 to your computer and use it in GitHub Desktop.
val newPosition = it.snake.first().let { poz ->
mutex.withLock {
Pair(
(poz.first + move.first + BOARD_SIZE) % BOARD_SIZE,
(poz.second + move.second + BOARD_SIZE) % BOARD_SIZE
)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment