This check ensures the proper iteration implementation of check_word. Incorrectly looping through the choice rather than the guess could cause the program to miss the second letter.
This is clear when comparing the guess 'grass' to the choice 'joust.' When you loop through joust, the code finds an exact match between the 4th letter and breaks. However, the code never compared the 4th letter of 'joust' to the 5th letter of 'grass,' which should have been a close match, but instead gets labeled as wrong.
In addition, the current implementation of scoring is flawed and needs to be changed. If done, the check 'links' can be changed to the check 'sinks' for thoroughness.
This check ensures the proper iteration implementation of check_word. Incorrectly looping through the choice rather than the guess could cause the program to miss the second letter.
This is clear when comparing the guess 'grass' to the choice 'joust.' When you loop through joust, the code finds an exact match between the 4th letter and breaks. However, the code never compared the 4th letter of 'joust' to the 5th letter of 'grass,' which should have been a close match, but instead gets labeled as wrong.
In addition, the current implementation of scoring is flawed and needs to be changed. If done, the check 'links' can be changed to the check 'sinks' for thoroughness.
https://github.com/cs50/problems/issues/192