Code Monkey home page Code Monkey logo

kaboom's People

Contributors

misterperson avatar mumbleskates avatar philippeitis avatar pwmarcz avatar richardweinberger avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

kaboom's Issues

Suggestion: Visual feedback when guessed correctly

Sometimes I struggle because I don't know if my guess was a guess or not. I just want some visual feedback so I know it was a real guess and not just me getting lucky. I also try to avoid using the hint button, as that would spoil it for me and I can't get the feel right.

If this were to be implemented, it would be as an optional feature of course, not sure if everyone would want to get this feedback.

Isn't the solver algorithm too complicated?

Wouldn't it be easier to just generate a regular mine field (with all the usual tricks of course), where all mines have pre-determined positions and then implement your additional rules on top of that? For example, if the player clicks on an empty field but he can not know yet that it's empty he looses.

This should work since the set of all non-loosing moves in your game is always a subset of the set of all non-loosing moves in classic minesweeper.

With this you can abandon the SAT solver and all that complicated logic around it.

Correctness of algorithm

Given the game configuration below, isn't it possible for the mine in the top right (currently marked with the red !) to be one cell to the right?

Screenshot_20191226-215038

Autoreveal Tiles when Forced to Guess after Initial Move

If the first tile revealed is shown to only have unknowns around it by the solver, the game should begin expanding outward from this initial tile until a mine or safe square is revealed.

Currently, it's very easy to abuse the guess mechanic to create long diagonal chains at the start of a board, making it hard for the algorithm to present challenging board states, even on the hardest difficulty.

Can't click box

So there are 6 boxes left at the bottom.
I want to click the lower middle one.
My reasoning is, this should be safe.
When I click it, nothing happens.

image

Unclear behaviour in certain situations

Let's say I have this situation:

Screenshot 2021-05-21 at 22 09 17

Is it safe to guess the bottom question marks if I have the possibility of opening the top cell with a question mark or should I open the top one first because I know it's empty?

Suggestion: potential/hypothetical mine marker

When reasoning about long boundary regions, I sometimes wish I could, in addition to the flag for known mines, also place "?" markers for potential/hypothetical mines (e.g., by right-clicking twice/on a flag). These markers could (maybe should) disappear when the next field is chosen (i.e., new information becomes available).

Impossible state generated

image

Note the 1 in the lower right - it's surrounded by two mines, which is clearly invalid.

In this case, I had revealed those six, then marked all the mines, then clicked on the square which was revealed to be a 1. I'm not quite sure how this happened (I don't have any debug stuff enabled), but I don't think it should be able to...

Suggestion: "Am I allowed to guess?" hint

Hi, I really like this game, but I am sometimes uncertain whether I have really performed all possible inferences before making a guessing step. So sometimes, in particular when I'm playing late at night and I am half-way through a larger instance, I would like the game to confirm that I am indeed allowed to guess in the current state. Of course, I can temporarily enable debug mode, but this leaks more information than a simple "no" in case there are inferences still to be done. So a simple button "Am I allowed to guess?" with a "Yes / No" answer would be cool.

Add timer/summarize elapsed time at end of game

I don't want to make it too competitive, but I like trying to solve kaboom as fast as possible, and I think having a timer (or at least a "you solved the game in X seconds" at the end) would make it easier to figure out whether I was doing well or not.

Or is that difficult in browser games?

Suggestion: Improve the hint system

I haven't played Minesweeper in a while and I'm enjoying figuring out why certain squares are safe by switching in and out of debug mode.

Another way to achieve this would be if the hint system would show why there are safe squares. There are three cases: you missed something obvious (e.g. there's a 2 with only 2 possible squares unflagged), or you have to do some pattern recognition/deduction to figure out why this square next to a number is either safe or unsafe.

(The hints should probably show in that order.)

Secondarily, a good way to make Kaboom into a minesweeper tutorial mode would be to have an option to have the hint always show.

mine/safe squares instead of guessing field

If I am not wrong, the marked fields should be guessing fields instead of safe/mine fields. It is possible that the field right of the 4 is safe and the other two fields (currently marked as safe) could contain bombs.

kaboom

"Allow guessing anywhere" help text is somewhat inacurate

Currently the help text says:

By default, you are allowed to guess only on the boundary of revealed tiles.

There are some situations when revealing outside tiles seems allowed, regardless of ticking this checkbox:

  1. When an outside tile is guaranteed not to contain a mine, see issue #13 for examples.
  2. When all tiles on the boundary are guaranteed to contain a mine.

Example for the latter in a 3*2 game:

+-+-+-+
|2|x| |
+-+-+-+
|2|x| |
+-+-+-+

Here, all boundary tiles contain mines, so the game allows safely revealing either of the remaining tiles. Not sure how to rephrase the help text without getting too confusing. Maybe something like:

By default, you are allowed to guess only on the boundary of revealed tiles, unless forced otherwise.

Algorithm Correctness

I encountered the following while playing:
Screen Shot 2019-12-27 at 11 50 05 AM

There is a "4", (2nd row from the top, 4th column from the left) that has 5 surrounding mines!

Sometimes I get games that get "stuck". Example below

First, let me thank you for this game -- it keeps me on my toes!

image

It says that I flagged a square that could be empty. This isn't actually true. The last move was the 4 in roughly the middle of the row, 5 rows up. Now, I can't click anywhere, and the undo button doesn't work either.

However, there is interesting stuff in the console log:

minisat.js:27 Cannot enlarge memory arrays in asm.js. Either (1) compile with -s TOTAL_MEMORY=X with X higher than the current value 67108864, or (2) set Module.TOTAL_MEMORY before the program runs.
minisat.js:28 Cannot enlarge memory arrays in asm.js. Either (1) compile with -s TOTAL_MEMORY=X with X higher than the current value 67108864, or (2) set Module.TOTAL_MEMORY before the program runs.
minisat.js:25 Uncaught abort() at Error
    at Ma (https://pwmarcz.pl/kaboom/lib/minisat.js:41:363)
    at E (https://pwmarcz.pl/kaboom/lib/minisat.js:170:155)
    at Function.qa [as tb] (https://pwmarcz.pl/kaboom/lib/minisat.js:31:236)
    at Cc (https://pwmarcz.pl/kaboom/lib/minisat.js:123:421)
    at cF (https://pwmarcz.pl/kaboom/lib/minisat.js:151:117846)
    at cH (https://pwmarcz.pl/kaboom/lib/minisat.js:151:130595)
    at b5 (https://pwmarcz.pl/kaboom/lib/minisat.js:151:62962)
    at cq (https://pwmarcz.pl/kaboom/lib/minisat.js:151:100408)
    at ch (https://pwmarcz.pl/kaboom/lib/minisat.js:151:86577)
    at by (https://pwmarcz.pl/kaboom/lib/minisat.js:151:11303)
minisat.js:27 Cannot enlarge memory arrays in asm.js. Either (1) compile with -s TOTAL_MEMORY=X with X higher than the current value 67108864, or (2) set Module.TOTAL_MEMORY before the program runs.
minisat.js:28 Cannot enlarge memory arrays in asm.js. Either (1) compile with -s TOTAL_MEMORY=X with X higher than the current value 67108864, or (2) set Module.TOTAL_MEMORY before the program runs.
minisat.js:25 Uncaught abort() at Error
    at Ma (https://pwmarcz.pl/kaboom/lib/minisat.js:41:363)
    at E (https://pwmarcz.pl/kaboom/lib/minisat.js:170:155)
    at Function.qa [as tb] (https://pwmarcz.pl/kaboom/lib/minisat.js:31:236)
    at Cc (https://pwmarcz.pl/kaboom/lib/minisat.js:123:421)
    at cF (https://pwmarcz.pl/kaboom/lib/minisat.js:151:117846)
    at cH (https://pwmarcz.pl/kaboom/lib/minisat.js:151:130595)
    at b5 (https://pwmarcz.pl/kaboom/lib/minisat.js:151:62962)
    at by (https://pwmarcz.pl/kaboom/lib/minisat.js:151:3689)
    at wa (https://pwmarcz.pl/kaboom/lib/minisat.js:33:237)
    at https://pwmarcz.pl/kaboom/lib/minisat.js:33:367
minisat.js:27 Cannot enlarge memory arrays in asm.js. Either (1) compile with -s TOTAL_MEMORY=X with X higher than the current value 67108864, or (2) set Module.TOTAL_MEMORY before the program runs.
minisat.js:28 Cannot enlarge memory arrays in asm.js. Either (1) compile with -s TOTAL_MEMORY=X with X higher than the current value 67108864, or (2) set Module.TOTAL_MEMORY before the program runs.
minisat.js:25 Uncaught abort() at Error
    at Ma (https://pwmarcz.pl/kaboom/lib/minisat.js:41:363)
    at E (https://pwmarcz.pl/kaboom/lib/minisat.js:170:155)
    at Function.qa [as tb] (https://pwmarcz.pl/kaboom/lib/minisat.js:31:236)
    at Cc (https://pwmarcz.pl/kaboom/lib/minisat.js:123:421)
    at cF (https://pwmarcz.pl/kaboom/lib/minisat.js:151:117846)
    at cH (https://pwmarcz.pl/kaboom/lib/minisat.js:151:130595)
    at b5 (https://pwmarcz.pl/kaboom/lib/minisat.js:151:62962)
    at by (https://pwmarcz.pl/kaboom/lib/minisat.js:151:3689)
    at wa (https://pwmarcz.pl/kaboom/lib/minisat.js:33:237)
    at https://pwmarcz.pl/kaboom/lib/minisat.js:33:367
minisat.js:27 Cannot enlarge memory arrays in asm.js. Either (1) compile with -s TOTAL_MEMORY=X with X higher than the current value 67108864, or (2) set Module.TOTAL_MEMORY before the program runs.
minisat.js:28 Cannot enlarge memory arrays in asm.js. Either (1) compile with -s TOTAL_MEMORY=X with X higher than the current value 67108864, or (2) set Module.TOTAL_MEMORY before the program runs.
minisat.js:25 Uncaught abort() at Error
    at Ma (https://pwmarcz.pl/kaboom/lib/minisat.js:41:363)
    at E (https://pwmarcz.pl/kaboom/lib/minisat.js:170:155)
    at Function.qa [as tb] (https://pwmarcz.pl/kaboom/lib/minisat.js:31:236)
    at Cc (https://pwmarcz.pl/kaboom/lib/minisat.js:123:421)
    at cF (https://pwmarcz.pl/kaboom/lib/minisat.js:151:117846)
    at cH (https://pwmarcz.pl/kaboom/lib/minisat.js:151:130595)
    at b5 (https://pwmarcz.pl/kaboom/lib/minisat.js:151:62962)
    at by (https://pwmarcz.pl/kaboom/lib/minisat.js:151:3689)
    at wa (https://pwmarcz.pl/kaboom/lib/minisat.js:33:237)
    at https://pwmarcz.pl/kaboom/lib/minisat.js:33:367
DevTools failed to load source map: Could not load content for https://pwmarcz.pl/kaboom/lib/bootstrap.min.css.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE

Suggestion: Allow guessing if a square only ever can be revealed by guessing in the future

Think of the following scenario:

minesweeper

I set up a board for which there are two uncertain squares left, and one certainly safe square. In this scenario, continuing with the safe square and finishing the rest of the board before continuing in the bottom left can never change the fact that I need to guess which of the two bottom squares is a mine.

As it is now, I need to wait until there are no certainly safe squares left in completely independent parts of the board, before continuing with a part of the board that's actually already solved.

Without spending a lot of thought on how to compute / implement this, and on the consequences of such a feature, I'd suggest to allow guesses on uncertain fields that are independent of still unrevealed certainly safe squares.

Option to only generate puzzles solvable without guessing

One thing I really like about the Simon Tatham version is that you never have to guess. I think that would make a great addition to your rule changes, because it would mean you always die if you mistakenly open a square that isn't safe. On the ST version, since you're still allowed to guess, there's still a luck element, but this would close that loophole. On the other hand, it would also mean you don't spend an endless amount of time trying to figure out if you have to guess (in your version), because you're guaranteed that you don't.

Incidentally, I think this change would possibly speed up the game on low power devices (it's quite slow on my phone at present). When this setting is enabled, you can generate a single static puzzle at the beginning of the game: the only time you need to regenerate the puzzle is when the user guesses, and then you generate a puzzle that instantly kills them. (Of course, I'm assuming most of the power use is in generating puzzles, not in backtracking to find safe squares when the user opens a new square. That might not be true.)

Suggestion: Questionmark

Hi,

I really like your minesweeper version. I only miss an option to mark fields with a question mark, when I'm calculating safe fields.

Thanks for this little but wonderful game.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.