-
-
Notifications
You must be signed in to change notification settings - Fork 546
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
word-search: Implement canonical-data.json #591
Comments
Existing implementations: xcsharp added: 2016/09/13 The exercise description includes the following grid:
xgo uses the description grid. xcsharp, xfsharp, xlua, xpython all use the following grid:
which differs subtly from the example grid: The git history for the exercise description does not reveal how this deviation came about. However, the xgo implementation is the earliest of the 5 tracks, so I posit that a track decided to tweak the description grid (for reasons unknown to me) and that other tracks duplicated the changed grid rather than the description grid. cc @ErikSchierboom: you added the C# and F# implementations of this exercise; do you recall how or why the description grid was not used in those cases? Thanks! |
Is it the case that the C# and F# implementations deliberately test all eight directions? If so, should that become the standard? Does the existing example grid test all eight directions? |
@petertseng I was just diving in to that, and yes: C# and F# test all directions, and C# (where I started reading) also checks a grid of a different size:
|
C# also tests that words not in the puzzle are not found 👍 |
Ok, @petertseng, you nailed it: Go checks 4 of the 8 available directions. E I'll use the updated version of the grid for the canonical tests. |
Perhaps the example grid can also get changed, then. The other interesting corner case I would recommend is... literally the corner case. Check that a word is found even if one of its letters is in the bottom-right corner. Just checking those off-by-one errors. |
@stkent I'm not completely sure, but I think I copied the existing tests from the Python test suite, where I must have failed to regard the example data in the description. I do think that testing for all directions makes sense here, as that is also how one usually solves these puzzles. Having some corner cases is always good, so I'm all for that!
+1 |
I opened a PR to update the description example: #617. I think the description could benefit from other refinements, but figured this was an easy change to make that might save someone from implementing the 'old' version while the canonical data is under construction :) |
generators: Exercise cases helper methods moved ExerciseCase under the Generator module (and gave thanks for sed) moved the assert helper methods out into their own module, for ease of testing and because ExerciseCase was becoming bloated. added test coverage for ExerciseCase
We want to have a standard set of test inputs and outputs for each exercise to
make it easier to port them to new languages, as well as to help keep the
exercises in sync.
The Word Search exercise can be found in the ./exercises/word-search/ directory.
The step-by-step instructions for how to compile a canonical-data.json file is
described in this section of the contributing guide.
See http://exercism.io/contribute/canonical-data/word-search for the up-to-date list of
language tracks that have an implementation of the Word Search exercise.
The tracking issue has more context.
The text was updated successfully, but these errors were encountered: