Last active
June 4, 2020 12:10
-
-
Save dariathecracker/bd77b3616e421fb9e443b470cc0dda53 to your computer and use it in GitHub Desktop.
Tic-Tac-Toe Game ZIO
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
package ioleo.tictactoe | |
import zio.{console, App , ZEnv, ZIO} | |
import zio.console.Console | |
object TicTacToe extends App { | |
val program: ZIO[Console, Nothing, Unit] = | |
console.putStrLn("TicTacToe game!") | |
def run(args: List[String]): ZIO[ZEnv, Nothing, Int] = | |
program.foldM( | |
error => console.putStrLn(s"Execution failed with: $error") *> ZIO.succeed(1) | |
, _ => ZIO.succeed(0) | |
) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment