I was mentoring a student in the Dominoes Exercise on the Crystal track and they submitted an implementation that passed all tests but was still not correct. In essence it allowed to use a domino in its reversed and unreversed form at the same time by only checking if one of the 2 positions matched any of the two other ones. While this would make the existing test fail, checking that [1,2] is not chainable, the implementation also handled the case of only one domino separately, so this test actually passed.
I would propose adding another test with an expected outcome of false for the two dominoes [1, 2], [3, 2]. These are not chainable no matter if they are reversed or not. However, the current solution submitted by the student would just output true since 2 matches 2 and therefore not pass this test.
"description": "dominoes can only be used either swapped or unswapped",
“swap” is different from “reverse”, as far as I can tell. I understand that this added test prevents using the original stone orientation mixed up with the reversed orientation (not a mix of the possible sequences of stones). Right?
Also I think this test should not be the last test, but before or after “9a75e078-a025-4c23-8c3a-238553657f39” to keep the order of tests suitable for test driven development.
Thanks for the feedback! swap is indeed not the right term. All occurrences of swap should be replaced by reverse in my writing :D
I’ll adjust the branch in my fork :)