chiark / gitweb /
Tents: mark squares as non-tents with {Shift,Control}-cursor keys.
[sgt-puzzles.git] / pearl.c
diff --git a/pearl.c b/pearl.c
index 43afcd6cfb7aea415ac22e59d2bf074938ec5806..20ba3d44a6bbfaec99aa132bc938147e5eb0bb38 100644 (file)
--- a/pearl.c
+++ b/pearl.c
@@ -1737,7 +1737,7 @@ static char *game_text_format(const game_state *state)
     for (r = 0; r < h; ++r) {
        for (c = 0; c < w; ++c) {
            int i = r*w + c, cell = r*ch*gw + c*cw;
-           board[cell] = state->shared->clues[i]["+BW"];
+           board[cell] = "+BW"[(unsigned char)state->shared->clues[i]];
            if (c < w - 1 && (state->lines[i] & R || state->lines[i+1] & L))
                memset(board + cell + 1, '-', cw - 1);
            if (r < h - 1 && (state->lines[i] & D || state->lines[i+w] & U))
@@ -2058,6 +2058,11 @@ static char *interpret_move(const game_state *state, game_ui *ui,
        }
     }
 
+    if (button == 27 || button == '\b') {
+        ui->ndragcoords = -1;
+        return "";
+    }
+
     if (release) {
         if (ui->ndragcoords > 0) {
             /* End of a drag: process the cached line data. */