module Main where
import MyUtil import Hub import Rim import Spoke import Monad
showResult :: [[Float]] -> [Int] -> [Spoke] -> IO () showResult fll@(fl:_) kl st = do let fl' = foldl (\x y -> x ++ [fl !! y]) [(fl !! head kl)] (tail kl) case fll of [f] -> show' fl' kl [f,f1] -> do putStrLn "Right" showResult [f] [3,4] st putStrLn "Left" showResult [f1] [0,2,3,4] st [f,f1,f2] -> do putStrLn "Front" showResult [f] [0,2,3,4] st putStrLn "Rear Right" showResult [f1] [3,4] st putStrLn "Rear Left" showResult [f2] [0,2,3,4] st [f,f1,f2,f3] -> do putStrLn "Front disk side" showResult [f] [3,4] st putStrLn "Front no disk side" showResult [f1] [0,2,3,4] st putStrLn "Rear Right" showResult [f2] [3,4] st putStrLn "Rear Left" showResult [f3] [0,2,3,4] st where show' fl kl = zipWithM_ (\x y -> do putStr (show y) putStr "X: " putStr (round10 x) putStr "mm\n" showMatched (round x - 1) st showMatched (round x) st) fl kl
showMatched :: Int -> [Spoke] -> IO () showMatched len stock = disp $ find len stock
main = do print $ calLen 303 22 35 32 3 rim <- selectRim print "************" hub <- selectHub print "************" print rim putStrLn $ hubs2S hub let ll = [len rim h | h <- hub] print "************" st <- getStock showResult ll [0,2,3,4] st
|