diff options
Diffstat (limited to 'shelf.hs')
-rwxr-xr-x | shelf.hs | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -40,8 +40,8 @@ numShelves = length shelves | |||
40 | numHorizontals = numShelves + 1 | 40 | numHorizontals = numShelves + 1 |
41 | availableSpace = boardLength - kickerHeight - (toRational numHorizontals) * boardThickness | 41 | availableSpace = boardLength - kickerHeight - (toRational numHorizontals) * boardThickness |
42 | 42 | ||
43 | shelves :: [Rational] | 43 | shelves :: [Inches] |
44 | shelves = map (* availableSpace) [2%9, 2%9, 2%9, 1%6, 1%6] | 44 | shelves = map (* availableSpace) $ map (% 18) [4, 4, 4, 3, 3] |
45 | 45 | ||
46 | positions, positions' :: [Inches] | 46 | positions, positions' :: [Inches] |
47 | positions = map sum $ (tail . inits) $ concatMap (: [boardThickness]) $ kickerHeight : shelves | 47 | positions = map sum $ (tail . inits) $ concatMap (: [boardThickness]) $ kickerHeight : shelves |
@@ -50,7 +50,7 @@ positions' = map (boardLength -) positions | |||
50 | 50 | ||
51 | main :: IO () | 51 | main :: IO () |
52 | main = do | 52 | main = do |
53 | void $ return $ assert $ sum shelves == 1 | 53 | return $ assert $ sum shelves == 1 |
54 | mapM_ putStrLn $ formatFeet <$> positions | 54 | mapM_ putStrLn $ formatFeet <$> positions |
55 | putStrLn "" | 55 | putStrLn "" |
56 | mapM_ putStrLn $ formatFeet <$> positions' | 56 | mapM_ putStrLn $ formatFeet <$> positions' |