7 ms·
Show HN: Linjat, a small puzzle game
- jsnell 8y agoThis game was originally designed as a substrate for experimenting with procedural puzzle generation (for generating interesting puzzles given a rules set, not for generating new rules sets). I thought I'd post it here, since it ended up being kind of fun to play in it's own right, not just an algorithmic experiment.
- SiempreViernes 8y agoProbably would benefit from some sort of subtle grid indicator, since counting squares/positions is central to solving the puzzles.
- yorwba 8y agoYou have "overflow: hidden" in the CSS for the body tag, which makes it impossible to read the full text of "how to play" on my screen.
- onemoresoop 8y agoSame problem here but I figured out myself how to play from the tutorial
- jsnell 8y agoThanks for the report, to you and everyone else who had that problem. Just for testing purposes, what kind of a device was this on? Unfortunately the overflow: hidden is needed for the touch event handling to work properly. But there's probably some reasonable solution based on resizing / scaling instead.
- cityzen 8y agocool game! Do you know of any games on iOS that are similar?
- konamacona 8y agoI̶ ̶m̶i̶g̶h̶t̶ ̶b̶e̶ ̶m̶i̶s̶s̶i̶n̶g̶ ̶s̶o̶m̶e̶t̶h̶i̶n̶g̶,̶ ̶b̶u̶t̶ ̶I̶ ̶t̶h̶i̶n̶k̶ ̶e̶a̶s̶y̶ ̶4̶ ̶i̶s̶ ̶u̶n̶s̶o̶l̶v̶a̶b̶l̶e̶.̶ ̶T̶h̶e̶ ̶b̶o̶t̶t̶o̶m̶ ̶6̶ ̶c̶a̶n̶n̶o̶t̶ ̶e̶x̶t̶e̶n̶d̶ ̶u̶p̶w̶a̶r̶d̶ ̶o̶r̶ ̶i̶t̶ ̶b̶l̶o̶c̶k̶s̶ ̶t̶h̶e̶ ̶4̶,̶ ̶a̶n̶d̶ ̶i̶f̶ ̶i̶t̶ ̶g̶o̶e̶s̶ ̶h̶o̶r̶i̶z̶o̶n̶t̶a̶l̶,̶ ̶t̶h̶e̶ ̶6̶ ̶o̶n̶ ̶t̶h̶e̶ ̶r̶i̶g̶h̶t̶ ̶i̶s̶ ̶u̶n̶p̶l̶a̶y̶a̶b̶l̶e̶.̶ https://linjat.snellman.net/#game.easy.4 https://linjat.snellman.net/#game.easy.4 edit: My logic parts are weak
- djaychela 8y agoI was wondering as I played it if you had come up with some 'evil' to create the levels, as each one has an element of 'gotcha' to them. Any info on how you did this? Novice programmer here, and probably not capable of understanding anything too complex, but I'd be interested if there's anything you could point me at to try to understand how you do this sort of thing.
- jsnell 8y agoBasically the level generator consists of three stages. Stage one is just to generate a level by randomly placing numbers on the grid. Stage two is to run a special solver for the puzzle, which tries to solve the puzzle the way a human would (applying different kinds of local deduction rules, e.g. "only this number can reach that dot, so that's how the line has to be drawn" or "there's not enough space to draw this line vertically, so it has to be horizontal", and then a handful more of increasing complexity). If the solver gets stuck, it adds more dots to the board, with the locations of the dots being such that they're going to provide as little information as possible at the start of the game. That gives a seed puzzle to work with, which is solvable but usually not very interesting. Stage three is optimizing the puzzle. That's done with what's basically a hill-climbing algorithm. So take a puzzle (either the original, or a better puzzle that's been found during the optimization) and change it a bit by moving or changing the numbers. Then run the solver again on the modified board, but with all the dots removed. If the new puzzle is solvable, it's scored on a bunch of metrics, and if it's good enough it goes into the pool of improved puzzles for the next iteration to work on. Obviously for this to produce the feeling of gotchas, the metrics have to be chosen to match human intuition on easy vs. hard moves. That's the tricky part. That's the gist of it. I'm planning on writing a blog post on it later with more details.
- failrate 8y agoI am looking forward to your blog post. I tried a random Sudoku generator back in the Flash days, and all of the feedback was that players could tell the puzzles were completely randomly generated. Please ping me when the blog post is up. Thank you.
- 8y ago
- pbalau 8y agoConsidering flagging this, I definitely do not need this in my life. Works beautifully on Android/chrome, you really nailed the user interface. Maybe add a way to mark some lines as the only possibility... Going to ruin some of my friends productivity too
- redfast00 8y agoI created a solver for it using Z3, see https://news.ycombinator.com/item?id=19093754 https://news.ycombinator.com/item?id=19093754.
- erichsu 8y agoEnjoying this! Other than the bug about instructions not showing right in landscape mode due to noted css issue.
- onemoresoop 8y agoI love it. Was a bit confused at fist since the lines can be extended in both ways. Yeah, i see this as an little addictive game. Do you have it on IOS?
- jsnell 8y agoAfraid not. But I think you can use "add to home screen" in Safari to get an icon to launch it as an app (i.e. no browser controls).
- pbhjpbhj 8y agoIt's 2048 all over again. I too had problems realising you could drag the lines in both directions, obvious after the tutorial; but who's got time for that!
- Timucin 8y agoAmazingly simple yet awesome. Well done.
- phailhaus 8y agoNavigation seems to be broken. Nothing happens when I use the browser's (Chrome) back button to return to the main page, even though the hash changes.
- realo 8y agoCool thingie. However... I would re-label the « Back » button as « Home » and add a « Back » button that undoes the last move...
- mmazzarolo 8y agoReally cool, seems similar to the trees and tents puzzle game.
- Strang 8y agoGreat idea for a puzzle. It really needs a grid and an undo buffer.
- aurelwu 8y agovery elegant puzzle with super simple rules (which I consider a big plus over hard to explain puzzle games... which my games might suffer from a bit). Extending a line in both ways is a bit more cumbersome, maybe you should allow start drawing a line everywhere and just materialize it if it crosses a number.
- tardismechanic 8y agoOh my god I love this game! Well done!
- failrate 8y agoIt's really, really good. I really like manipulating the number lines, which I think is important (the basic action in a game should feel inherently good)
- pwaivers 8y agoOne suggestion: There should be some positive feedback when you solve a puzzle. Like prints "Congrats" and play a little jingle. Overall great game!
- malkia 8y agoFantastic! Thank you so much!!!
- krmbzds 8y agoThis is a great puzzle game. I am absolutely hooked!
- ozmaverick72 8y agoVery enjoyable, fun simple game. Would like it to show your the highest level you have solved so far. eg. Highest score: easy level 4
- tartoran 8y agoThis is a great game, I will add it to my home screen. It plays nicely in the browser on an old iPhone, mine. What did you use to make Linjat? Would you shatter the technologies? Any github?
- jsnell 8y agoThe UI is mostly raw Javascript, with a bit of jquery. It's all in one JS file and not minimized, so you can view the source in the browser if you want to see what it looks like. (Spoiler: it looks like a disgusting pile of hacks, just like all game UI code tends to). The puzzle generator is in C++. I'll put both on Github, but they require a bit of cleanup work first.
- glenmcd 8y agoLinjat is a great game, and my GF got immediately hooked also :) I suggest that it would greatly benefit from adding features: 1. Save/restore 2. Undo/redo
- kentbrew 8y agoWhy is there a Done button?