From 3cd62194b9871c8a6462a18e4e4778cd8d2435f3 Mon Sep 17 00:00:00 2001 From: Eric Mertens Date: Fri, 2 Dec 2022 15:46:42 -0800 Subject: [PATCH] 9 --- app/Main.hs | 94 ++++++++++++++++++++++++++---------------------- app/Rendering.hs | 14 ++++---- 2 files changed, 59 insertions(+), 49 deletions(-) diff --git a/app/Main.hs b/app/Main.hs index 4bad497..e610cba 100644 --- a/app/Main.hs +++ b/app/Main.hs @@ -17,26 +17,30 @@ world0 = World { boxColor = withForeColor defAttr green, boxLocation = Location '1' (-1) 0, boxType = Original $ makeWalls [ - "▓▓ ▓▓", - "▓ ▓", - "▓ ▓", - "▓ ▓", - "▓ ▓ ▓", - "▓ ▓", - "▓ ▓▓▓ ▓" + "▓▓ ▓▓", + "▓ ▓", + "▓ ▓", + "▓ ▓", + " ▓", + "▓ ▓ ▓", + "▓ ▓", + "▓ ▓", + "▓ ▓▓▓▓▓ ▓" ] }), ('2', Box { boxColor = withForeColor defAttr cyan, boxLocation = Location '1' 1 1, boxType = Original $ makeWalls [ - "▓ ▓ ▓ ▓", - " ", - "▓ ▓", - " ", - "▓ ▓", - " ", - "▓ ▓ ▓ ▓" + "▓ ▓▓ ▓▓ ▓", + " ", + "▓ ▓", + "▓ ▓", + " ", + "▓ ▓", + "▓ ▓", + " ", + "▓ ▓▓ ▓▓ ▓" ] }), ('₂', Box { @@ -48,70 +52,76 @@ world0 = World { boxColor = withForeColor defAttr blue, boxLocation = Location '2' 1 1, boxType = Original $ makeWalls [ - "▓▓▓▓▓▓▓", - "▓ ▓▓▓", - "▓ ▓▓▓", - "▓▓▓ ▓▓▓", - "▓ ▓▓▓", - "▓ ▓▓▓", - "▓▓▓ ▓▓▓" + "▓▓▓▓▓▓▓▓▓", + "▓▓▓▓▓▓▓▓▓", + "▓▓▓▓▓▓▓▓▓", + "▓▓ ▓▓▓▓", + "▓▓ ▓▓▓▓", + "▓▓▓▓ ▓▓▓▓", + "▓▓ ▓▓▓▓", + "▓▓ ▓▓▓▓", + "▓▓▓▓ ▓▓▓▓" ] }), ('4', Box { boxColor = withForeColor defAttr black, - boxLocation = Location '3' (-3) 0, + boxLocation = Location 'b' (-3) 0, boxType = Original $ makeWalls [ - "▓▓ ▓▓", - "▓ ▓ ▓", - "▓ ▓", - "▓ ▓", - "▓ ▓", - "▓ ▓", - "▓▓▓ ▓▓▓" + "▓▓▓ ▓▓▓", + "▓ ▓ ▓", + "▓ ▓", + "▓ ▓", + "▓ ▓", + "▓ ▓", + "▓ ▓", + "▓ ▓", + "▓▓▓▓ ▓▓▓▓" ] }), ('b', Box { boxColor = withForeColor defAttr red, boxLocation = Location '1' 0 1, boxType = Original $ makeWalls [ - "▓▓▓▓▓▓▓", - "▓ ▓", - "▓ ▓", - " ", - "▓ ▓▓", - "▓ ▓", - "▓▓▓▓▓▓▓" + "▓▓▓▓▓▓▓▓▓", + "▓ ▓", + "▓ ▓", + "▓ ▓", + " ", + "▓ ▓▓", + "▓ ▓", + "▓ ▓", + "▓▓▓▓▓▓▓▓▓" ] }), ('x', Box { boxColor = withForeColor defAttr yellow, boxLocation = Location '1' 0 (-1), - boxType = Original $ solid 7 + boxType = Original $ solid 9 }), ('y', Box { boxColor = withForeColor defAttr magenta, boxLocation = Location '1' 0 (-2), - boxType = Original $ solid 7 + boxType = Original $ solid 9 }), ('i', Box { boxColor = withForeColor defAttr black, boxLocation = Location 'b' 0 (-2), - boxType = Original $ solid 7 + boxType = Original $ solid 9 }), ('j', Box { boxColor = withForeColor defAttr black, boxLocation = Location 'b' 0 (-1), - boxType = Original $ solid 7 + boxType = Original $ solid 9 }), ('k', Box { boxColor = withForeColor defAttr black, boxLocation = Location 'b' 0 0, - boxType = Original $ solid 7 + boxType = Original $ solid 9 }), ('l', Box { boxColor = withForeColor defAttr black, boxLocation = Location 'b' 0 1, - boxType = Original $ solid 7 + boxType = Original $ solid 9 }), ('₁', Box { boxColor = withForeColor defAttr green, diff --git a/app/Rendering.hs b/app/Rendering.hs index 73b7b4b..629d883 100644 --- a/app/Rendering.hs +++ b/app/Rendering.hs @@ -48,18 +48,18 @@ renderBox world locMap box name scale = drawNestedWorld :: World -> Image drawNestedWorld world = - -- (3*49) + 49 + (3*49) - cropTop (49 + 2*border) $ - cropLeft (2*(49 + 2*border)) $ - cropBottom (2*49 + border) $ - cropRight (2*(2*49 + border)) $ + -- (3*81) + 81 + (3*81) + cropTop (81 + 2*border) $ + cropLeft (2*(81 + 2*border)) $ + cropBottom (2*81 + border) $ + cropRight (2*(2*81 + border)) $ vertCat [ horizCat [ case stackedLoc world (Location name1 y_ x_) of - Nothing -> unit (withForeColor defAttr black) 49 '?' + Nothing -> unit (withForeColor defAttr black) 81 '?' Just (Location n y x) -> let box = worldBoxes world Map.! n in - renderCell world locMap n box y x 49 + renderCell world locMap n box y x 81 | x_ <- [x1-1 .. x1+1] ] | y_ <- [y1-1 .. y1+1]