poole@CPSC-M-POOLE01 haskell % ghci GHCi, version 9.4.8: https://www.haskell.org/ghc/ :? for help ghci> :l MagicSum [1 of 1] Compiling MagicSum ( MagicSum.hs, interpreted ) Ok, one module loaded. ghci> magicsum (a 6) (State (as [3,5], as [2,7]) (as [1,4,6,8,9])) ContinueGame (State ([2,7],[6,3,5]) [1,4,8,9]) ghci> magicsum (a 3) (State (as [5,7], as [2,9]) (as [1,3,4,6,8])) EndOfGame 1.0 (State ([],[]) [1,2,3,4,5,6,7,8,9]) ghci> :l Play [1 of 3] Compiling MagicSum ( MagicSum.hs, interpreted ) [2 of 3] Compiling Minimax ( Minimax.hs, interpreted ) [3 of 3] Compiling Play ( Play.hs, interpreted ) Ok, three modules loaded. ghci> play magicsum magicsum_start simple_player (0,0,0) Tournament results: 0 wins 0 losses 0 ties Who starts? 0=you, 1=computer, 2=exit. 0 State: ([],[]) choose one of [1,2,3,4,5,6,7,8,9] 6 The computer chose 5 State: ([6],[5]) choose one of [1,2,3,4,7,8,9] 8 The computer chose 4 State: ([8,6],[4,5]) choose one of [1,2,3,7,9] 1 You Won Tournament results: 1 wins 0 losses 0 ties Who starts? 0=you, 1=computer, 2=exit. 0 State: ([],[]) choose one of [1,2,3,4,5,6,7,8,9] 6 The computer chose 5 State: ([6],[5]) choose one of [1,2,3,4,7,8,9] 1 The computer chose 4 State: ([1,6],[4,5]) choose one of [2,3,7,8,9] 2 The computer chose 8 State: ([2,1,6],[8,4,5]) choose one of [3,7,9] 3 The computer chose 7 State: ([3,2,1,6],[7,8,4,5]) choose one of [9] 9 It's a tie Tournament results: 1 wins 0 losses 1 ties Who starts? 0=you, 1=computer, 2=exit. 1^?0 Tournament results: 1 wins 0 losses 1 ties Who starts? 0=you, 1=computer, 2=exit. 0 State: ([],[]) choose one of [1,2,3,4,5,6,7,8,9] 9 The computer chose 5 State: ([9],[5]) choose one of [1,2,3,4,6,7,8] 7 The computer chose 6 State: ([7,9],[6,5]) choose one of [1,2,3,4,8] 4 The computer chose 2 State: ([4,7,9],[2,6,5]) choose one of [1,3,8] 6 Illegal move: 6 State: ([4,7,9],[2,6,5]) choose one of [1,3,8] 1 The computer chose 8 Computer won! Tournament results: 1 wins 1 losses 1 ties Who starts? 0=you, 1=computer, 2=exit.