Skip to content

Commit 2675078

Browse files
secret-handshake: Make examples in instructions.md clearer (#1896)
* Make examples in instructions.md clearer For someone unfamiliar with binary, it's not immediately obvious that 19 can be viewed as 3+16. Directly presenting the solution for the exemplary input of 19 without this context might confuse the reader wondering how one arrives at the presented solution before it is explained in the following sentence. * Update exercises/secret-handshake/description.md Co-authored-by: Erik Schierboom <[email protected]> Co-authored-by: Erik Schierboom <[email protected]>
1 parent 3a43ddd commit 2675078

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

exercises/secret-handshake/description.md

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ You and your fellow cohort of those in the "know" when it comes to
77
binary decide to come up with a secret "handshake".
88

99
```text
10-
1 = wink
11-
10 = double blink
12-
100 = close your eyes
13-
1000 = jump
10+
00001 = wink
11+
00010 = double blink
12+
00100 = close your eyes
13+
01000 = jump
1414
1515
1616
10000 = Reverse the order of the operations in the secret handshake.
@@ -20,10 +20,8 @@ Given a decimal number, convert it to the appropriate sequence of events for a s
2020

2121
Here's a couple of examples:
2222

23-
Given the input 3, the function would return the array
24-
["wink", "double blink"] because 3 is 11 in binary.
23+
Given the decimal input 3, the function would return the array
24+
["wink", "double blink"] because the decimal number 3 is 2+1 in powers of two and thus `11` in binary.
2525

26-
Given the input 19, the function would return the array
27-
["double blink", "wink"] because 19 is 10011 in binary.
28-
Notice that the addition of 16 (10000 in binary)
29-
has caused the array to be reversed.
26+
Let's now examine the input 19 which is 16+2+1 in powers of two and thus `10011` in binary.
27+
Recalling that the addition of 16 (`10000` in binary) reverses an array and that we already know what array is returned given input 3, the array returned for input 19 is ["double blink", "wink"].

0 commit comments

Comments
 (0)