1from secret import clue
2
3def lucky():
4 left = clue(left_shift=6)
5 right = clue(right_shift=5)
6 bw_and_result = clue(bw_and=8)
7 bw_or_result = clue(bw_or=223)
8
9 for i in range(256):
10 if ((i << 6) & 0xFF == left and (i >> 5) == right and (i & 8) == bw_and_result and (i | 223) == bw_or_result):
11 return i
F
======================================================================
FAIL: test_lucky (test.TestLucky.test_lucky)
Test with various cases.
----------------------------------------------------------------------
Traceback (most recent call last):
File "/tmp/test.py", line 30, in test_lucky
self.separate_test(255)
File "/tmp/test.py", line 24, in separate_test
self.assertEqual(solution.lucky(), value)
AssertionError: 235 != 255
----------------------------------------------------------------------
Ran 1 test in 0.003s
FAILED (failures=1)