That just means how to explore the frontier, like the millons of other graph problems state. Here’s an example straight from LeetCode 200. Number of Islands
An island is surrounded by water and is formed by connecting adjacent lands horizontally or vertically.
However, there’s no hidden expectation in LeetCode 200 that the search will proceed in a straight line.
Word search puzzles in magazines use such a description since ages, and I never ever thought about looking for non-straight words as that would have suprised me. I think it is a hidden assumption, that once again shows that written instruction cannot be unambigious and simple at the same time…
In this mentioned leetcode text, it is obvious each land is a distinct unit that can be connected to other distinct units in all kinds of ways. But in the word search exercise, the unit is the word.
If a word is in a diagonal, the all its letters are in the same diagonal. Otherwise, there are letters in a diagonal, but not a word.
each land is a distinct unit that can be connected to other distinct units in all kinds of ways. But in the word search exercise, the unit is the word.
It’s not at all obvious to me. LeetCode also has word search problems where a word is formed by any manner of zigzag movements allowed by discovering neighbors as allowed by the problem statement.
I’m not sure I understand the reluctance to update the problem statement; in this case slight verbosity doesn’t hurt, and saves everyone from making their own assumptions.
I’m not against changing the instructions. But this is a pratice exercise not exclusive to the go language and many tracks would be impacted (19 have implemented this exercise so far). More than 1000 students have solved this exercise considering just Python and JS, and this doesn’t seem to be a common complaint. So I don’t think we should change things without being very sure the text becomes clearer.
The proposed change may make things more clear ;) Without a proposal, it’s pretty hard to discuss the change. Let’s not assume the proposal won’t help before reading it.
I’m not assuming anything, sorry if my comment looked this way.
As I said, I’m not against changing the instructions. It’s just that I don’t know how it can be improved and don’t have a good suggestion for it (so I’m also not automatically in favor of changing it either). But of course I’d agree with a change that makes things clearer.
In those descriptions, they mention “adjacent cells” not lines of direction. The base description (from Problem Specifications) does not confuse the situation, keeping it very simple, so that the simple thought should be the simple understanding.
The tests should confirm that understanding. There is no mention of adjacent cells, only a direction of the word that may be found.
But adding a “straight line”, may be an improvement, even though, to me, a direction is one way, until there is something that changes that direction, and nothing indicates or encourages a different thought (as far as I can see) that would encourage thinking that a direction would change in the midst of a word that is found.
I admit, though, as a kid, I would take these puzzles and find all kinds of words in the “adjacent cell” (like the game Boggle word find game) kind of rules.
In word search puzzles you get a square of letters and have to find specific words in them. Valid words follow a straight path from start to finish without turning, and possible directions include left-to-right, right-to-left, vertical and diagonal.
Edit - To be clear, this is a proposed edit to the text.
Yep, I’ve never in my life saw a word search puzzle that not using straight lines.
Personally I dont care if this got updated or not, for me this is already simple and enough to understand.
A lot of exercises on exercism is based on real life games, the assumption of some knowledge is there implicitly, and if you never play those then you should at least get to know them a bit first.
There was never any mention of dominoes values can only go from 1 to 6 or standard dice also have 6 sides in other exercise, it just things that were assumed knowledge.
Finally, the test suite as we often said is the authoritative source, if every single test result expecting a straight line pairs of indexes, this should also clue you in how it should work.
No. We try hard to not make that assumption. Sometimes we’re just oblivious to the assumptions we make. None of the exercises should depend on any prior knowledge.
The tests are the authoritative source, but the tests don’t make it obvious that only straight lines are accepted.
The verbiage here seems pretty good to me. In addition, an example could also be provided as follows.
// For example:
// Puzzle:
// +---+---+---+---+---+---+---+---+---+---+
// | j | e | f | b | l | p | e | p | r | e |
// +---+---+---+---+---+---+---+---+---+---+
// | t | c | l | o | j | u | r | e | r | m |
// +---+---+---+---+---+---+---+---+---+---+
// Word "clojure" left-to-right match:
// +---+---+---+---+---+---+---+---+---+---+
// | j | e | f | b | l | p | e | p | r | e |
// +---+---+---+---+---+---+---+---+---+---+
// | t |[c]|[l]|[o]|[j]|[u]|[r]|[e]| r | m |
// +---+---+---+---+---+---+---+---+---+---+
// Alternative match that's not allowed because the
// direction changes from left-to-right to vertical:
// +---+---+---+---+---+---+---+---+---+---+
// | j | e | f | b | l | p |[e]| p | r | e |
// +---+---+---+---+---+---+---+---+---+---+
// | t |[c]|[l]|[o]|[j]|[u]|[r]| e | r | m |
// +---+---+---+---+---+---+---+---+---+---+
While the tests are the authorative and technical specification, they are not always revealed to the student, as concept exercises reveal differently than practice exercises.
While the tests are the authorative and technical specification, they are not always revealed to the student
It’s even more frustrating when the challenge becomes “try to figure out what the author had in mind while writing this test” instead of “solve the problem as specified”.
The example looks good to me. I’d consider dropping "from left-to-right to vertical:" from the alternative match comment. That match is disqualified because we changed direction. It doesn’t matter which direction we changed to so we shouldn’t call that part out. Students might misunderstand and think other direction changes are allowed.
The description already has an example. The proposed change combines the paragraph before the example and the paragraph after the example. It sounds like the proposal here would change more than one sentence but may reorder the entire description.
Would we drop the old example? Should we add a smaller, simpler example that, say, contains two words and illustrates that the direction cannot change? I think that can be shown on a 3x3 grid with 3 letter words.
I’d be in favor of that. Of course, we don’t need to pick an existing track as the word to find, but here are some options depending on whether we want a 3x3 or a 4x4 (in case a longer one is easier to hide)
This contains ROC across the top row and RED down the left column. Note, ROC starting in the first column and continuing down the second column is not valid as it does not form a straight line.