Repository navigation
Commit cda3978
Use binary literals in the secret-handshake example (#893)
* Use binary literals in the secret-handshake example
The exercise's instructions give the gesture values in binary:
00001 = wink
00010 = double blink
00100 = close your eyes
01000 = jump
10000 = Reverse the order of the operations in the secret handshake.
while the example gave them in decimal, so reading the two side by side
meant converting between representations.
Binary literals need Scala 3.5 or later, which the track only got in #888
(3.9.0 LTS). This is the readability improvement #882 asked for, and the
track's first use of the syntax.
allergies was considered and deliberately left alone: its instructions
list the allergen values in decimal, so the same change would make its
example diverge from its spec rather than match it. variable-length-quantity
already names its masks (0x7f, 0x80) and reads fine as it is.
Verified with `bin/test secret-handshake` (11 tests) and
`bin/verify-exercises-in-docker secret-handshake` against the published
test runner image.
Fixes #892
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
* Add rabestro to the secret-handshake contributors
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
---------
Co-authored-by: Jegors Cemisovs <jcemisovs@evolution.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>1 parent bf30773 commit cda3978
2 files changed
Lines changed: 4 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | | - | |
4 | | - | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| |||
0 commit comments