This commit is contained in:
Eric Mertens 2022-12-02 15:46:42 -08:00
parent 523d951a67
commit 3cd62194b9
2 changed files with 59 additions and 49 deletions

View File

@ -21,22 +21,26 @@ world0 = World {
"▓ ▓", "▓ ▓",
"▓ ▓", "▓ ▓",
"▓ ▓", "▓ ▓",
"",
"▓ ▓ ▓", "▓ ▓ ▓",
"▓ ▓", "▓ ▓",
"▓ ▓▓▓ ▓" "▓ ▓",
"▓ ▓▓▓▓▓ ▓"
] ]
}), }),
('2', Box { ('2', Box {
boxColor = withForeColor defAttr cyan, boxColor = withForeColor defAttr cyan,
boxLocation = Location '1' 1 1, boxLocation = Location '1' 1 1,
boxType = Original $ makeWalls [ boxType = Original $ makeWalls [
"▓ ▓ ▓ ▓", "▓ ▓ ▓ ▓",
" ", " ",
"▓ ▓", "▓ ▓",
"▓ ▓",
" ", " ",
"▓ ▓", "▓ ▓",
"▓ ▓",
" ", " ",
"▓ ▓ ▓ ▓" "▓ ▓ ▓ ▓"
] ]
}), }),
('₂', Box { ('₂', Box {
@ -48,70 +52,76 @@ world0 = World {
boxColor = withForeColor defAttr blue, boxColor = withForeColor defAttr blue,
boxLocation = Location '2' 1 1, boxLocation = Location '2' 1 1,
boxType = Original $ makeWalls [ boxType = Original $ makeWalls [
"▓▓▓▓▓▓▓", "▓▓▓▓▓▓▓▓▓",
"▓ ▓▓▓", "▓▓▓▓▓▓▓▓▓",
"▓ ▓▓▓", "▓▓▓▓▓▓▓▓▓",
"▓▓▓ ▓▓▓", "▓▓ ▓▓▓▓",
"▓ ▓▓▓", "▓▓ ▓▓▓▓",
"▓ ▓▓▓", "▓▓▓▓ ▓▓▓▓",
"▓▓▓ ▓▓▓" "▓▓ ▓▓▓▓",
"▓▓ ▓▓▓▓",
"▓▓▓▓ ▓▓▓▓"
] ]
}), }),
('4', Box { ('4', Box {
boxColor = withForeColor defAttr black, boxColor = withForeColor defAttr black,
boxLocation = Location '3' (-3) 0, boxLocation = Location 'b' (-3) 0,
boxType = Original $ makeWalls [ boxType = Original $ makeWalls [
"▓▓ ▓▓", "▓▓ ▓▓",
"▓ ▓ ▓", "▓ ▓ ▓",
"▓ ▓", "▓ ▓",
"▓ ▓", "▓ ▓",
"▓ ▓", "▓ ▓",
"▓ ▓", "▓ ▓",
"▓▓▓ ▓▓▓" "▓ ▓",
"▓ ▓",
"▓▓▓▓ ▓▓▓▓"
] ]
}), }),
('b', Box { ('b', Box {
boxColor = withForeColor defAttr red, boxColor = withForeColor defAttr red,
boxLocation = Location '1' 0 1, boxLocation = Location '1' 0 1,
boxType = Original $ makeWalls [ boxType = Original $ makeWalls [
"▓▓▓▓▓▓▓", "▓▓▓▓▓▓▓▓▓",
"▓ ▓",
"▓ ▓", "▓ ▓",
"▓ ▓", "▓ ▓",
" ", " ",
"▓ ▓▓", "▓ ▓▓",
"▓ ▓", "▓ ▓",
"▓▓▓▓▓▓▓" "▓ ▓",
"▓▓▓▓▓▓▓▓▓"
] ]
}), }),
('x', Box { ('x', Box {
boxColor = withForeColor defAttr yellow, boxColor = withForeColor defAttr yellow,
boxLocation = Location '1' 0 (-1), boxLocation = Location '1' 0 (-1),
boxType = Original $ solid 7 boxType = Original $ solid 9
}), }),
('y', Box { ('y', Box {
boxColor = withForeColor defAttr magenta, boxColor = withForeColor defAttr magenta,
boxLocation = Location '1' 0 (-2), boxLocation = Location '1' 0 (-2),
boxType = Original $ solid 7 boxType = Original $ solid 9
}), }),
('i', Box { ('i', Box {
boxColor = withForeColor defAttr black, boxColor = withForeColor defAttr black,
boxLocation = Location 'b' 0 (-2), boxLocation = Location 'b' 0 (-2),
boxType = Original $ solid 7 boxType = Original $ solid 9
}), }),
('j', Box { ('j', Box {
boxColor = withForeColor defAttr black, boxColor = withForeColor defAttr black,
boxLocation = Location 'b' 0 (-1), boxLocation = Location 'b' 0 (-1),
boxType = Original $ solid 7 boxType = Original $ solid 9
}), }),
('k', Box { ('k', Box {
boxColor = withForeColor defAttr black, boxColor = withForeColor defAttr black,
boxLocation = Location 'b' 0 0, boxLocation = Location 'b' 0 0,
boxType = Original $ solid 7 boxType = Original $ solid 9
}), }),
('l', Box { ('l', Box {
boxColor = withForeColor defAttr black, boxColor = withForeColor defAttr black,
boxLocation = Location 'b' 0 1, boxLocation = Location 'b' 0 1,
boxType = Original $ solid 7 boxType = Original $ solid 9
}), }),
('₁', Box { ('₁', Box {
boxColor = withForeColor defAttr green, boxColor = withForeColor defAttr green,

View File

@ -48,18 +48,18 @@ renderBox world locMap box name scale =
drawNestedWorld :: World -> Image drawNestedWorld :: World -> Image
drawNestedWorld world = drawNestedWorld world =
-- (3*49) + 49 + (3*49) -- (3*81) + 81 + (3*81)
cropTop (49 + 2*border) $ cropTop (81 + 2*border) $
cropLeft (2*(49 + 2*border)) $ cropLeft (2*(81 + 2*border)) $
cropBottom (2*49 + border) $ cropBottom (2*81 + border) $
cropRight (2*(2*49 + border)) $ cropRight (2*(2*81 + border)) $
vertCat [ vertCat [
horizCat [ horizCat [
case stackedLoc world (Location name1 y_ x_) of 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) -> Just (Location n y x) ->
let box = worldBoxes world Map.! n in 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] | x_ <- [x1-1 .. x1+1]
] ]
| y_ <- [y1-1 .. y1+1] | y_ <- [y1-1 .. y1+1]