Skip to content

Instantly share code, notes, and snippets.

Created July 20, 2017 06:42
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 anonymous/2f1236f431b114e714cd55f0fc381557 to your computer and use it in GitHub Desktop.
Save anonymous/2f1236f431b114e714cd55f0fc381557 to your computer and use it in GitHub Desktop.
the description for this gist
class ChessPlayer(moves: Int,
rooks: Stream[Rook],
terminationLatch: CountDownLatch)
extends Runnable {
val lRand = ThreadLocalRandom.current()
override def run(): Unit = {
rooks.take(moves).foreach(_.updatePosition((lRand.nextInt, lRand.nextInt)))
terminationLatch.countDown()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment