Advancing the Design With Two-letter Combinations
Learn how to incrementally add tests in Wordz for handling two-letter combinations and engaging in refactoring for clarity, readability and simplification.
We can proceed to add tests aimed at getting the code to handle two-letter combinations. This is an obvious step after getting the code to work with a single letter. To do this, we’ll need to introduce a new concept into the code: a letter can be present in the word, but not in the position we guessed it to be.
Let’s begin by writing a test for a second letter that’s in the wrong position:
Get hands-on with 1400+ tech skills courses.