Skip to content

Commit

Permalink
Nasty: Now black has the right board layout
Browse files Browse the repository at this point in the history
  • Loading branch information
tgass committed May 18, 2016
1 parent cc87a2c commit c33cede
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/Macbeth/Wx/Game/Board.hs
Expand Up @@ -42,17 +42,15 @@ setScale = do
drawBoard :: BoardT a
drawBoard = do
(dc, state) <- ask
let perspective' = perspective state
let bw = concat $ replicate 4 (concat $ replicate 4 seed ++ replicate 4 (reverse seed))
where seed = if perspective' == White then [Black, White] else [White, Black]
let bw = let seed = (concat $ replicate 4 [Black, White]) in seed ++ reverse seed ++ bw
let sq = [Square c r | c <- [A .. H], r <- [One .. Eight]]
lift $ set dc [ pen := penTransparent ]
lift $ withBrushStyle (BrushStyle BrushSolid (rgb (180::Int) 150 100)) $ \blackBrush ->
withBrushStyle (BrushStyle BrushSolid white) $ \whiteBrush ->
mapM_ (\(c,sq) -> do
dcSetBrush dc $ if c == White then whiteBrush else blackBrush
paintSquare dc state sq)
(zip (if perspective' == White then bw else reverse bw) sq)
(zip bw sq)


drawHighlightLastMove :: BoardT a
Expand Down

0 comments on commit c33cede

Please sign in to comment.