diff --git a/examples/sokoban/main.elk b/examples/sokoban/main.elk index 1601aa6d..98f4b2ac 100755 --- a/examples/sokoban/main.elk +++ b/examples/sokoban/main.elk @@ -23,13 +23,15 @@ fn rowToString(board, y) { let blockType = block | sokoban::block::getType if blockType == "wall" { - row += "#" + row += "#" | ansi::color brightBlack } else if blockType == "crate" { - row += if board | sokoban::blockIsOnStorage(block): "*" else "o" + let char = if board | sokoban::blockIsOnStorage(block): "*" else "o" + row += char | ansi::color blue } else if blockType == "player" { - row += if board | sokoban::blockIsOnStorage(block): "+" else "@" + let char = if board | sokoban::blockIsOnStorage(block): "+" else "@" + row += char | ansi::color red } else if blockType == "storage" { - row += "." + row += "." | ansi::color brightRed } }