1from secret import clue
2
3
4def lucky():
5 """Get the КЪСМЕТ address from the БАНИЦА!"""
6 result = clue(left_shift=5) >> 5 # add the 3 LSBs
7 result += clue(right_shift=5) << 5 # add the 3 MSBs
8 result += clue(bw_and=16) # add the 4th bit (reading right to left)
9 result += clue(bw_or=247) & 8 # add the 5th bit (reading right to left)
10 return result
.
----------------------------------------------------------------------
Ran 1 test in 0.004s
OK
| f | 1 | from secret import clue | f | 1 | from secret import clue |
| 2 | 2 | ||||
| 3 | 3 | ||||
| 4 | def lucky(): | 4 | def lucky(): | ||
| 5 | """Get the КЪСМЕТ address from the БАНИЦА!""" | 5 | """Get the КЪСМЕТ address from the БАНИЦА!""" | ||
| n | 6 | result = 256 # Start with 0b100000000 | n | ||
| 7 | result += clue(left_shift=5) >> 5 # add the 3 LSBs | 6 | result = clue(left_shift=5) >> 5 # add the 3 LSBs | ||
| 8 | result += clue(right_shift=5) << 5 # add the 3 MSBs | 7 | result += clue(right_shift=5) << 5 # add the 3 MSBs | ||
| 9 | result += clue(bw_and=16) # add the 4th bit (reading right to left) | 8 | result += clue(bw_and=16) # add the 4th bit (reading right to left) | ||
| 10 | result += clue(bw_or=247) & 8 # add the 5th bit (reading right to left) | 9 | result += clue(bw_or=247) & 8 # add the 5th bit (reading right to left) | ||
| t | 11 | return result & 255 # Trim to a single byte | t | 10 | return result |
| Legends | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
| |||||||||