Skip to content

Instantly share code, notes, and snippets.

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