diff options
author | Andrew Cady <d@jerkface.net> | 2020-12-29 08:27:45 -0500 |
---|---|---|
committer | Andrew Cady <d@jerkface.net> | 2020-12-29 08:27:45 -0500 |
commit | 9357f8327450bb8fa64230e434e060f48338aaa7 (patch) | |
tree | af40f92bbc06f1ea6d75b2ce7466a3c16ed92bd1 |
init
-rwxr-xr-x | main.hs | 12 | ||||
-rwxr-xr-x | shelf.hs | 28 |
2 files changed, 40 insertions, 0 deletions
@@ -0,0 +1,12 @@ | |||
1 | #!/usr/bin/env stack | ||
2 | {- stack script --resolver lts-16.14 --install-ghc | ||
3 | --ghc-options -Wall --ghc-options -Wno-unused-imports -} | ||
4 | {-# language NoImplicitPrelude #-} | ||
5 | {-# language DuplicateRecordFields #-} | ||
6 | import Rebase.Prelude | ||
7 | import Control.Lens | ||
8 | |||
9 | main :: IO () | ||
10 | main = do | ||
11 | return () | ||
12 | |||
diff --git a/shelf.hs b/shelf.hs new file mode 100755 index 0000000..2c27b52 --- /dev/null +++ b/shelf.hs | |||
@@ -0,0 +1,28 @@ | |||
1 | #!/usr/bin/env stack | ||
2 | {- stack script --resolver lts-16.14 --install-ghc | ||
3 | --ghc-options -Wall --ghc-options -Wno-unused-imports -} | ||
4 | {-# language NoImplicitPrelude #-} | ||
5 | {-# language DuplicateRecordFields #-} | ||
6 | import Rebase.Prelude | ||
7 | import Control.Lens | ||
8 | |||
9 | type Inches = Rational | ||
10 | |||
11 | boardLength, boardThickness, kickerHeight, numShelves, numHorizontals, availableSpace :: Inches | ||
12 | boardLength = 6 * 12 | ||
13 | boardThickness = 5/8 | ||
14 | kickerHeight = 4 | ||
15 | numShelves = 5 | ||
16 | |||
17 | numHorizontals = numShelves + 1 | ||
18 | availableSpace = boardLength - kickerHeight - numHorizontals * boardThickness | ||
19 | |||
20 | shelves :: [Rational] | ||
21 | shelves = [2%9, 2%9, 2%9, 1%6, 1%6] | ||
22 | |||
23 | |||
24 | main :: IO () | ||
25 | main = do | ||
26 | _ <- return $ assert $ sum shelves == 1 | ||
27 | print shelves | ||
28 | return () | ||