• This is counting 10, 11, and 12 year olds as teenagers. It should start teens at thirteen, or in the instructions mention that 10 - 19 is conisdered a teenager.

  • As it is now, there is no requirement for '!' to be entered as '1'.

  • Now, the text has been edited

  • Thanks for your help, Hobovsky

  • It seems you changed also this part in specification of the function input: "Key - the entered character on the keyboard." , have you? I think it was good before, when it mentioned pressed keys (or buttons). So the function receives input of pressed key (button) and state of modifier keys, and returns an emitted character, because that's (more or less) the task of the function: map a key to a character.

    Other than that, I like the current form more. Let's see what others think about it.

  • I edited the description to your version.

  • And the kata simplifies from scancodes; there's a separate comment for that. I think that simplification is appropriate for the kata.

    That's true, and it's perfectly fine for me too.

    Would you prefer different terms? If so, which ones?

    Just brief ideas, but maybe:

    "Have you ever wondered how a computer handles keyboard key values?" could be "Have you ever wondered how a user interface handles key presses (or key strokes)?"
    "Your task to write a function that return the value of the pressed key." could be "Your task to write a function that returns the entered character.", or "[...] the character resulting from the performed keypress." or something like this?

  • I tried to make the difference between the "marking" and the "value" of a key; I think that't the crux.

    Would you prefer different terms? If so, which ones?

    And the kata simplifies from scancodes; there's a separate comment for that. I think that simplification is appropriate for the kata.

  • In case of in it depends on data structure. Hashmap based set and dict don't iterate items (unless everything has the same hash which is extremely unlikely), but list and tuple do.

    Either author should specify that blatant for shouldn't be used or add tests accodringly to your' suggestion.

  • These are input characters. Shift+1 is interpreted as ! only by receivers who understand input organized as characters. And I think it's a bit of oversimplificaton to call a received character "a current value of a pressed key", because there's a whole layer missing between a key press and a character, and "value of a key" does not even make sense. The closest thing one might consider a value of a key would be its key code (virtual key code on Windows, or maybe a scan code if you operate on such a low level), and ! is definitely not this. Modifier keys do not change "values" of other keys.

    To be clear, I do not want to fight about any technicalities or go into details of the long path between user's fingers and contents of a text box, it's not my goal. I simply object against calling '!', or 'a', or 'A', as "current value of a key", because I think it's not precise and ambiguous.

  • As I said, pretty minimal tediousness. I didn't even bother copy/pasting that, I just typed it in. ( But I have the correct keyboard for that. )

    I don't agree with the author that transforming the description strings to a usable dictionary ( or something similar ) is the meat of the kata, but I think it's a little over the top to insist on receiving a dictionary for free, especially when there are multiple other, and sometimes simpler, methods to do the transformation.

    I think the kata has other, bigger, issues than that.

  • This comment is hidden because it contains spoiler information about the solution

  • 'a' or 'A', mutatis mutandis.

  • I actually do not understand what is "current value of a key". What is a valua of a key? I see this ambiguous.

  • Not fully. Also, it would remove some of the tediousness, but I think that's pretty minimal anyway. You can copy the strings from the existing description, and you don't have to use a dict; you can use less tedious methods to transform a key.

  • Loading more items...