module Main where import Alone ( aloneInARoom ) import Terminal.Game import System.IO.Temp ( emptySystemTempFile ) -- plays the game and, once you quit, shows a replay of the session main :: IO () main = do tf <- emptySystemTempFile "alone-record.gr" playback tf playback :: FilePath -> IO () playback f = do prompt "Press to play the game." recordGame aloneInARoom f prompt "Press to watch playback." es <- readRecord f narrateGame aloneInARoom es prompt "Playback over! Press to quit." where prompt :: String -> IO () prompt s = putStrLn s >> () <$ getLine