cs50 / problems

Checks for check50
134 stars 227 forks source link

new test for wordle (#192) / update sort_pairs tideman (#172) #230

Closed RemArcAble08 closed 6 months ago

RemArcAble08 commented 7 months ago

Same commits from 2023/x now on 2024/x.

Wordle: 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.

Tideman: Now, starts the unsorted array of pairs in the worst case scenario. Previously, just one swap would have correctly sorted the pairs, meaning many faulty sorting implementations could "accidentally" get the right answer.

rongxin-liu commented 7 months ago

https://github.com/cs50/problems/issues/172 https://github.com/cs50/problems/issues/192

rongxin-liu commented 6 months ago

Thank you!