Signed-off-by: Jack Bond-Preston <jackbondpreston@outlook.com>
This commit is contained in:
Jack Bond-Preston 2021-12-12 02:27:33 +00:00
parent 1d05383548
commit d1a9c7516b
2 changed files with 0 additions and 4 deletions

2
4/4.hs
View File

@ -47,8 +47,6 @@ processTurns :: [[[Int]]] -> [Int] -> [[Bool]]
processTurns boards draws = map (checkBoards boards) turns processTurns boards draws = map (checkBoards boards) turns
where turns = [ take n draws | n <- [1 .. length draws ] ] where turns = [ take n draws | n <- [1 .. length draws ] ]
-- ret: (turn no, board win states)
getWinner :: [[[Int]]] -> [Int] -> (Int, Int) getWinner :: [[[Int]]] -> [Int] -> (Int, Int)
getWinner boards draws = (turnNo, winnerIndex) getWinner boards draws = (turnNo, winnerIndex)
where results = processTurns boards draws where results = processTurns boards draws

2
5/5.hs
View File

@ -13,8 +13,6 @@ import qualified Data.Map as Map
type Coord = (Int, Int) type Coord = (Int, Int)
type LineEnds = (Coord, Coord) type LineEnds = (Coord, Coord)
type Grid = Map Coord Integer
int :: Parser Int int :: Parser Int
int = read <$> many1 digit int = read <$> many1 digit