TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Battleships Logic Puzzle

254 pointsby QuadrupleA7 months ago

36 comments

namuol7 months ago
Love it!<p>If you like this sort of thing, be sure to check out Simon Tatham (creator of PuTTY)’s Puzzles: <a href="https:&#x2F;&#x2F;www.chiark.greenend.org.uk&#x2F;~sgtatham&#x2F;puzzles&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.chiark.greenend.org.uk&#x2F;~sgtatham&#x2F;puzzles&#x2F;</a><p>The Android and iPhone ports are also excellent and free from ads&#x2F;garbage.
评论 #41948575 未加载
QuadrupleA7 months ago
Interesting tidbit, the Battleships puzzle is NP-complete (<a href="http:&#x2F;&#x2F;www.mountainvistasoft.com&#x2F;docs&#x2F;BattleshipsAsDecidabilityProblem.pdf" rel="nofollow">http:&#x2F;&#x2F;www.mountainvistasoft.com&#x2F;docs&#x2F;BattleshipsAsDecidabil...</a>) - there&#x27;s no known solver algorithm that can do it in polynomial time, as the size of the puzzles &#x2F; boards expand.
评论 #41947911 未加载
评论 #41958677 未加载
gs177 months ago
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&#x27;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).<p>Although can we get a setting to switch left and right click&#x27;s default actions? I prefer puzzle games like this to use &quot;click where there is something, right click to mark where there isn&#x27;t something&quot;.
评论 #41948360 未加载
评论 #41947489 未加载
pavel_lishin7 months ago
Ooh, this is a fun variant of nonograms! If you like this puzzle, I think you&#x27;d enjoy those too: <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Nonogram" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Nonogram</a>
评论 #41947584 未加载
jandrese7 months ago
Weirdly I find the 15x15 puzzles to be easier in general than the 6x6 ones. Maybe it is because the 15x15 ones aren&#x27;t packed as tightly so you don&#x27;t have to use as much second order logic?<p>The only suggestion I would make is have a middle click that marks a spot as a possibility.
RedNifre7 months ago
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!
SilasX7 months ago
Another similar puzzle game is Dungeons &amp; Diagrams on Zachtronics’s <i>Last Call BBS</i>. You have to build a dungeon on an 8x8 grid by deciding which spaces are wall tiles, with some constraints (such as “dead ends must have monsters and vice versa”). That game likewise tells you a sum that each row and column must meet.<p>Someone made a free clone here:<p><a href="https:&#x2F;&#x2F;netchips.dev&#x2F;" rel="nofollow">https:&#x2F;&#x2F;netchips.dev&#x2F;</a>
akleemans7 months ago
Bimaru is a fun puzzle. I remember putting an Android App in the store containing the phrase &quot;Battleships&quot;, only to receive a copyright claim from Hasbro, and Google immediately took the App down from the Store.<p>I rewrote it as a web version, should be still available: <a href="https:&#x2F;&#x2F;www.kleemans.ch&#x2F;static&#x2F;bimaru-web&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.kleemans.ch&#x2F;static&#x2F;bimaru-web&#x2F;</a>
dmurray7 months ago
This doesn&#x27;t work for me on Firefox Mobile on Android at 10x10 or above. It&#x27;s as if the touch targets get too small to select: I can click on the numbers to turn them red, but I can&#x27;t seem to select any square.<p>Works well on smaller sizes and on Chrome on the same device.
评论 #41947822 未加载
o11c7 months ago
I find the implementation of dragging really annoying compared to similar engines. What I&#x27;m used to is:<p>* click and drag will only operate in a single line, either horizontally or vertically<p>* click and drag will only perform the same operation (considering both original type and new type). In particular, if I&#x27;ve already filled in every other cell as water, dragging in &quot;ship&quot; mode should only fill in the empty cells, not overwrite the water.<p>* there should be &quot;undo&quot; support, both Ctrl-Z and U as well as a button<p>Another feature usually <i>not</i> found in similar engines, but really useful in order to regain some of the experience from solving them on paper:<p>* have a nearby text box for keeping notes; clear it when a new puzzle is started
评论 #41949652 未加载
评论 #41954679 未加载
评论 #41959964 未加载
waterhouse7 months ago
I think &quot;doesn&#x27;t engage the language center of my brain&quot; is more accurate (and less pejorative) than &quot;mindless&quot;. It certainly engages spatial reasoning and some logic.
ndarray7 months ago
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&#x27;t possibly be ships, but why wouldn&#x27;t the game do that step by itself based on the blocks placed? That would make the game a lot less tedious.
评论 #41949342 未加载
dahart7 months ago
Kinda addictive. I lost a few hours to this today. I hope you’re happy. ;) After getting pretty quick at the 15x15, it has minesweeper vibes. Works great on iPad, and the implementation is nice. Thank you for sharing.
uses7 months ago
I&#x27;ve spent quite a few hours on this thing when I&#x27;ve needed something non-linguistic for my brain to engage in. If it was World of Warcraft, I&#x27;d probably be a level 30 rogue.
t00ny7 months ago
Nice puzzle, reminds me of Zachtronics&#x27; Dungeons &amp; Diagrams.
zeugmata97 months ago
Nice! In line with other apps like this (e.g. LinkedIn&#x27;s queens), I think the grid should be marked complete once you have all the boats, without needing to mark all the water.
评论 #41947404 未加载
justinpombrio7 months ago
This is one of the puzzles at BrainBashers:<p><a href="https:&#x2F;&#x2F;www.brainbashers.com&#x2F;battleships.asp" rel="nofollow">https:&#x2F;&#x2F;www.brainbashers.com&#x2F;battleships.asp</a>
gnramires7 months ago
An undo button would be nice :) (for when I need to backtrack)
评论 #41946988 未加载
Gunax7 months ago
This is advice to the creator:<p>I think there are unstated rules. Some are implied by the hints (eg &#x27;you can fill water around a ship&#x27;) but it&#x27;s not clear to me at first <i>why</i> that hint works. It looks like ships can never share an edge, just based on the puzzles so far.<p>I am enjoying the game. Thanks for introducing me to something new.
评论 #42012891 未加载
评论 #41959715 未加载
eapriv7 months ago
There’s a bug: if a puzzle has multiple solutions, only one of them is considered “correct”.
评论 #41946571 未加载
luplex7 months ago
I usually play it on here: <a href="https:&#x2F;&#x2F;gridgames.app&#x2F;battleships&#x2F;" rel="nofollow">https:&#x2F;&#x2F;gridgames.app&#x2F;battleships&#x2F;</a><p>In this version, the field can be prefilled with some ship parts
评论 #41953526 未加载
cwmoore7 months ago
Cool to see this here. I like the design and instructions.<p>I’m publishing a paperback book of (numeric) logic puzzles:<p><a href="https:&#x2F;&#x2F;www.kakurokokoro.com" rel="nofollow">https:&#x2F;&#x2F;www.kakurokokoro.com</a>
NooneAtAll37 months ago
having played a lot of this puzzle on <a href="https:&#x2F;&#x2F;www.puzzle-battleships.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.puzzle-battleships.com&#x2F;</a> ... I&#x27;d love a couple QoL improvements, one from there and one to be better than that one<p>- counters for columns&#x2F;rows would be a nice idea to steal<p>- inverse control (so, lmb for ship) would help with not interfering with default behaviour, for people switching to&#x2F;from different puzzles<p>Also ship helper really should come with each type on its own line - your listing is harder to parse than on that website
adamredwoods7 months ago
I think there&#x27;s a bug. If we have two two-length ships, that are next to each other in a connected in an &quot;L&quot; shape, it&#x27;s not possible to define it on the board.
评论 #41950471 未加载
cjfd7 months ago
This implementation seems to work a little better: <a href="https:&#x2F;&#x2F;www.puzzle-battleships.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.puzzle-battleships.com&#x2F;</a>
评论 #41949371 未加载
lupire7 months ago
&quot;Ships can&#x27;t touch diagonally.&quot;<p>But it lets you do it and then tells you it&#x27;s wrong at the end.<p>When the &quot;4&quot; has a strikethrough, the strike is almost impossible to see.
评论 #41948241 未加载
评论 #42012908 未加载
oneeyedpigeon7 months ago
The way the shapes draw themselves — e.g. the curves — seem to indicate if a shape is at the end, in the middle, etc. Is that intentional?
评论 #41950818 未加载
评论 #41954728 未加载
PhasmaFelis7 months ago
I got a puzzle with (at least?) two valid solutions, but one of them is &quot;wrong&quot; and the game refuses to accept it.<p>Boo.
评论 #42012914 未加载
mproud7 months ago
<a href="https:&#x2F;&#x2F;www.webpbn.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.webpbn.com&#x2F;</a>
tcmb7 months ago
What this needs is a daily puzzle and an easy way to share it in text format, a la Worlde or Domino Fit...
评论 #41947842 未加载
throwaway3133737 months ago
It&#x27;s a fun game, but the instructions are unclear. Took me a while to figure it out.
tgeery7 months ago
this is really nice. well done
sans_souse7 months ago
I would vote for this in place of minesweeper on any OS install. Love it!
jader2017 months ago
Do some puzzles require trial and error solving? I’m in a 7x7 that doesn’t seem to have a way to 100% rule in&#x2F;out squares early on.<p>Good chance I’m not seeing one, but I’ve been staring at it for a while, and not seeing it.<p>If someone told me “yeah, all puzzles have exactly one solution, but may require trial and error”, I would feel (only slightly) less dumb.<p>The puzzle is:<p>Ships: 4, 3, 2, 2, 1, 1, 1<p>Top numbers: 4 2 1 2 1 1 3<p>Left numbers: 2 1 4 2 0 4 1<p>Freebie ship square: col 4, row 3<p>Edit: one thing I just realized is that I could have eliminated the diagonal squares from the freebie.<p>Side suggestion: I can’t go back to my puzzle — would be nice if the puzzle was hashed into the URL somehow.<p>Edit 2: Also just realized that the freebie square(s) may point in a direction, so the adjacent square is guaranteed a ship. Don’t know why I didn’t figure that out sooner. I assumed it wouldn’t hint at that or else it would’ve just filled it in for you.
评论 #41953143 未加载
评论 #41951555 未加载
captaincrowbar7 months ago
Broken in Safari on Sequoia, unfortunately.
frank90lee7 months ago
I&#x27;ve been using Simon Tatham&#x27;s Puzzles for years, but I appreciate this clean, web-based implementation of Battleships. The mobile responsiveness is particularly well done. One suggestion: it would be great to have a &#x27;pencil mark&#x27; feature for noting potential ship locations, similar to how Sudoku puzzles handle candidates.