Skip to content

Instantly share code, notes, and snippets.

@ShelbyCohen
Created December 18, 2019 03:52
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 ShelbyCohen/6078c5690ae9a307d290940625fdad03 to your computer and use it in GitHub Desktop.
Save ShelbyCohen/6078c5690ae9a307d290940625fdad03 to your computer and use it in GitHub Desktop.
public override fun play(): List<Map.Entry<Int, List<String>>> {
val scoreOfALetter = Function<Int, Flux<Int>> { letter -> Flux.just(letterScores[letter - 'a'.toInt()]) }
val letterScore = Function<Map.Entry<Int, LongWrapper>, Flux<Int>> { entry ->
Flux.just(
letterScores[entry.key - 'a'.toInt()] * Integer.min(
entry.value.get().toInt(),
scrabbleAvailableLetters[entry.key - 'a'.toInt()]
)
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment