{-# LANGUAGE UnicodeSyntax #-} -- | Usage: Hit /q/ to abort the match module Main where import Control.Monad import System.Exit import Prelude.Unicode import Data.Binary import SoccerFun.Tape import SoccerFun.MatchControl import SoccerFun.MatchGame import System.Environment main ∷ IO () main = do prog ← getProgName args ← getArgs let (t1,t2) = case args of [t1,t2] → (t1,t2) notTwo → error $ unlines ["Record a match between two teams and ", "Usage: " ⧺ prog ⧺ " ", " where both arguments are paths to directories containing a team module."] (t1name,t2name,match) ← dynSetupMatch t1 t2 let tape = recordMatch match encodeFile (t1name ⧺ "-" ⧺ t2name ⧺ ".sft") tape let Tape steps = tape endOfMatch = snd (last steps) finalScore = score endOfMatch putStrLn $ show (fst finalScore) ⧺ " / " ⧺ show (snd finalScore)