solve update

This commit is contained in:
Daniel Tsvetkov 2022-01-19 13:12:37 +01:00
parent 37671dd4d6
commit 4324b91d85
2 changed files with 6 additions and 2 deletions

View File

@ -52,16 +52,18 @@ def main_loop():
print("Word was: {}".format(word))
def test():
def do_test():
assert build_letter_hint('yummy', 'slily') == '----Y'
assert build_letter_hint('yummy', 'slyly') == 'y---Y'
assert build_letter_hint('yymyy', 'slyyy') == 'y--YY'
assert build_letter_hint('ymmyy', 'slyyy') == 'y--YY'
assert build_letter_hint('mmmyy', 'slyyy') == '---YY'
assert build_letter_hint('cabby', 'abbey') == '-aBbY'
assert build_letter_hint('abbey', 'cabby') == 'abB-Y'
def main():
test()
do_test()
main_loop()

View File

@ -161,6 +161,8 @@ def do_test():
assert [w for w in round_words('', ['---yy'], ['y----'], dictionary=['slyyy'])] == ['slyyy']
assert [w for w in round_words('', ['---yy'], ['-----'], dictionary=['slyyy'])] == ['slyyy']
assert [w for w in round_words('', ['-y---'], ['--y--'], dictionary=['sysys'])] == ['sysys']
assert [w for w in round_words('', ['--b-y'], ['ab---'], dictionary=['cabby'])] == ['cabby']
assert [w for w in round_words('', ['--b-y'], ['-a-b-'], dictionary=['abbey'])] == ['abbey']
assert [w for w in round_words('nu', ['-o-ns'], ['-----'], dictionary=['towns'])] == ['towns'] # nouns
assert [w for w in round_words('fos', ['-l---'], ['---s-'], dictionary=['slung'])] == ['slung'] # typed basil floss