From a9eb2790497736c89714240edc41c33288745978 Mon Sep 17 00:00:00 2001 From: Leon Vatthauer Date: Sun, 16 Jun 2024 15:35:14 +0200 Subject: [PATCH] minor --- app/Main.hs | 15 +-------------- src/Types.hs | 3 +-- 2 files changed, 2 insertions(+), 16 deletions(-) diff --git a/app/Main.hs b/app/Main.hs index 01b4ebf..00e447e 100644 --- a/app/Main.hs +++ b/app/Main.hs @@ -23,19 +23,6 @@ main = do print $ isValidGrid dummyGrid putStr . printGrid . fromJust $ solve dummyGrid --- print $ colView dummyGrid 4 --- print $ squareView dummyGrid 4 --- print $ squareToCoords dummyGrid 0 --- print $ squareToCoords dummyGrid 1 --- print $ squareToCoords dummyGrid 2 --- print $ squareToCoords dummyGrid 3 --- print $ squareToCoords dummyGrid 4 --- print $ squareToCoords dummyGrid 5 --- print $ squareToCoords dummyGrid 6 --- print $ squareToCoords dummyGrid 7 --- print $ squareToCoords dummyGrid 8 --- print $ allCells dummyGrid (>= 0) - test :: String test = "070000043040009610800634900094052000358460020000800530080070091902100005007040802" @@ -74,7 +61,7 @@ isFull :: Grid (Maybe Int) -> Bool isFull gr = allCells gr isJust isSolved :: Grid (Maybe Int) -> Bool -isSolved gr@(Grid g d) = isValidGrid gr && isFull gr +isSolved gr = isValidGrid gr && isFull gr extractSolution :: Grid (Maybe Int) -> Grid Int extractSolution gr = diff --git a/src/Types.hs b/src/Types.hs index 4eeae41..02ad916 100644 --- a/src/Types.hs +++ b/src/Types.hs @@ -1,8 +1,7 @@ module Types where import Data.List (intercalate) -import Data.List.Split (chunksOf, keepDelimsL, split, splitWhen, whenElt) -import Data.Maybe (isJust) +import Data.List.Split (chunksOf, keepDelimsL, split, whenElt) import Data.Vector (Vector) import qualified Data.Vector as V