Live data from Hacker News

Show HN: Linjat, a small puzzle game

linjat.snellman.net

31–38 of 38 posts

Re: Show HN: Linjat, a small puzzle game

#33

This 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?

The 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.

Re: Show HN: Linjat, a small puzzle game

#34
post #21

Earlier quoted context omitted.

I 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.

Basically 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 l…

Super interesting!

The creator makes sure that each puzzle has a unique solution, right? I don't know if this is intended, but after a few games I notice that knowing this makes it even the expert puzzles relatively straightforward to solve. That is, there are lots of spots where nothing appears to constrain a piece from extending in a given direction, but any solution where it did so wouldn't be unique, so you can rule it out, which makes the puzzle solvable without trial and error.

Re: Show HN: Linjat, a small puzzle game

#36
post #34
post #21

Earlier quoted context omitted.

Basically 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 l…

Super interesting! The creator makes sure that each puzzle has a unique solution, right? I don't know if this is intended, but after a few games I notice that knowing this makes it even the expert puzzles relatively straightforward to solve. That is, there are lots of spots where nothing appears to constrain a piece from extending in a given direction, but any solution where it did so wouldn't be unique, so you can r…

Great question. There is indeed a unique solution, but it's not intended for the player to use that information. (Which is why the rules don't mention that guarantee). I considered a couple of alternatives when writing this:

1. Don't have a single solution, but have any duplicate solutions be trivially transformable to the others. E.g. via the "this piece has two possible orientations, and neither will conflict with another piece".

2. Make having a single solution be part of the rules, and necessary for solving some of the puzzles.

3. Make sure the puzzle generator just never generates a place where the uniqueness of the solution can be used to short-circuit the solution.

4. Punt.

Idea number 1 is probably the best one, but the fear was that players would perceive that as "guessing". But looking at how people actually play the game, I think that fear might have been misplaced.

Re: Show HN: Linjat, a small puzzle game

#38
post #2

This 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.

I created a solver for it using Z3, see https://news.ycombinator.com/item?id=19093754.
Post reply on HN