210 comments

[ 0.20 ms ] story [ 369 ms ] thread
I wish it could keep track of where the knight has already been.
That and some explanatory text as to what the game actually is. My first thought was to try to capture the queen.
I tried and it wouldn’t let me. :(
Yeah the goal is actually to avoid the queen while visiting every space. Eventually I clicked "Help" and learned that.
How do you visit the squares that the queen is covering?
You don’t. They’re not counted I think.
It has text now? "Move the knight to every square, right to left, top to bottom. Don’t land anywhere the queen can take you, and don’t take the queen."
I'm on a phone, I think that's the difference.
Except, it's not accurate. It says "move the knight to every square" but the game is actually "move the knight to the next square specified".
It might not be obvious, but the specified squares are "all the squares in the order right to left, top to bottom without those the queen can attack" as the text instructs.
The text changed since my comment was posted.
Yes I agree. They do have a square coordinate at the bottom which is the next square to go to following that will get you all the chess squares
How does that help you get to the indicated square?
I didn't actually realize the goal of the game was to do it all in order! The help text just says "Move the knight to every square, right to left, top to bottom."
It may have been updated after you started.
I'm having difficulty understanding your difficulty in understanding. What did you think "right to left, top to bottom" meant?
I got the same problem, I thought it meant 'relative to the current position', until you hit bottom left.
The fact that it doesn't highlight where you've moved already makes it no fun.

Edit: the directions weren't super clear. I see that you're actually supposed to go to every square in a specific order (first G8, then F8, E8, etc), not just visit them all in any order. That means you have to do a bunch of laborious trips around the queen to go to certain squares since you won't have enough room to maneuver directly there.

I agree, but I wonder if it's on purpose.

I found the repo[1] and it's very small readme says it's a "Chess visualization exercise"

So I'm wondering if it's an extreme exercise in memorization to help you visualize games better.

(I'm just talking out my butt here, I know nothing about chess puzzles)

[1]: https://github.com/jairtrejo/knight-moves

why would I practice visualizing not-chess information about chess pieces, when I could visualize actual chess information?

The history of a pieces moves is irrelevant to chess, except in extreme corner cases of repetition.

The history is irrelevant here as well, you just need to know the next goal, which is always indicated.
I see that now. The UI has poor discover ability of the goal, especially on mobile.
It is, because you need to get to the square that's indicated, not any random square.
They should highlight the target square in the board instead of only writing it in the "clock".
> should highlight the target square in the board instead of only writing it in the "clock".

If it's a visualization exercise, they should not. Gaining intuition for notation is strangely enabling, particularly if you have an algebraic mind.

yes, i have an algebraic mind, and I find it easy to visual where the squares are, and if you say "N-KP4", I'm Johnny-on-the-spot! now, what's this a-b-c stuff?
N-KP4 is descriptive notation [1] which was the standard notation used in chess until about 1980. Ne4 is algebraic notation [2] which is the standard notation used in chess today (since 1980).

[1] https://en.wikipedia.org/wiki/Descriptive_notation

[2] https://en.wikipedia.org/wiki/Algebraic_notation_(chess)

I'm relieved to see that the following is included at that link:

The term "algebraic notation" may be considered a misnomer, as the system is unrelated to algebra.

It depends upon what you are trying to visualize. If you are trying to visualize the pattern of the knight's moves, e.g. how to reach a specific square using a sequence of moves, then highlighting the target would be more valuable. The displacement matters, not the absolute positions. The absolute positions are more of a hindrance since it makes it more difficult to generalize the sequence of moves.
The point is learning to generalize the sequence of moves, and that's why it doesn't give any visual cue.
In a real chess position, where the knight must go is the easy part because there something interesting to do there (like capturing a piece). The problem here is that the chessboard is empty, so it's difficult to remember where you should go.

The interesting part is finding the knight trajectory, reading the notation is boring and easy.

(If the point of the exercise was to read the notation, it should be a different game, like clicking that square as fast as possible.)

> where the knight must go is the easy part because there something interesting to do there (like capturing a piece)

The aim is to build an intuition for where the knight can traverse without getting captured in N moves. If you can see further into the future than your opponent, you may notice a pattern before they have a chance to stop it. This intuition isn’t fundamentally tied to notation. But having intuition for the notation facilitates it since that’s how discussion and literature will interface with you.

That's how I took it as well. Everyone talks about highlighting stuff but you don't get highlights in real games. I got more comfortable with knight manouvers and chess notation thanks to this puzzle.

It should definitely have some visual tutorial for people to understand how it works though.

Still doesn't make it sense from a UX perspective. You can make it an option to highlight the square or just show coordinates and cater for both crowds.
Ah ok! If this is part of some sort of chess training course, this would make sense. Sadly, HN is really bad at presenting context for a submission.
Turns out you're supposed to do them one at a time, in order. Tracking the visited squares doesn't add much for that
How to get it to C8? Gah!
Took me ages. What finally helped me was to work backwards from c8. What squares can get to c8? Which of those squares can I eliminate (e.g. because to get there I'd have to be on a square covered by the queen) and so on.
That's how I had to do almost every move. It's really a graph search!
I love the amount of chess nerds on Hacker News. If anyone is in the East Bay of SF and likes chess, I run a chess club in Walnut Creek, hit me up!
I'm in the East Bay, but just a little bit too far West for that to work out for me. :(
Small world! Is this the one at La Scala I've been hearing about?
Yes! Come by tonight, 7p! There's actually a former YC guy that shows up sometimes, too.
Hmm, a weird version of a Knight's Tour.

https://en.wikipedia.org/wiki/Knight%27s_tour

It seems like in this version / webpage, you're allowed to revisit squares however. It'd be nice if it highlighted what squares "Counted", because the words are quite ambiguous. A graphical representation of what is being counted / not counted would be very helpful.

----------------

EDIT: Ah, I got it. The location on the left is the next spot you're supposed to go to. The puzzle is quite easy once I understood the interface.

The interface needs a "Next square: h5" or something. I really didn't get it for the longest time.

The play on the Seger lyrics "night moves" with a chess knight was done earlier in an old ytmnd I remember
I think the instructions should be:

Move to the square indicated below the board without moving to a square the queen can capture and without capturing the queen. Once accomplished a new square will be indicated. Repeat until all possible squares are done.

Holy... is that what you're supposed to do?!? No wonder the bar wasn't growing even though I jumped to every possible square -.-
Judging by this thread every single person did the same thing and became equally frustrated (myself included).
something something programmer found dead in the shower
Maybe we were pushing the programmer a little too hard for changes if they felt compelled to continue working on their project while showering. (Remember folks: using a computer, or any other electric appliance, in the shower is a bad idea!)
...unless it's an electric shower?

(Much as I'm tempted to agree they were a bad idea, we're kind of past that point and it's sort of fine... A bad idea well-executed?)

no, you just have to use your brain implant's wireless connection to make changes. what kind of 21st century lame-os are you that have to worry about electric connections to the computer?
ohmuhgawd, that's gotta be the darkest thing i read all day and caused me to literally lol (so that device would let me type it) so hard i spilled a bit of my old fashioned.
Well, it's the one thing the directions didn't actually say: The goal of the game. I'd be shocked if anyone went to that site and could figure out what to do.
The game tells you what square to move to.
(comment deleted)
You need to have /some/ experience playing chess to realize and understand chess notation.

And no, vague and indirect "move to every square in order" located separately from the chess notation is not good information. Also, no, tiny nomenclature for ants on the board is not good information.

Also on a phone/thin browser window the goal shrinks from "huge text under the header" to "small text at the bottom of the screen" and the instructional text disappears.
(comment deleted)
Have to raise my hand then to shock you.. what else should the coordinate that is also indicated on the axes mean?

> to every square in order, right to left, top to bottom

Added to that immediately.

shrug But yeah as the title says, one realizes quickly that knight moves pretty strange so got bored after 5 targets and did something more exciting: wrote a Python script that prints me the moves from and to any coordinate (:

Have to raise my hand then to shock you.. what else should the coordinate that is also indicated on the axes mean?

Yeah, but it's not clear that the instructions text is talking about that symbol, *because it doesn't say so* explicitly.

Sometimes a small level of information redundancy is good for communicating with humans, instead of forcing them to make the correct inferences in place.

It wouldn't technically be redundant, the help instructions are ambiguous.
How is this #3 on my HN today? Is it supposed to be a lesson on how NOT to write?
Because everyone on HN was totally sucked in? I sure was.
Wow, I thought it was just cus I was drunk
I'm confused. What "same thing" did everyone try? The instructions in the help section in the game seemed perfectly clear?
No, they say to move in every place, while you're expected to to move to a specific place in every step. f8 is the first for me, but I did not understand that was supposed to be the target, since it seems arbitrary.
But it says "every square in order right to left, top to bottom"?
I understood that to mean that 'each single move' should aim to move to the left and below the previous position if possible (presumably to reach the bottom left square as the game goal?); taking 'every square' to imply 'every square you move to'; and being further complicated by having a complex subordinate clause with restrictions to movement.

It's not a clear, unambiguous instruction.

I was like, ok neat but too bad that bar is broken.
I was thinking, dude I can just move the knight between the same two squares, this game is easy.
"It's a user error".. "Users are stupid".. "Why can't they just understand something so simple"
so they only now added a help button? that's what it says there.
Just curious, what exactly did you think "in order, right to left, top to bottom" was supposed to mean?
I thought it meant "goto the bottom left corner" or "goto the top left corner then goto the bottom left corner." or "mark all legal tiles visited".

There's no hint in the help that you're suppose to goto the tile coordinate specified by the little box in the bottom left corner. I'm not even technically sure that's what the "f8" at the beginning is for since the help doesn't mention it.

Like move the Knight to every square on the board, in a certain order, but skipping some. I didn't notice the "f8" at the bottom until I read the comments.
Wow. Thanks. Totally missed that.

Maybe throw a little highlight on the square on the board as well.

Or just put a target on each goal square in turn.
Yeah I don't think text instructions are even necessary here if you make enough visual suggestions.
I think the text is useful for describing the ultimate goal, but agree that visual suggestions would make it easier to figure out what the problem is about.

For example, I read this as a variation of the knight's tour but was confused as to why they didn't highlight the visited squares. (Answer: it isn't a knight's tour since each square will be visited more than once.)

Another example, the description itself didn't quite make sense since it mentioned a sequence but didn't really say that certain squares must be skipped. (In retrospect, the answer is obvious. The queen makes certain squares invalid destinations, along with being invalid intermediate steps to that destination. But it won't be obvious to some people upon initially reading the instructions.)

Finally, the purpose of the square shown in the completion gauge isn't explained at all. Since it is not explained, I did not link it to the description of the goal.

> I think the text is useful for describing the ultimate goal

No, text is not needed if the next target block is marked - after the first three acquisitions of the first three target blocks, the game is very clear.

so says every primary math student learning word problems
A short note about how the coordinates work would also be helpful, or just highlight the target square, because not everyone knows chess notation by heart. I tried two different interpretations (both wrong) before finally resolving to google for it.
They are written on the board..?
Wow, I totally didn’t see those. Much too small and low-contrast, they are basically invisible on a smartphone.
I'm not seeing the letters. I see the numbers and vaguely knew enough about chess to know which way the numbers go. Honestly, I really only know about the board location designations because of the puzzle under the word scramble in the paper that asked you to accomplish something on the example chess board. The answers to the previous challenge were written (upside down to prevent accidental spoilers) in the standard(?) chess notation.
I did not see those markings at all - nor did I see the label indicating the square to jump to, until quickthrower2's explanation cued me to look for it!

(I see now that the target-square notation is much more prominent if you stretch the window horizontally, but I habitually use portrait-mode windows, where it's very small.)

> not everyone knows chess notation by heart.

I am going to agree, and hopefully clarify the point with a slightly different example. While I know how the notation works, I cannot figure out where a particular square is at a glance. This meant a lot of time squinting at the tiny, low contrast labels at the edges of the board. It made the problem a lot harder to solve since my concentration was constantly being disrupted by figuring out where the next destination is, rather than focusing upon the pattern of the knight's moves.

It asked me to move to e8...but that's a move where the Queen takes Knight. I don't get it.
Look again. The queen doesn't take the knight at E8.
You're right, but I naturally hesitated to move there because I play chess a lot.
Honestly I read this the first time and thought you were making a suggestion as to how the game should be changed. I love the idea but the design and explanation is just awful.
Thank you! Once I saw this comment, very satisfying puzzle. At first I was fumbling my way through randomly, but around halfway I started to visualize the board as two "sets" of connected paths and grokked how to switch between them using the lower-right quadrant.
> Thank you! Once I saw this comment, very satisfying puzzle. At first I was fumbling my way through randomly, but around halfway I started to visualize the board as two "sets" of connected paths and grokked how to switch between them using the lower-right quadrant.

Exactly this - I used the upper right quadrant to switch lanes, but the idea is the same: if you cannot reach the target in the current lane, switch lanes and try again.

Thank you! This was a really fun puzzle once I read your comment. It’s much appreciated!
And move the bar to the top with a bit of text - "Next square: F8"

Yeah I spent a lot of time trying to hit every square.

here's a script that will highlight previously visited squares as red. as a nice bonus it replaces the instructions with more accurate ones

  // Get all square elements
  squareElements = [...document.querySelectorAll("[data-testid='white-square']"), ...document.querySelectorAll("[data-testid='black-square']")];
  
  // create array of elements that have been landed on
  // these need to be set to red every time because the board resets every move
  let modifiedElements = [];
  observer = new MutationObserver(function (mutations) {
    mutations.forEach(function (mutation) {
      if (mutation.addedNodes.length > 0) {
        mutation.addedNodes.forEach(function(addedNode) {
          key = addedNode.getAttribute('data-testid').split('-')[1];
          if (!modifiedElements.includes(key)) {
            modifiedElements.push(key);
          }
          for (let i = 0; i < modifiedElements.length; i++) {
            el = squareElements.find(e => {
              return e.getAttribute('data-squareid') === modifiedElements[i]
            })
            el.style.backgroundColor = 'red';
          }
        });
      }
    });
  });
  
  // observe all square elements
  for (let i = 0; i < squareElements.length; i++) {
    observer.observe(squareElements[i], { childList: true, subtree: true });
  }
  
  // replace instructions with more accurate instructions
  instructions = document.querySelector('section p')
  instructions.innerHTML = 'Move to the square indicated below the board without moving to a square the queen can capture and without capturing the queen. Once accomplished a new square will be indicated. Repeat until all possible squares are done.';
very clever little hack -- had to fix the first couple of lines to remove extra newlines and "...."
thanks! not used to the HN code comments. fixed it
Perhaps it's me but had absolutely no trouble interpreting the 'help' meassage. Before I did though, for at least some time, was trying to capture the queen :)
Kind of makes you appreciate the amount of work most games put into UI design. This game mechanic is very simple and it still needed documentation... And the documentation wasn't enough! Immensely complex games these days are so good at providing hints and player feedback that many often don't need their tutorial levels.
IMO the documentation says to do something completely different than what the apparent goal actually is.
Sure. It's a different facet of the same problem. There's a damn good reason that professional software development organizations hire designers and technical writers, and while many developers like to think so, it's not merely to save them time. Developers often suck at making docs for other developers; reasoning about communicating to people one step removed from that gets even dicier. As a developer before I learned good design principles, I often fell into the trap of assuming my being able to assemble something in code gave me sufficient understanding of why it was designed that way. Ah, the hubris of inexperience.
another hidden UX: clicking a square will move the knight there (if valid move). do not have to drag and drop.
Man, I was losing it on mobile since a) I didn't get that it tells you the next field below the board, then b) the labels in the squares are too low contrast to be visible on my phone, and c) 9 out of 10 times the browser would start scrolling instead of starting to drag the knight.
Thanks.

They wouldn't have to write any instruction nor add letters and numbers around the board (they are missing) if they marked the goal square. Even after I read your instructions I equivocated where f8 is. I actually moved to f1, then realized that's a long time since I looked at a chess diagram.

A demonstration of how a little detail can ruin a project.

Target square in middle of circle, don't get captured or capture.
I suppose you win the 10000 IQ award for being the only person on the website to realize?
Probably a regular entry in /r/IAMVeryIntelligent
Better instruction from alt implementation of game linked below:

"Objective: Get to every square of the board that is not attacked by the queen (without capturing it either), right to left, top to bottom."

Clarifies the square indicator tip isn't necessary for the instructions.

https://news.ycombinator.com/item?id=34462855

Where was this comment 5 minutes in?
I didn't read the instructions at first and was confused why it wouldn't let me take the queen
clicks help

ha ha I’m not doing that

Right? Where’s the fun in that? I blame YouTube for explaining the bejeezus out of everything and spoilering everything else. Don’t get me wrong, it has its value. I’ve saved hundreds on refrigerator repairs.
I feel like I wasted 18:40 seconds.
Love it. Anyone found a strategy better than “choose a path that will get you there that has a square in the largest quadrant, and jump from there”?
I think this is basically the same strategy I stumbled onto. It feels binary in nature, like you're either on circuit or off circuit within the target areas, and there's only that one degree of freedom within the small quadrants. If off circuit it seems like you have to go to one of the larger quadrants to get on the right circuit again and hit the target.
Same here. By the end, I was just reflexively moving back to the bottom right hand quarter, doing my 3 point turn, and then taking the circuit back to the destination.
Yes, start with the end square and work your way backwards. It is often only a single path that leads you there for the final steps. Once you develop the path close enough back to where you are then it’s easier to see how you can get onto it. Then just follow it.

Incidentally, this is also a good strategy for planning and breaking down goals in real life: begin with the end goal, then work your way backwards.

Nice challenge. Can someone help me understand why other posters want highlighting for visited squares?
Because they think you just have to visit all the squares in no particular order.
But it says right there which square you have to visit next.
(comment deleted)
It's hard to spot if you don't know it's there.
..

When you just don't seem to have as much to lose?

Strange how the night moves.

With autumn closin' in.

We were gettin' our shaaaare....

My first thought as well. I wonder if it was an intentional reference.

Edit: Duh - it's right on the page "Inspired by Ben Finegold and Bob Seger."

As a teenager I had a chess lesson with Ben Finegold and I practiced this puzzle for weeks on a physical board.

He also mentioned this riddle off hand which I had a ton of fun solving. https://fivethirtyeight.com/features/how-about-a-nice-game-o...

That is fun! It's interesting, the solution is presented here[1], but I'm pretty sure it's wrong (off by 19) due to not taking into account the possibility for the pawn to move two squares on its first move.

[1] https://fivethirtyeight.com/features/can-you-survive-this-de...

That post says,

> Note: If you counted the pawn moving forward two squares with its initial move as distinct from its moving two individual squares, then there are 160 paths. Feeling generous, I gave full credit for either approach.

I guess I didn't read far enough. Seems pretty obvious you'd need to count that as a separate path, to me the 141 answer is plain incorrect.
This took me 14:02 on the first try. Definitely got faster as time went on but I found myself getting stuck on a few squares for no good reason. Starting from the destination and working toward the source helped.
For me the instructions are pretty clear: every square "right to left, top to bottom" - except don’t land anywhere the queen can take you, and don’t take the queen. (i.e. somehow move to the upper-right, then one to the left and so forth going through the rows and columns backards and down, like reading right to left down a page.)

I gave up after 4 minutes. It's really tough and I only got partway through the second row. I play OK chess (slightly above average on lichess) but it is a really tough visualization exercise.

for anyone who did it to completion, how long did it take? did you speed up by the end?

Took me a few minutes to understand what exactly I was supposed to do but once I figured it out I reset and did it in 13:15. Pretty neat game. I'm not sure I could do it faster a second time, just because my approach is a bit trial-and-error. Some patterns were surprisingly elusive this way.

I actually think I would enjoy it more if the UI helped a bit more, like by marking the squares that were forbidden because of the queen.

Thanks. Regarding marking forbidden squares, apparently the whole point of the game is to develop visualization skills for chess (under Help, it references a grandmaster who recommends this exercise), so if it marked forbidden squares it would defeat the purpose a bit, I think!
Well that took me 28 minutes.

I love it.

7:31, I found the UI kind of annoying. I kept accidentally selecting the text on the edge and then wasted time trying to deselect it.
This is the most boring game ever and I’m not sure why anyone would play it.
To learn how to move the knight effectively in chess.
Took me ~25 minutes which was annoying. As I type this, my brain is worried that the individual keys I type are not knight’s moves away from each other.