Created
July 20, 2017 06:42
-
-
Save anonymous/2f1236f431b114e714cd55f0fc381557 to your computer and use it in GitHub Desktop.
the description for this gist
This file contains 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
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