Skip to content

Instantly share code, notes, and snippets.

@waterlink
Last active October 15, 2018 15: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 waterlink/d110852c8dd434051fa382522809f051 to your computer and use it in GitHub Desktop.
Save waterlink/d110852c8dd434051fa382522809f051 to your computer and use it in GitHub Desktop.
step - 12
private fun rules(first: Throw,
second: Throw,
block: GameRules.() -> Boolean) =
GameRules(first, second).run(block)
class GameRules(private val first: Throw,
private val second: Throw) {
infix fun Throw.beats(other: Throw) =
first == this && second == other
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment