From 9357f8327450bb8fa64230e434e060f48338aaa7 Mon Sep 17 00:00:00 2001 From: Andrew Cady Date: Tue, 29 Dec 2020 08:27:45 -0500 Subject: init --- main.hs | 12 ++++++++++++ shelf.hs | 28 ++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100755 main.hs create mode 100755 shelf.hs diff --git a/main.hs b/main.hs new file mode 100755 index 0000000..beeb0f3 --- /dev/null +++ b/main.hs @@ -0,0 +1,12 @@ +#!/usr/bin/env stack +{- stack script --resolver lts-16.14 --install-ghc + --ghc-options -Wall --ghc-options -Wno-unused-imports -} +{-# language NoImplicitPrelude #-} +{-# language DuplicateRecordFields #-} +import Rebase.Prelude +import Control.Lens + +main :: IO () +main = do + return () + diff --git a/shelf.hs b/shelf.hs new file mode 100755 index 0000000..2c27b52 --- /dev/null +++ b/shelf.hs @@ -0,0 +1,28 @@ +#!/usr/bin/env stack +{- stack script --resolver lts-16.14 --install-ghc + --ghc-options -Wall --ghc-options -Wno-unused-imports -} +{-# language NoImplicitPrelude #-} +{-# language DuplicateRecordFields #-} +import Rebase.Prelude +import Control.Lens + +type Inches = Rational + +boardLength, boardThickness, kickerHeight, numShelves, numHorizontals, availableSpace :: Inches +boardLength = 6 * 12 +boardThickness = 5/8 +kickerHeight = 4 +numShelves = 5 + +numHorizontals = numShelves + 1 +availableSpace = boardLength - kickerHeight - numHorizontals * boardThickness + +shelves :: [Rational] +shelves = [2%9, 2%9, 2%9, 1%6, 1%6] + + +main :: IO () +main = do + _ <- return $ assert $ sum shelves == 1 + print shelves + return () -- cgit v1.2.3