From 4324b91d858b6892706524640b8a4e86ddb04875 Mon Sep 17 00:00:00 2001 From: Daniel Tsvetkov Date: Wed, 19 Jan 2022 13:12:37 +0100 Subject: [PATCH] solve update --- play.py | 6 ++++-- solve.py | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/play.py b/play.py index 09638d3..af5cb64 100644 --- a/play.py +++ b/play.py @@ -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() diff --git a/solve.py b/solve.py index fe479e2..09eddc4 100644 --- a/solve.py +++ b/solve.py @@ -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