Skip to content

Commit

Permalink
Restyled by fourmolu (#1808)
Browse files Browse the repository at this point in the history
Co-authored-by: Restyled.io <[email protected]>
  • Loading branch information
restyled-io[bot] and restyled-commits authored Apr 28, 2024
1 parent 2ca2050 commit 1bb4845
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions src/swarm-engine/Swarm/Game/Step/Const.hs
Original file line number Diff line number Diff line change
Expand Up @@ -830,32 +830,33 @@ execConst runChildProg c vs s k = do
_ -> badConst
Appear -> case vs of
[VText app, VInj hasAttr (VText attr)] -> do

-- Set the robot's display character(s)
case into @String app of
[dc] -> do
robotDisplay . defaultChar .= dc
robotDisplay . orientationMap .= M.empty
[dc, nc, ec, sc, wc] -> do
robotDisplay . defaultChar .= dc
robotDisplay . orientationMap .= M.fromList
[ (DNorth, nc)
, (DEast, ec)
, (DSouth, sc)
, (DWest, wc)
robotDisplay . orientationMap
.= M.fromList
[ (DNorth, nc)
, (DEast, ec)
, (DSouth, sc)
, (DWest, wc)
]
_other ->
raise
Appear
[ quote app
, "is not a valid appearance string."
, "'appear' must be given a string with exactly 1 or 5 characters."
]
_other -> raise Appear
[ quote app
, "is not a valid appearance string."
, "'appear' must be given a string with exactly 1 or 5 characters."
]

-- Possibly set the display attribute
when hasAttr $ robotDisplay . displayAttr .= readAttribute attr

flagRedraw
return $ mkReturn ()

_ -> badConst
Create -> case vs of
[VText name] -> do
Expand Down

0 comments on commit 1bb4845

Please sign in to comment.