-
-
Save monkey-codes/61a4de6c76d6ba98178cb37efeaba521 to your computer and use it in GitHub Desktop.
Tic Tac Toe Program
This file contains hidden or 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
| fun program(programState: ProgramState): IO<Unit> = | |
| IOs.gameScreen(programState) | |
| .flatMap { currentState -> IOs.gameInput(currentState) } | |
| .flatMap { currentState -> program(currentState) } | |
| fun main() { | |
| either { | |
| val game = Game.new().bind() | |
| val p = program(game.right()) | |
| Interpreter.run(p) | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment