-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMain.hs
77 lines (63 loc) · 1.57 KB
/
Main.hs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
--import Control.Concurrent
-- ( threadDelay
-- )
--import Data.Maybe
-- ( fromJust
-- )
--import Base.Openess
-- ( Openess(..)
-- )
--import Core.Body
-- ( Body(..)
-- , newBody
-- , setBodyVelocity
-- , stepBody
-- )
--import Util.Pretty
-- ( prettyAABB
-- )
------ =========
------ = Debug =
------ =========
----import Debug.Trace
---- ( traceShow
---- )
----traceShowThis x = traceShow x x
---- ===========
---- = Control =
---- ===========
---- recursive call with recursive state and the possibility of exit.
--repeatEither :: Monad m => (s -> m (Either e s)) -> (Either e s) -> m e
--repeatEither f = either return $ (repeatEither f =<<) . f
---- repeatEither with initial value.
--repeatEither1 :: Monad m => (s -> m (Either e s)) -> s -> m e
--repeatEither1 f = repeatEither f . return
---- ==========
---- = Engine =
---- ==========
--data EState = EState
-- { wall_ :: Body
-- , critter_ :: Body
-- } deriving (Ord,Eq,Show)
--stepEngine :: EState -> IO (Either () EState)
--stepEngine (EState wall critter) = do
-- putStrLn . prettyAABB . shape_ $ critter
-- putStrLn . prettyAABB . shape_ $ wall
-- putStrLn ""
-- threadDelay 50000
-- return . Right . EState wall $ stepBody critter
--initialState :: EState
--initialState = EState
-- { wall_ = fromJust $ newBody Open 9 (-1) 10 1
-- , critter_ = setBodyVelocity (1,0) (fromJust $ newBody Open (-1) (-1) 1 1)
-- }
--runEngine :: IO ()
--runEngine = repeatEither1 stepEngine initialState
---- ========
---- = Main =
---- ========
--main = runEngine
import Test.Test
( testAll
)
main = testAll