Minesweeper-like logic puzzle program

Anything to do with minesweeper...
Post Reply
qqwref
Posts: 121
Joined: Thu Sep 23, 2010 4:17 pm

Minesweeper-like logic puzzle program

Post by qqwref » Mon Oct 15, 2012 12:18 am

This is currently a work in progress, but I thought certain people (aradesh?) would like to see what I've got so far.

http://mzrg.com/js/mosaik/

This lets you play and edit the puzzle that janko.at refers to as "Mosaik". It's also going to support the janko.at "Minesweeper" puzzle type too; the main difference is that in Mosaik squares with clues are allowed to contain mines, whereas in Minesweeper they must be blank.

There are two modes, "Edit" and "Play". If you are solving a puzzle, you can just use the mouse. If you are editing a puzzle, you can use the mouse to try it out, and also use ctrl+mouse to change the clues themselves. Save turns the puzzle into a text version and puts it in the textbox, and Load loads a puzzle from the textbox.

So, we can share our own puzzles :) The Mosaik and Minesweeper puzzles will have slightly different formats so there's no need to specify which one a specific puzzle is. Here is a puzzle I made earlier today:
10x10_C4C12A123C3D3B52B2B2C3313A2B4G43A43A21D4C22B234B4A2D3B32C21A0C1

Enjoy and please post some puzzles of your own!
NF player. Best scores 1-10-39.

aradesh
Posts: 90
Joined: Sat Aug 29, 2009 3:37 pm

Re: Minesweeper-like logic puzzle program

Post by aradesh » Mon Oct 15, 2012 10:16 am

I'm guessing it doesn't quite work yet?
qq_mosaik.png
qq_mosaik.png (10.55 KiB) Viewed 3897 times
It would be nice to have a mine/safe symbol for minesweeper mode. Also it would be nice if we could place mines at the start of the game (i.e. in edit mode). Also keyboard entry of numbers would be nice, say if we ctrl-click a square then hit a number, it becomes that one. Also a quick way of removing a number without iterating through them all.

ps: I solved your mosaik puzzle. Took me a while as I'm not used to this sort of puzzle.

qqwref
Posts: 121
Joined: Thu Sep 23, 2010 4:17 pm

Re: Minesweeper-like logic puzzle program

Post by qqwref » Mon Oct 15, 2012 9:58 pm

aradesh wrote:I'm guessing it doesn't quite work yet?
I don't see anything wrong there. Keep in mind the "Minesweeper mode" checkbox doesn't do anything yet, it's only Mosaik mode so far.
aradesh wrote:It would be nice to have a mine/safe symbol for minesweeper mode.
Yeah, but I don't wanna have to make separate images for both modes :-/ Well, maybe I will.
aradesh wrote:Also it would be nice if we could place mines at the start of the game (i.e. in edit mode). Also keyboard entry of numbers would be nice, say if we ctrl-click a square then hit a number, it becomes that one. Also a quick way of removing a number without iterating through them all.
Now you are getting into issues of how to do stuff like that and keep a reasonable interface :p
NF player. Best scores 1-10-39.

qqwref
Posts: 121
Joined: Thu Sep 23, 2010 4:17 pm

Re: Minesweeper-like logic puzzle program

Post by qqwref » Tue Nov 06, 2012 3:33 am

Updated, if anyone cares. I changed some stuff, including
- Minesweeper mode works properly now, including saving and loading puzzles
- Keeps track of the number of mines (this can also be left undefined), and if you have the wrong number the solution is wrong
- Editing controls only show up in edit mode
- Can "paint" clues by selecting the number/blank and then placing it with left clicks

I also wrote a program to convert (most of) the janko.at puzzles, if anyone wants them.
NF player. Best scores 1-10-39.

aradesh
Posts: 90
Joined: Sat Aug 29, 2009 3:37 pm

Re: Minesweeper-like logic puzzle program

Post by aradesh » Tue Nov 06, 2012 12:06 pm

Nice, it's much more user-friendly for minesweeper now. And the buttons at the bottom speed things up somewhat.

It's still a shame however that it's not possible to have the concept of "safe square" without giving a hint of number, or placing a mine as part of the puzzle. Most patterns that I would wish to convey to someone e.g. over IRC chat would involve there already being known mines, other patterns might involve certain squares being safe, but me not caring what the number is.

qqwref
Posts: 121
Joined: Thu Sep 23, 2010 4:17 pm

Re: Minesweeper-like logic puzzle program

Post by qqwref » Tue Nov 06, 2012 7:21 pm

Mm. The problem there is that I would need to be able to distinguish between squares that are marked safe/mines but are *fixed clues*, and squares that the player marked safe/mines. Any ideas? Perhaps a white/black square with "F" or "?" or a dot in it?
NF player. Best scores 1-10-39.

aradesh
Posts: 90
Joined: Sat Aug 29, 2009 3:37 pm

Re: Minesweeper-like logic puzzle program

Post by aradesh » Wed Nov 07, 2012 10:31 am

I think for the user it's unimportant. That is providing a square starts off as black or white, then they have all the info they need. Just need a way to encode it in the save-data.

qqwref
Posts: 121
Joined: Thu Sep 23, 2010 4:17 pm

Re: Minesweeper-like logic puzzle program

Post by qqwref » Thu Nov 08, 2012 1:31 am

Encoding it in the save data won't be hard, but I do want to think of an intuitive way to do it. Remember that you also want to be able to mark white and black squares in the editor so you can playtest your logic. So we either need distinguishable symbols, or you have to manually clear out all the non-clue white and black squares before you save your puzzle.

Well, for now I think I'll just put an X for fixed squares. No update now but I will do it soon.
NF player. Best scores 1-10-39.

qqwref
Posts: 121
Joined: Thu Sep 23, 2010 4:17 pm

Re: Minesweeper-like logic puzzle program

Post by qqwref » Sat Nov 10, 2012 6:35 am

Okay, updated... let me know if anything breaks.

Here is a test puzzle from janko.at to play with:

Code: Select all

13m13!41_wwwwwwwCwwwwwwwwC1AwwwwwC4A2A4AwwwA2A1A3A3BwwA3A1A2C3BwwA4C6A4A2AwwB3E1BwwA2A4A5C4BwB1C2A1A3AwwB2A3A1A2AwwwA3A1A4CwwwwwA4AwBwwwwwwwCwwwwwww
NF player. Best scores 1-10-39.

Post Reply