From d8c1579147f7ad8c97978db3c8a8af294b163441 Mon Sep 17 00:00:00 2001 From: kiana-S Date: Mon, 27 Dec 2021 18:08:04 -0500 Subject: [PATCH] Created basic graphical engine --- Graphics/Engine.hs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 Graphics/Engine.hs diff --git a/Graphics/Engine.hs b/Graphics/Engine.hs new file mode 100644 index 0000000..f284a9a --- /dev/null +++ b/Graphics/Engine.hs @@ -0,0 +1,17 @@ +module Graphics.Engine where + +import Control.Arrow +import Control.Monad.Representable.Reader +import FRP.Yampa +import GOL.Engine +import GOL.Space +import Graphics.GlossUtils (InputEvent) + +tickEvent :: SF a (Event ()) +tickEvent = repeatedly 1.0 () + +initialSpace :: Space f => f Bool +initialSpace = tabulate $ const False + +engine :: Space f => GOL f Bool -> SF a (GOL f Bool) +engine start = tickEvent >>> accumHoldBy (\s _ -> tick s) start \ No newline at end of file