Last active
June 4, 2020 12:10
-
-
Save dariathecracker/49f87442dc5f2394db151e34cec0f5dc to your computer and use it in GitHub Desktop.
Tica Tac Toe game
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