I find the implementation of dragging really annoying compared to similar engines. What I'm used to is:
* click and drag will only operate in a single line, either horizontally or vertically
* click and drag will only perform the same operation (considering both original type and new type). In particular, if I've already filled in every other cell as water, dragging in "ship" mode should only fill in the empty cells, not overwrite the water.
* there should be "undo" support, both Ctrl-Z and U as well as a button
Another feature usually not found in similar engines, but really useful in order to regain some of the experience from solving them on paper:
* have a nearby text box for keeping notes; clear it when a new puzzle is started
> I think NP-Completeness is the norm rather than the exception.
I don't think that's possible. Being NP-complete means a problem is as hard as any NP problem, and no harder. But there's not an upper limit to how difficult a problem can be.
Note that the problem of determining whether two different regular expressions match the same set of strings is much harder than any NP-complete problem.
Thank you for making it mobile-friendly. I almost made my own Android version of this just because the usual site I played it on wasn't usable and the best I could find in the Play store was mostly there to sell you $1.99 packs of 50 puzzles as if there was any actual effort put into generating them (seriously, they acted like 1 free puzzle per week was generosity).
Although can we get a setting to switch left and right click's default actions? I prefer puzzle games like this to use "click where there is something, right click to mark where there isn't something".
Having two mouse buttons available for two actions would make sense, except that right-clicking on the puzzle brings up a context menu. So regardless of the swapmouse setting, only the left click is a real possibility.
It was the exact same puzzle that's in the OP. With the scale of available puzzles they had for sale, I'm fairly confident it was automated (they also weren't noticably different from the generated puzzles I played before).
Given the rules, it would be a better experience if squares only have two states: ship block or empty. There is no point to letting the user draw water. The feature probably exists with the intent of letting users mark squares that can't possibly be ships, but why wouldn't the game do that step by itself based on the blocks placed? That would make the game a lot less tedious.
This doesn't work for me on Firefox Mobile on Android at 10x10 or above. It's as if the touch targets get too small to select: I can click on the numbers to turn them red, but I can't seem to select any square.
Works well on smaller sizes and on Chrome on the same device.
Thanks, weird one - I just put in a fix, you can refresh the page to get it. Some kind of CSS glitch where the cells (<i> elements) got a height of 0 at narrow screen sizes, in Firefox only, despite those and their parent <td>s having an explicit height. Just added an absolute positioning hack to fix it.
Bimaru is a fun puzzle. I remember putting an Android App in the store containing the phrase "Battleships", only to receive a copyright claim from Hasbro, and Google immediately took the App down from the Store.
I think "doesn't engage the language center of my brain" is more accurate (and less pejorative) than "mindless". It certainly engages spatial reasoning and some logic.
Nice! In line with other apps like this (e.g. LinkedIn's queens), I think the grid should be marked complete once you have all the boats, without needing to mark all the water.
I've spent quite a few hours on this thing when I've needed something non-linguistic for my brain to engage in. If it was World of Warcraft, I'd probably be a level 30 rogue.
Author here - check that the revealed ships in your puzzle are keeping their particular shape. E.g. a revealed-at-start "D" shape ship-end can't be the middle of a ship, or an "O" submarine, or face a different way that it's initially facing. 99.9% of the time people report this, it's a confusion about that aspect (if you can think of a way I can make it clearer definitely let me know!).
The simplest way would be to also pre-fill forced empty spaces. It 'solves' part of the puzzle for the player, but hopefully that wasn't a key part of the fun. You go as far as to explain all of those bits at the bottom anyway.
This kind of thing is done to great effect in "Good Sudoku", which gives players a lot of automated tools for the simplest things, as to lead players to handling the more fun, more complicated parts of the hard puzzles.
I think the easiest way to make it clearer is to highlight it in red as a mistake if done incorrectly, as you do with the counts on the row ends. If you try to place a ship token close to another one then you should also highlight it in red.
I find the implementation of dragging really annoying compared to similar engines. What I'm used to is:
* click and drag will only operate in a single line, either horizontally or vertically
* click and drag will only perform the same operation (considering both original type and new type). In particular, if I've already filled in every other cell as water, dragging in "ship" mode should only fill in the empty cells, not overwrite the water.
* there should be "undo" support, both Ctrl-Z and U as well as a button
Another feature usually not found in similar engines, but really useful in order to regain some of the experience from solving them on paper:
* have a nearby text box for keeping notes; clear it when a new puzzle is started
Interesting tidbit, the Battleships puzzle is NP-complete (http://www.mountainvistasoft.com/docs/BattleshipsAsDecidabil...) - there's no known solver algorithm that can do it in polynomial time, as the size of the puzzles / boards expand.
I think NP-Completness is the norm rather than the exception. Wikipedia has a list of NP-Complete problems [0].
[0] https://en.wikipedia.org/wiki/List_of_NP-complete_problems#G...
> I think NP-Completeness is the norm rather than the exception.
I don't think that's possible. Being NP-complete means a problem is as hard as any NP problem, and no harder. But there's not an upper limit to how difficult a problem can be.
Note that the problem of determining whether two different regular expressions match the same set of strings is much harder than any NP-complete problem.
Love it!
If you like this sort of thing, be sure to check out Simon Tatham (creator of PuTTY)’s Puzzles: https://www.chiark.greenend.org.uk/~sgtatham/puzzles/
The Android and iPhone ports are also excellent and free from ads/garbage.
Also, https://puzz.link/db/
You'll have to find the puzzles' rules by yourself tho.
Thank you for making it mobile-friendly. I almost made my own Android version of this just because the usual site I played it on wasn't usable and the best I could find in the Play store was mostly there to sell you $1.99 packs of 50 puzzles as if there was any actual effort put into generating them (seriously, they acted like 1 free puzzle per week was generosity).
Although can we get a setting to switch left and right click's default actions? I prefer puzzle games like this to use "click where there is something, right click to mark where there isn't something".
Sure thing - just added a quick button swap URL parameter:
https://lukerissacher.com/battleships?swapmouse=1
If it's a common request I should probably make it a saved setting.
Having two mouse buttons available for two actions would make sense, except that right-clicking on the puzzle brings up a context menu. So regardless of the swapmouse setting, only the left click is a real possibility.
Depending on the puzzle there is “actual effort”, a lot of these puzzles are not generated.
If you’re experienced with solving you can also generally distinguish generated from constructed puzzles.
[Edit: Are you looking specifically for battleship puzzles? or just variant sudoku?]
It was the exact same puzzle that's in the OP. With the scale of available puzzles they had for sale, I'm fairly confident it was automated (they also weren't noticably different from the generated puzzles I played before).
Given the rules, it would be a better experience if squares only have two states: ship block or empty. There is no point to letting the user draw water. The feature probably exists with the intent of letting users mark squares that can't possibly be ships, but why wouldn't the game do that step by itself based on the blocks placed? That would make the game a lot less tedious.
This doesn't work for me on Firefox Mobile on Android at 10x10 or above. It's as if the touch targets get too small to select: I can click on the numbers to turn them red, but I can't seem to select any square.
Works well on smaller sizes and on Chrome on the same device.
Thanks, weird one - I just put in a fix, you can refresh the page to get it. Some kind of CSS glitch where the cells (<i> elements) got a height of 0 at narrow screen sizes, in Firefox only, despite those and their parent <td>s having an explicit height. Just added an absolute positioning hack to fix it.
Bimaru is a fun puzzle. I remember putting an Android App in the store containing the phrase "Battleships", only to receive a copyright claim from Hasbro, and Google immediately took the App down from the Store.
I rewrote it as a web version, should be still available: https://www.kleemans.ch/static/bimaru-web/
Ooh, this is a fun variant of nonograms! If you like this puzzle, I think you'd enjoy those too: https://en.wikipedia.org/wiki/Nonogram
Battleships is a pretty common puzzle on the World Puzzle Championship tests. If this is new to you, you may enjoy Nikoli's broader range of puzzle sets listed on wikipedia https://en.wikipedia.org/wiki/Nikoli_(publisher)#Nikoli_puzz...
A number of them are implemented via SGT puzzles https://www.chiark.greenend.org.uk/~sgtatham/puzzles/
It took me some time to unlearn the Nonogram rules of assuming the numbers on the side indicate continuous ships. After that, it was great fun!
I think "doesn't engage the language center of my brain" is more accurate (and less pejorative) than "mindless". It certainly engages spatial reasoning and some logic.
Nice! In line with other apps like this (e.g. LinkedIn's queens), I think the grid should be marked complete once you have all the boats, without needing to mark all the water.
That might be good. One shortcut I did add, you can click the numbers to auto-fill water once a row is complete.
This is one of the puzzles at BrainBashers:
https://www.brainbashers.com/battleships.asp
This implementation seems to work a little better: https://www.puzzle-battleships.com/
I've spent quite a few hours on this thing when I've needed something non-linguistic for my brain to engage in. If it was World of Warcraft, I'd probably be a level 30 rogue.
Nice puzzle, reminds me of Zachtronics' Dungeons & Diagrams.
What this needs is a daily puzzle and an easy way to share it in text format, a la Worlde or Domino Fit...
You can find a shareable link to the puzzle by clicking the gear icon.
There’s a bug: if a puzzle has multiple solutions, only one of them is considered “correct”.
Author here - check that the revealed ships in your puzzle are keeping their particular shape. E.g. a revealed-at-start "D" shape ship-end can't be the middle of a ship, or an "O" submarine, or face a different way that it's initially facing. 99.9% of the time people report this, it's a confusion about that aspect (if you can think of a way I can make it clearer definitely let me know!).
The simplest way would be to also pre-fill forced empty spaces. It 'solves' part of the puzzle for the player, but hopefully that wasn't a key part of the fun. You go as far as to explain all of those bits at the bottom anyway.
This kind of thing is done to great effect in "Good Sudoku", which gives players a lot of automated tools for the simplest things, as to lead players to handling the more fun, more complicated parts of the hard puzzles.
Here's an experimental implementation, reveals the water cells around any revealed boats:
https://lukerissacher.com/battleships?revealwater=1
Not sure I like it, kinda makes the starting puzzle noisy/crowded.
That would be a cool direction to explore.
Putting a blank space in front of or behind as appropriate for the starting revealed square(s) would make sure people don't keep having the problem.
I think the easiest way to make it clearer is to highlight it in red as a mistake if done incorrectly, as you do with the counts on the row ends. If you try to place a ship token close to another one then you should also highlight it in red.
Yeah took me a bit to catch how the starting spaces worked. Not sure how to clarify that other than just writing it out in the instructions below.
An undo button would be nice :) (for when I need to backtrack)
If you turn on hardmode there's a "Save Checkpoint" button. But not easy mode at the moment (I wanted to keep the UI clean).
"Ships can't touch diagonally."
But it lets you do it and then tells you it's wrong at the end.
When the "4" has a strikethrough, the strike is almost impossible to see.
"Ships can't touch diagonally." is a rule qualifying valid answers, not what can be drawn on the diagram