exercism/typescript

Instructions for the exercise Secret handshake (typescript exercise #16) are confusing

FrancescoMussi opened this issue · 3 comments

The instructions for the exercise Secret handshake are confusing.

Why 3 (11 in binary) should return ["wink", "double blink"], that is 101 ?
Shouldn't be ["wink", "wink"] ?

Why 19 (10011) should return ["double blink", "wink"], that is 101 ?

   1 = wink
  10 = double blink
 100 = close your eyes
1000 = jump

Given these binary values, in order to combine them, you don't append them to each other, but rather add them together (addition):

  11 = wink + double blink
 101 = wink + close your eyes
1001 = wink + jump

 110 = double blink + close your eyes
1010 = double blink + jump
 
 111 = wink + double blink + close your eyes
1011 = wink + double blink + jump

1111 = wink + double blink + close your eyes + jump

The idea is that you look at a number in its binary representation (e.g. 1011) and determine which things to do:

1011
||||
|||\_ indicates should wink
||\__ indicates should double blink
|\___ indicates should NOT close your eyes
\____ indicates should jump

Thanks for the clarification!
Now it's much more clear.

Probably it can be helpful to add this extra info to the exercise instructions, to help understand better the requirements.

That's something you could suggest in https://github.com/exercism/problem-specifications. The content for this exercise comes from there!