From 521227fde4cb513c65279ed0886675eb2c72581b Mon Sep 17 00:00:00 2001 From: Andrew Cady Date: Thu, 31 Dec 2020 10:21:26 -0500 Subject: built shelf #1 w/ this code --- shelf.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/shelf.hs b/shelf.hs index 8389d63..9544acf 100755 --- a/shelf.hs +++ b/shelf.hs @@ -40,8 +40,8 @@ numShelves = length shelves numHorizontals = numShelves + 1 availableSpace = boardLength - kickerHeight - (toRational numHorizontals) * boardThickness -shelves :: [Rational] -shelves = map (* availableSpace) [2%9, 2%9, 2%9, 1%6, 1%6] +shelves :: [Inches] +shelves = map (* availableSpace) $ map (% 18) [4, 4, 4, 3, 3] positions, positions' :: [Inches] positions = map sum $ (tail . inits) $ concatMap (: [boardThickness]) $ kickerHeight : shelves @@ -50,7 +50,7 @@ positions' = map (boardLength -) positions main :: IO () main = do - void $ return $ assert $ sum shelves == 1 + return $ assert $ sum shelves == 1 mapM_ putStrLn $ formatFeet <$> positions putStrLn "" mapM_ putStrLn $ formatFeet <$> positions' -- cgit v1.2.3