How long does it take to type this?Tips for golfing in 05AB1ELenient typing testPrint the fingering for the note on a saxophoneFind the Shortest Swype PathOutput optimal trill fingeringsProgram touch-tone instructions for my fingersWhat is the “Ant-Difficulty” of this string?Determine the “Luck” of a stringGenerate Menu Access KeysHow many times should I press this?Should this identifier be suggested?

Can a creature tell when it has been affected by a Divination wizard's Portent?

Why do Ichisongas hate elephants and hippos?

Stark VS Thanos

Sci-fi novel series with instant travel between planets through gates. A river runs through the gates

How can Republicans who favour free markets, consistently express anger when they don't like the outcome of that choice?

Is it possible to measure lightning discharges as Nikola Tesla?

How deep to place a deadman anchor for a slackline?

Why is the origin of “threshold” uncertain?

Do I have an "anti-research" personality?

TikZ how to make supply and demand arrows for nodes?

Will tsunami waves travel forever if there was no land?

gnu parallel how to use with ffmpeg

Packing rectangles: Does rotation ever help?

Python "triplet" dictionary?

How to back up a running remote server?

How to figure out whether the data is sample data or population data apart from the client's information?

Is creating your own "experiment" considered cheating during a physics exam?

What's the metal clinking sound at the end of credits in Avengers: Endgame?

When India mathematicians did know Euclid's Elements?

Reverse the word in a string with the same order in javascript

Feels like I am getting dragged in office politics

Cannot populate data in lightning data table

Advice on laptop battery life

How to replace the "space symbol" (squat-u) in listings?



How long does it take to type this?


Tips for golfing in 05AB1ELenient typing testPrint the fingering for the note on a saxophoneFind the Shortest Swype PathOutput optimal trill fingeringsProgram touch-tone instructions for my fingersWhat is the “Ant-Difficulty” of this string?Determine the “Luck” of a stringGenerate Menu Access KeysHow many times should I press this?Should this identifier be suggested?













10












$begingroup$


Introduction



I can type at a moderate pace, using the QWERTY keyboard layout. But if a word like yellowwooddoor has a ton of repeated letters, it takes a bit longer to type it. Even worse is when a word like "jump" has the same finger used for multiple different consecutive letters.



Here's how long it takes me to type letters on each finger (very unscientifically measured):



Columns are Finger name, keystrokes/second, seconds/keystroke, and the keys used by each finger



Typing same letter twice: 
L Pinky 5.2 0.1923076923 1qaz
L Ring 5 0.2 2wsx
L Mid 5.3 0.1886792453 3edc
L Index 5.5 0.1818181818 4rfv5tgb
R Thumb 6.5 0.1538461538 [space]
R Index 6.9 0.1449275362 6yhn7ujm
R Mid 6.3 0.1587301587 8ik,
R Ring 6.2 0.1612903226 9ol.
R Pinky 6.1 0.1639344262 0p;'

Typing different letter on same finger:
L Pinky 4.6 0.2173913043
L Ring 4.6 0.2173913043
L Mid 4.5 0.2222222222
L Index 5.3 0.1886792453
R Index 5.4 0.1851851852
R Mid 5.1 0.1960784314
R Ring 5.2 0.1923076923
R Pinky 5.2 0.1923076923


Same data in CSV format.



It takes



.75 * (first_finger_same_letter_time + second_finger_same_letter_time) / 2


time to switch between two fingers.



Challenge



Given a string as input, how long does it take to type it?



  • The "timer" starts the moment the first key is pressed and ends when the last key is pressed. You are just counting the time between keypresses.

  • This is code-golf. Shortest answer in bytes wins.

  • Submission can be either a complete program or function.

  • Input and output any way you want it, stdin/out, function params, file, doesn't matter.

  • Output should be accurate to at least 3 decimal places (+/- 0.001 for rounding error is fine). Leading 0. for numbers under 1 and trailing newline optional.

  • Input will be a string that contains (lowercase) a-z, 0-9, space, semicolon, comma, period, and apostrophe.

  • I always type spaces with my right thumb.

  • I use the normal touch typing fingers (you can also look at the above table for finger-key mappings).

  • Reference code used to generate test cases

Test cases



(empty string or any one-character string) - 0.000



aa - 0.192



fff - 0.364



fj - 0.123



the quick brown fox jumped over the lazy dog - 5.795



yellowwooddoor - 1.983



orangewooddoor - 1.841



jump on it, jump on it - 2.748



type on it, type on it - 2.549



abcdefghijklmnopqrstuvwxyz01234567890 ;,.' - 5.746



ok, this may not be the most accurate but it's in the ballpark, maybe within 30 percent or so. - 12.138










share|improve this question











$endgroup$











  • $begingroup$
    Can we assume the input will be at least 2 character, or do we need to output 0 if the input is empty or a single character?
    $endgroup$
    – Kevin Cruijssen
    Apr 8 at 15:53










  • $begingroup$
    There are already a few answers that do handle it, so not going to change the rules halfway through
    $endgroup$
    – Daniel M.
    Apr 8 at 16:01






  • 4




    $begingroup$
    A new type of code golf: Instead of scoring answers based on byte count, the winner is whoever can type their program the fastest.
    $endgroup$
    – 12Me21
    Apr 8 at 16:23















10












$begingroup$


Introduction



I can type at a moderate pace, using the QWERTY keyboard layout. But if a word like yellowwooddoor has a ton of repeated letters, it takes a bit longer to type it. Even worse is when a word like "jump" has the same finger used for multiple different consecutive letters.



Here's how long it takes me to type letters on each finger (very unscientifically measured):



Columns are Finger name, keystrokes/second, seconds/keystroke, and the keys used by each finger



Typing same letter twice: 
L Pinky 5.2 0.1923076923 1qaz
L Ring 5 0.2 2wsx
L Mid 5.3 0.1886792453 3edc
L Index 5.5 0.1818181818 4rfv5tgb
R Thumb 6.5 0.1538461538 [space]
R Index 6.9 0.1449275362 6yhn7ujm
R Mid 6.3 0.1587301587 8ik,
R Ring 6.2 0.1612903226 9ol.
R Pinky 6.1 0.1639344262 0p;'

Typing different letter on same finger:
L Pinky 4.6 0.2173913043
L Ring 4.6 0.2173913043
L Mid 4.5 0.2222222222
L Index 5.3 0.1886792453
R Index 5.4 0.1851851852
R Mid 5.1 0.1960784314
R Ring 5.2 0.1923076923
R Pinky 5.2 0.1923076923


Same data in CSV format.



It takes



.75 * (first_finger_same_letter_time + second_finger_same_letter_time) / 2


time to switch between two fingers.



Challenge



Given a string as input, how long does it take to type it?



  • The "timer" starts the moment the first key is pressed and ends when the last key is pressed. You are just counting the time between keypresses.

  • This is code-golf. Shortest answer in bytes wins.

  • Submission can be either a complete program or function.

  • Input and output any way you want it, stdin/out, function params, file, doesn't matter.

  • Output should be accurate to at least 3 decimal places (+/- 0.001 for rounding error is fine). Leading 0. for numbers under 1 and trailing newline optional.

  • Input will be a string that contains (lowercase) a-z, 0-9, space, semicolon, comma, period, and apostrophe.

  • I always type spaces with my right thumb.

  • I use the normal touch typing fingers (you can also look at the above table for finger-key mappings).

  • Reference code used to generate test cases

Test cases



(empty string or any one-character string) - 0.000



aa - 0.192



fff - 0.364



fj - 0.123



the quick brown fox jumped over the lazy dog - 5.795



yellowwooddoor - 1.983



orangewooddoor - 1.841



jump on it, jump on it - 2.748



type on it, type on it - 2.549



abcdefghijklmnopqrstuvwxyz01234567890 ;,.' - 5.746



ok, this may not be the most accurate but it's in the ballpark, maybe within 30 percent or so. - 12.138










share|improve this question











$endgroup$











  • $begingroup$
    Can we assume the input will be at least 2 character, or do we need to output 0 if the input is empty or a single character?
    $endgroup$
    – Kevin Cruijssen
    Apr 8 at 15:53










  • $begingroup$
    There are already a few answers that do handle it, so not going to change the rules halfway through
    $endgroup$
    – Daniel M.
    Apr 8 at 16:01






  • 4




    $begingroup$
    A new type of code golf: Instead of scoring answers based on byte count, the winner is whoever can type their program the fastest.
    $endgroup$
    – 12Me21
    Apr 8 at 16:23













10












10








10





$begingroup$


Introduction



I can type at a moderate pace, using the QWERTY keyboard layout. But if a word like yellowwooddoor has a ton of repeated letters, it takes a bit longer to type it. Even worse is when a word like "jump" has the same finger used for multiple different consecutive letters.



Here's how long it takes me to type letters on each finger (very unscientifically measured):



Columns are Finger name, keystrokes/second, seconds/keystroke, and the keys used by each finger



Typing same letter twice: 
L Pinky 5.2 0.1923076923 1qaz
L Ring 5 0.2 2wsx
L Mid 5.3 0.1886792453 3edc
L Index 5.5 0.1818181818 4rfv5tgb
R Thumb 6.5 0.1538461538 [space]
R Index 6.9 0.1449275362 6yhn7ujm
R Mid 6.3 0.1587301587 8ik,
R Ring 6.2 0.1612903226 9ol.
R Pinky 6.1 0.1639344262 0p;'

Typing different letter on same finger:
L Pinky 4.6 0.2173913043
L Ring 4.6 0.2173913043
L Mid 4.5 0.2222222222
L Index 5.3 0.1886792453
R Index 5.4 0.1851851852
R Mid 5.1 0.1960784314
R Ring 5.2 0.1923076923
R Pinky 5.2 0.1923076923


Same data in CSV format.



It takes



.75 * (first_finger_same_letter_time + second_finger_same_letter_time) / 2


time to switch between two fingers.



Challenge



Given a string as input, how long does it take to type it?



  • The "timer" starts the moment the first key is pressed and ends when the last key is pressed. You are just counting the time between keypresses.

  • This is code-golf. Shortest answer in bytes wins.

  • Submission can be either a complete program or function.

  • Input and output any way you want it, stdin/out, function params, file, doesn't matter.

  • Output should be accurate to at least 3 decimal places (+/- 0.001 for rounding error is fine). Leading 0. for numbers under 1 and trailing newline optional.

  • Input will be a string that contains (lowercase) a-z, 0-9, space, semicolon, comma, period, and apostrophe.

  • I always type spaces with my right thumb.

  • I use the normal touch typing fingers (you can also look at the above table for finger-key mappings).

  • Reference code used to generate test cases

Test cases



(empty string or any one-character string) - 0.000



aa - 0.192



fff - 0.364



fj - 0.123



the quick brown fox jumped over the lazy dog - 5.795



yellowwooddoor - 1.983



orangewooddoor - 1.841



jump on it, jump on it - 2.748



type on it, type on it - 2.549



abcdefghijklmnopqrstuvwxyz01234567890 ;,.' - 5.746



ok, this may not be the most accurate but it's in the ballpark, maybe within 30 percent or so. - 12.138










share|improve this question











$endgroup$




Introduction



I can type at a moderate pace, using the QWERTY keyboard layout. But if a word like yellowwooddoor has a ton of repeated letters, it takes a bit longer to type it. Even worse is when a word like "jump" has the same finger used for multiple different consecutive letters.



Here's how long it takes me to type letters on each finger (very unscientifically measured):



Columns are Finger name, keystrokes/second, seconds/keystroke, and the keys used by each finger



Typing same letter twice: 
L Pinky 5.2 0.1923076923 1qaz
L Ring 5 0.2 2wsx
L Mid 5.3 0.1886792453 3edc
L Index 5.5 0.1818181818 4rfv5tgb
R Thumb 6.5 0.1538461538 [space]
R Index 6.9 0.1449275362 6yhn7ujm
R Mid 6.3 0.1587301587 8ik,
R Ring 6.2 0.1612903226 9ol.
R Pinky 6.1 0.1639344262 0p;'

Typing different letter on same finger:
L Pinky 4.6 0.2173913043
L Ring 4.6 0.2173913043
L Mid 4.5 0.2222222222
L Index 5.3 0.1886792453
R Index 5.4 0.1851851852
R Mid 5.1 0.1960784314
R Ring 5.2 0.1923076923
R Pinky 5.2 0.1923076923


Same data in CSV format.



It takes



.75 * (first_finger_same_letter_time + second_finger_same_letter_time) / 2


time to switch between two fingers.



Challenge



Given a string as input, how long does it take to type it?



  • The "timer" starts the moment the first key is pressed and ends when the last key is pressed. You are just counting the time between keypresses.

  • This is code-golf. Shortest answer in bytes wins.

  • Submission can be either a complete program or function.

  • Input and output any way you want it, stdin/out, function params, file, doesn't matter.

  • Output should be accurate to at least 3 decimal places (+/- 0.001 for rounding error is fine). Leading 0. for numbers under 1 and trailing newline optional.

  • Input will be a string that contains (lowercase) a-z, 0-9, space, semicolon, comma, period, and apostrophe.

  • I always type spaces with my right thumb.

  • I use the normal touch typing fingers (you can also look at the above table for finger-key mappings).

  • Reference code used to generate test cases

Test cases



(empty string or any one-character string) - 0.000



aa - 0.192



fff - 0.364



fj - 0.123



the quick brown fox jumped over the lazy dog - 5.795



yellowwooddoor - 1.983



orangewooddoor - 1.841



jump on it, jump on it - 2.748



type on it, type on it - 2.549



abcdefghijklmnopqrstuvwxyz01234567890 ;,.' - 5.746



ok, this may not be the most accurate but it's in the ballpark, maybe within 30 percent or so. - 12.138







code-golf string number






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Apr 7 at 16:38







Daniel M.

















asked Apr 7 at 14:12









Daniel M.Daniel M.

2,01111937




2,01111937











  • $begingroup$
    Can we assume the input will be at least 2 character, or do we need to output 0 if the input is empty or a single character?
    $endgroup$
    – Kevin Cruijssen
    Apr 8 at 15:53










  • $begingroup$
    There are already a few answers that do handle it, so not going to change the rules halfway through
    $endgroup$
    – Daniel M.
    Apr 8 at 16:01






  • 4




    $begingroup$
    A new type of code golf: Instead of scoring answers based on byte count, the winner is whoever can type their program the fastest.
    $endgroup$
    – 12Me21
    Apr 8 at 16:23
















  • $begingroup$
    Can we assume the input will be at least 2 character, or do we need to output 0 if the input is empty or a single character?
    $endgroup$
    – Kevin Cruijssen
    Apr 8 at 15:53










  • $begingroup$
    There are already a few answers that do handle it, so not going to change the rules halfway through
    $endgroup$
    – Daniel M.
    Apr 8 at 16:01






  • 4




    $begingroup$
    A new type of code golf: Instead of scoring answers based on byte count, the winner is whoever can type their program the fastest.
    $endgroup$
    – 12Me21
    Apr 8 at 16:23















$begingroup$
Can we assume the input will be at least 2 character, or do we need to output 0 if the input is empty or a single character?
$endgroup$
– Kevin Cruijssen
Apr 8 at 15:53




$begingroup$
Can we assume the input will be at least 2 character, or do we need to output 0 if the input is empty or a single character?
$endgroup$
– Kevin Cruijssen
Apr 8 at 15:53












$begingroup$
There are already a few answers that do handle it, so not going to change the rules halfway through
$endgroup$
– Daniel M.
Apr 8 at 16:01




$begingroup$
There are already a few answers that do handle it, so not going to change the rules halfway through
$endgroup$
– Daniel M.
Apr 8 at 16:01




4




4




$begingroup$
A new type of code golf: Instead of scoring answers based on byte count, the winner is whoever can type their program the fastest.
$endgroup$
– 12Me21
Apr 8 at 16:23




$begingroup$
A new type of code golf: Instead of scoring answers based on byte count, the winner is whoever can type their program the fastest.
$endgroup$
– 12Me21
Apr 8 at 16:23










3 Answers
3






active

oldest

votes


















7












$begingroup$


JavaScript (Node.js), 180 bytes





s=>(B=Buffer)(s).map(p=c=>(b='23841410645532207643205431765001333746443'[c*45%91%73%41]*2,t+=1/p?p-b?3/8*(g(b)+g(p)):g(b|c!=s):0,p=b,s=c),t=0,g=x=>10/B('4.2.5-75E6?3>4=4AA')[x])&&t


Try it online!



How?



Storing delays



The helper function $g$ takes an integer $0le x le17$ and returns a delay in seconds.



g = x => 10 / Buffer('4.2.5-75E6?3>4=4AA')[x]


The input $x$ is expected to be either:



  • twice the bin number to get the delay for the same letter

  • twice the bin number + 1 to get the delay for different letters

What is actually stored in the string '4.2.5-75E6?3>4=4AA' is the number of keystrokes per second multiplied by $10$ and converted to ASCII. Conveniently, all resulting characters are printable.



For instance, $5.2$ is stored as chr(52) which is '4'.



Converting a character to a key bin



We use the following hash function to convert an ASCII code $c$ to an index into a lookup table containing the bin numbers in $[0..8]$:



$$i = (((ctimes 45) bmod 91)bmod 73)bmod 41$$



Main loop



The total time $t$ is updated with:



t += // add to t:
1 / p ? // if p is numeric:
p - b ? // if p is not equal to b:
3 / 8 * (g(b) + g(p)) // 0.75 * (g(b) + g(p)) / 2
: // else:
g(b | c != s) // g(b) if c == s or g(b + 1) otherwise
: // else (first iteration):
0 // leave t unchanged


where $p$ is the previous bin and $s$ is the previous character.






share|improve this answer











$endgroup$




















    4












    $begingroup$


    Jelly, 78 bytes



    “bk¶ŀqṣṁq*E’b25+45s2
    Øq;"““;“,.'”Zṙ-ØD;"s2ẎW$€3,4¦ẎœiⱮQḢ€ị¢QƑịZƊQ3.75⁵Ḋ?÷$SµƝS


    Try it online!



    How?



    “...’b25+45s2 - Link 1, keystrokes per 10 seconds: no arguments
    “...’ - base 250 integer = 379310849477441257135820
    b25 - to base 25 = [16,7,7,1,5,1,8,0,10,8,24,9,18,6,17,7,20]
    +45 - add 45 = [61,52,52,46,50,46,53,45,55,53,69,54,63,51,62,52,65]
    s2 - split into twos
    - = [[61,52],[52,46],[50,46],[53,45],[55,53],[69,54],[63,51],[62,52],[65]]
    - For: 0... 1... 2... 3... 4... 6... 8... 9... space

    Øq;"““;“,.'”Zṙ-ØD;"s2ẎW$€3,4¦ẎœiⱮQḢ€ị¢QƑịZƊQ3.75⁵Ḋ?÷$SµƝS - Main Link: list of characters
    µƝ - for each neighbouring pair:
    Øq - qwerty = ["qwertyuiop","asdfghjkl","zxcvbnm"]
    ““;“,.'” - list of lists = ["",";",",.'"]
    " - zip with:
    ; - concatenate = ["qwertyuiop","asdfghjkl;","zxcvbnm,.'"]
    Z - transpose = ["qaz","wsx","edc","rfv","tgb","yhn","ujm","ik,","ol.","p;'"]
    ṙ- - rotate left -1 = ["p;'","qaz","wsx","edc","rfv","tgb","yhn","ujm","ik,","ol."]
    ØD - digits = "0123456789"
    " - zip with:
    ; - concatenate = ["0p;'","1qaz","2wsx","3edc","4rfv","5tgb","6yhn","7ujm","8ik,","9ol."]
    s2 - split into twos = [["0p;'","1qaz"],["2wsx","3edc"],["4rfv","5tgb"],["6yhn","7ujm"],["8ik,","9ol."]]
    ¦ - sparse application...
    3,4 - ...to indices: [3,4]
    $€ - ...do: last two links as a monad for each:
    Ẏ - tighten
    W - wrap in a list = [["0p;'","1qaz"],["2wsx","3edc"],["4rfv5tgb"],["6yhn7ujm"],["8ik,","9ol."]]
    Ẏ - tighten = ["0p;'","1qaz","2wsx","3edc","4rfv5tgb","6yhn7ujm","8ik,","9ol."]
    Q - de-duplicate (the neighbouring letters)
    Ɱ - map with:
    œi - multi-dimensional index-into e.g. "fj" -> [[5,3],[6,7]]
    - (note <space> is not there so yields an empty list)
    Ḣ€ - head of each -> [5,6]
    - (...and the head of an empty list is 0)
    ¢ - call the last Link (1) as a nilad
    ị - index-into -> [[55,53],[69,54]]
    - (...and 0 indexes into the rightmost entry)
    Ɗ - last three links as a monad:
    Ƒ - invariant under?:
    Q - de-duplicate (1 if so, else 0)
    Z - transpose -> [[55,69],[53,54]]
    ị - index-into -> [55,69]
    Q - de-duplicate -> [55,69]
    $ - last two links as a monad:
    ? - if...
    Ḋ - ...condition: dequeue
    3.75 - ...then: 3.75
    ⁵ - ...else: 10 -> 3.75
    ÷ - divide -> [0.06818181818181818,0.05434782608695652]
    S - sum -> 0.12252964426877469
    S - sum





    share|improve this answer











    $endgroup$




















      2












      $begingroup$


      05AB1E, 92 86 bytes



      Îü)v•δ'ā∍ë*8U¾Ã•₂в45+2ô9ÝÀžV€Sζ‚ø˜ð",.;'"S.;ykD4/ïD3›-D4›-‚©θ讀ËOUεXè}T/zX_iO3*8/ëθ]O


      Try it online or verify all test cases.



      Explanation:





      Î # Push 0 and the input-string
      ü) # Create all pairs of the (implicit) input-string
      # (which will be [] if the input-string is of length 0 or 1)
      # i.e. "ab d" → ["a","b"],["b"," "],[" ","d"]]
      v # Loop over these pairs `y`:
      •δ'ā∍ë*8U¾Ã• '# Push compressed integer 307264255556527588774514
      ₂в # Converted to Base-26 as list: [7,1,5,1,8,0,10,8,24,9,18,6,17,7,16,7,20]
      45+ # Add 45 to each: [52,46,50,46,53,45,55,53,69,54,63,51,62,52,61,52,65]
      2ô # Split into parts of size 2: [[52,46],[50,46],[53,45],[55,53],[69,54],[63,51],[62,52],[61,52],[65]]
      9Ý # Push list [0,1,2,3,4,5,6,7,8,9]
      À # Rotate it once to [1,2,3,4,5,6,7,8,9,0]
      žV # Push builtin ["qwertyuiop","asdfghjkl","zxcvbnm"]
      €S # Convert each to a list of characters
      ζ # Zip/transpose; swapping rows/columns, with space as default filler:
      # [["q","a","z"],["w","s","x"],["e","d","c"],["r","f","v"],["t","g","b"],["y","h","n"],["u","j","m"],["i","k"," "],["o","l"," "],["p"," "," "]]
      ‚ø # Pair it with the digit list, and zip/transpose again
      ˜ # Then flatten this entire list:
      # ["1","q","a","z","2","w","s","x","3","e","d","c","4","r","f","v","5","t","g","b","6","y","h","n","7","u","j","m","8","i","k"," ","9","o","l"," ","0","p"," "," "]
      ð",.;'"S.;
      # Replace the four spaces with [",", ".", ";", "'"] in order
      yk # Get the indices of the characters in the pair `y` in this list
      # i.e. ["b"," "] → [19,-1]
      4/ # Divide both by 4
      # i.e. [19,-1] → [4.75,-0.25]
      ï # Floor the decimals to integers
      # i.e. [4.75,-0.25] → [4,-1]
      D3›- # If an index is larger than 3: decrease it by 1
      # i.e. [4,-1] → [3,-1]
      D4›- # If an index is now larger than 4: decrease it by 1 again
      D ‚ # Pair it with the original index
      # i.e. [[19,-1],[3,-1]]
      © # And save it in the register (without popping)
      θè # Then use the last of the two to index into the list of pairs
      # i.e. [3,-1] → [[55,53],[65]]
      ®€Ë # Check for each pair in the register if they're equal
      # i.e. [[19,-1],[3,-1]] → [0,0]
      O # Take the sum of that
      U # And pop and store it in variable `X`
      ε } # Map the pairs in the list to:
      Xè # The `X`'th value in the pair
      # i.e. [[55,53],[65]] and `X`=0 → [55,65]
      T/ # Divide each by 10
      # i.e. [55,65] → [5.5,6.5]
      z # And take 1/value for each
      # i.e. [5.5,6.5] → [0.181...,0.153...]
      X_i # If variable `X` was 0:
      O # Take the sum of these decimal values
      # i.e. [0.181...,0.153...] → 0.335...
      3*8/ # Multiply it by 3, and then divide it by 8
      # i.e. 0.335... → 0.125...
      ë # Else:
      θ # Pop the pair of decimal values, and only leave the last one
      ] # Close both the if-else statement and the loop
      O # And take the sum of the stack
      # (which is output implicitly as result)


      See this 05AB1E tip of mine (sections How to compress large integers? and How to compress integer lists?) to understand why •δ'ā∍ë*8U¾Ã• is 307264255556527588774514 and •δ'ā∍ë*8U¾Ã•₂в is [7,1,5,1,8,0,10,8,24,9,18,6,17,7,16,7,20].






      share|improve this answer











      $endgroup$













        Your Answer






        StackExchange.ifUsing("editor", function ()
        StackExchange.using("externalEditor", function ()
        StackExchange.using("snippets", function ()
        StackExchange.snippets.init();
        );
        );
        , "code-snippets");

        StackExchange.ready(function()
        var channelOptions =
        tags: "".split(" "),
        id: "200"
        ;
        initTagRenderer("".split(" "), "".split(" "), channelOptions);

        StackExchange.using("externalEditor", function()
        // Have to fire editor after snippets, if snippets enabled
        if (StackExchange.settings.snippets.snippetsEnabled)
        StackExchange.using("snippets", function()
        createEditor();
        );

        else
        createEditor();

        );

        function createEditor()
        StackExchange.prepareEditor(
        heartbeatType: 'answer',
        autoActivateHeartbeat: false,
        convertImagesToLinks: false,
        noModals: true,
        showLowRepImageUploadWarning: true,
        reputationToPostImages: null,
        bindNavPrevention: true,
        postfix: "",
        imageUploader:
        brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
        contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
        allowUrls: true
        ,
        onDemand: true,
        discardSelector: ".discard-answer"
        ,immediatelyShowMarkdownHelp:true
        );



        );













        draft saved

        draft discarded


















        StackExchange.ready(
        function ()
        StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcodegolf.stackexchange.com%2fquestions%2f182782%2fhow-long-does-it-take-to-type-this%23new-answer', 'question_page');

        );

        Post as a guest















        Required, but never shown

























        3 Answers
        3






        active

        oldest

        votes








        3 Answers
        3






        active

        oldest

        votes









        active

        oldest

        votes






        active

        oldest

        votes









        7












        $begingroup$


        JavaScript (Node.js), 180 bytes





        s=>(B=Buffer)(s).map(p=c=>(b='23841410645532207643205431765001333746443'[c*45%91%73%41]*2,t+=1/p?p-b?3/8*(g(b)+g(p)):g(b|c!=s):0,p=b,s=c),t=0,g=x=>10/B('4.2.5-75E6?3>4=4AA')[x])&&t


        Try it online!



        How?



        Storing delays



        The helper function $g$ takes an integer $0le x le17$ and returns a delay in seconds.



        g = x => 10 / Buffer('4.2.5-75E6?3>4=4AA')[x]


        The input $x$ is expected to be either:



        • twice the bin number to get the delay for the same letter

        • twice the bin number + 1 to get the delay for different letters

        What is actually stored in the string '4.2.5-75E6?3>4=4AA' is the number of keystrokes per second multiplied by $10$ and converted to ASCII. Conveniently, all resulting characters are printable.



        For instance, $5.2$ is stored as chr(52) which is '4'.



        Converting a character to a key bin



        We use the following hash function to convert an ASCII code $c$ to an index into a lookup table containing the bin numbers in $[0..8]$:



        $$i = (((ctimes 45) bmod 91)bmod 73)bmod 41$$



        Main loop



        The total time $t$ is updated with:



        t += // add to t:
        1 / p ? // if p is numeric:
        p - b ? // if p is not equal to b:
        3 / 8 * (g(b) + g(p)) // 0.75 * (g(b) + g(p)) / 2
        : // else:
        g(b | c != s) // g(b) if c == s or g(b + 1) otherwise
        : // else (first iteration):
        0 // leave t unchanged


        where $p$ is the previous bin and $s$ is the previous character.






        share|improve this answer











        $endgroup$

















          7












          $begingroup$


          JavaScript (Node.js), 180 bytes





          s=>(B=Buffer)(s).map(p=c=>(b='23841410645532207643205431765001333746443'[c*45%91%73%41]*2,t+=1/p?p-b?3/8*(g(b)+g(p)):g(b|c!=s):0,p=b,s=c),t=0,g=x=>10/B('4.2.5-75E6?3>4=4AA')[x])&&t


          Try it online!



          How?



          Storing delays



          The helper function $g$ takes an integer $0le x le17$ and returns a delay in seconds.



          g = x => 10 / Buffer('4.2.5-75E6?3>4=4AA')[x]


          The input $x$ is expected to be either:



          • twice the bin number to get the delay for the same letter

          • twice the bin number + 1 to get the delay for different letters

          What is actually stored in the string '4.2.5-75E6?3>4=4AA' is the number of keystrokes per second multiplied by $10$ and converted to ASCII. Conveniently, all resulting characters are printable.



          For instance, $5.2$ is stored as chr(52) which is '4'.



          Converting a character to a key bin



          We use the following hash function to convert an ASCII code $c$ to an index into a lookup table containing the bin numbers in $[0..8]$:



          $$i = (((ctimes 45) bmod 91)bmod 73)bmod 41$$



          Main loop



          The total time $t$ is updated with:



          t += // add to t:
          1 / p ? // if p is numeric:
          p - b ? // if p is not equal to b:
          3 / 8 * (g(b) + g(p)) // 0.75 * (g(b) + g(p)) / 2
          : // else:
          g(b | c != s) // g(b) if c == s or g(b + 1) otherwise
          : // else (first iteration):
          0 // leave t unchanged


          where $p$ is the previous bin and $s$ is the previous character.






          share|improve this answer











          $endgroup$















            7












            7








            7





            $begingroup$


            JavaScript (Node.js), 180 bytes





            s=>(B=Buffer)(s).map(p=c=>(b='23841410645532207643205431765001333746443'[c*45%91%73%41]*2,t+=1/p?p-b?3/8*(g(b)+g(p)):g(b|c!=s):0,p=b,s=c),t=0,g=x=>10/B('4.2.5-75E6?3>4=4AA')[x])&&t


            Try it online!



            How?



            Storing delays



            The helper function $g$ takes an integer $0le x le17$ and returns a delay in seconds.



            g = x => 10 / Buffer('4.2.5-75E6?3>4=4AA')[x]


            The input $x$ is expected to be either:



            • twice the bin number to get the delay for the same letter

            • twice the bin number + 1 to get the delay for different letters

            What is actually stored in the string '4.2.5-75E6?3>4=4AA' is the number of keystrokes per second multiplied by $10$ and converted to ASCII. Conveniently, all resulting characters are printable.



            For instance, $5.2$ is stored as chr(52) which is '4'.



            Converting a character to a key bin



            We use the following hash function to convert an ASCII code $c$ to an index into a lookup table containing the bin numbers in $[0..8]$:



            $$i = (((ctimes 45) bmod 91)bmod 73)bmod 41$$



            Main loop



            The total time $t$ is updated with:



            t += // add to t:
            1 / p ? // if p is numeric:
            p - b ? // if p is not equal to b:
            3 / 8 * (g(b) + g(p)) // 0.75 * (g(b) + g(p)) / 2
            : // else:
            g(b | c != s) // g(b) if c == s or g(b + 1) otherwise
            : // else (first iteration):
            0 // leave t unchanged


            where $p$ is the previous bin and $s$ is the previous character.






            share|improve this answer











            $endgroup$




            JavaScript (Node.js), 180 bytes





            s=>(B=Buffer)(s).map(p=c=>(b='23841410645532207643205431765001333746443'[c*45%91%73%41]*2,t+=1/p?p-b?3/8*(g(b)+g(p)):g(b|c!=s):0,p=b,s=c),t=0,g=x=>10/B('4.2.5-75E6?3>4=4AA')[x])&&t


            Try it online!



            How?



            Storing delays



            The helper function $g$ takes an integer $0le x le17$ and returns a delay in seconds.



            g = x => 10 / Buffer('4.2.5-75E6?3>4=4AA')[x]


            The input $x$ is expected to be either:



            • twice the bin number to get the delay for the same letter

            • twice the bin number + 1 to get the delay for different letters

            What is actually stored in the string '4.2.5-75E6?3>4=4AA' is the number of keystrokes per second multiplied by $10$ and converted to ASCII. Conveniently, all resulting characters are printable.



            For instance, $5.2$ is stored as chr(52) which is '4'.



            Converting a character to a key bin



            We use the following hash function to convert an ASCII code $c$ to an index into a lookup table containing the bin numbers in $[0..8]$:



            $$i = (((ctimes 45) bmod 91)bmod 73)bmod 41$$



            Main loop



            The total time $t$ is updated with:



            t += // add to t:
            1 / p ? // if p is numeric:
            p - b ? // if p is not equal to b:
            3 / 8 * (g(b) + g(p)) // 0.75 * (g(b) + g(p)) / 2
            : // else:
            g(b | c != s) // g(b) if c == s or g(b + 1) otherwise
            : // else (first iteration):
            0 // leave t unchanged


            where $p$ is the previous bin and $s$ is the previous character.







            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Apr 7 at 17:15

























            answered Apr 7 at 16:13









            ArnauldArnauld

            82.4k798339




            82.4k798339





















                4












                $begingroup$


                Jelly, 78 bytes



                “bk¶ŀqṣṁq*E’b25+45s2
                Øq;"““;“,.'”Zṙ-ØD;"s2ẎW$€3,4¦ẎœiⱮQḢ€ị¢QƑịZƊQ3.75⁵Ḋ?÷$SµƝS


                Try it online!



                How?



                “...’b25+45s2 - Link 1, keystrokes per 10 seconds: no arguments
                “...’ - base 250 integer = 379310849477441257135820
                b25 - to base 25 = [16,7,7,1,5,1,8,0,10,8,24,9,18,6,17,7,20]
                +45 - add 45 = [61,52,52,46,50,46,53,45,55,53,69,54,63,51,62,52,65]
                s2 - split into twos
                - = [[61,52],[52,46],[50,46],[53,45],[55,53],[69,54],[63,51],[62,52],[65]]
                - For: 0... 1... 2... 3... 4... 6... 8... 9... space

                Øq;"““;“,.'”Zṙ-ØD;"s2ẎW$€3,4¦ẎœiⱮQḢ€ị¢QƑịZƊQ3.75⁵Ḋ?÷$SµƝS - Main Link: list of characters
                µƝ - for each neighbouring pair:
                Øq - qwerty = ["qwertyuiop","asdfghjkl","zxcvbnm"]
                ““;“,.'” - list of lists = ["",";",",.'"]
                " - zip with:
                ; - concatenate = ["qwertyuiop","asdfghjkl;","zxcvbnm,.'"]
                Z - transpose = ["qaz","wsx","edc","rfv","tgb","yhn","ujm","ik,","ol.","p;'"]
                ṙ- - rotate left -1 = ["p;'","qaz","wsx","edc","rfv","tgb","yhn","ujm","ik,","ol."]
                ØD - digits = "0123456789"
                " - zip with:
                ; - concatenate = ["0p;'","1qaz","2wsx","3edc","4rfv","5tgb","6yhn","7ujm","8ik,","9ol."]
                s2 - split into twos = [["0p;'","1qaz"],["2wsx","3edc"],["4rfv","5tgb"],["6yhn","7ujm"],["8ik,","9ol."]]
                ¦ - sparse application...
                3,4 - ...to indices: [3,4]
                $€ - ...do: last two links as a monad for each:
                Ẏ - tighten
                W - wrap in a list = [["0p;'","1qaz"],["2wsx","3edc"],["4rfv5tgb"],["6yhn7ujm"],["8ik,","9ol."]]
                Ẏ - tighten = ["0p;'","1qaz","2wsx","3edc","4rfv5tgb","6yhn7ujm","8ik,","9ol."]
                Q - de-duplicate (the neighbouring letters)
                Ɱ - map with:
                œi - multi-dimensional index-into e.g. "fj" -> [[5,3],[6,7]]
                - (note <space> is not there so yields an empty list)
                Ḣ€ - head of each -> [5,6]
                - (...and the head of an empty list is 0)
                ¢ - call the last Link (1) as a nilad
                ị - index-into -> [[55,53],[69,54]]
                - (...and 0 indexes into the rightmost entry)
                Ɗ - last three links as a monad:
                Ƒ - invariant under?:
                Q - de-duplicate (1 if so, else 0)
                Z - transpose -> [[55,69],[53,54]]
                ị - index-into -> [55,69]
                Q - de-duplicate -> [55,69]
                $ - last two links as a monad:
                ? - if...
                Ḋ - ...condition: dequeue
                3.75 - ...then: 3.75
                ⁵ - ...else: 10 -> 3.75
                ÷ - divide -> [0.06818181818181818,0.05434782608695652]
                S - sum -> 0.12252964426877469
                S - sum





                share|improve this answer











                $endgroup$

















                  4












                  $begingroup$


                  Jelly, 78 bytes



                  “bk¶ŀqṣṁq*E’b25+45s2
                  Øq;"““;“,.'”Zṙ-ØD;"s2ẎW$€3,4¦ẎœiⱮQḢ€ị¢QƑịZƊQ3.75⁵Ḋ?÷$SµƝS


                  Try it online!



                  How?



                  “...’b25+45s2 - Link 1, keystrokes per 10 seconds: no arguments
                  “...’ - base 250 integer = 379310849477441257135820
                  b25 - to base 25 = [16,7,7,1,5,1,8,0,10,8,24,9,18,6,17,7,20]
                  +45 - add 45 = [61,52,52,46,50,46,53,45,55,53,69,54,63,51,62,52,65]
                  s2 - split into twos
                  - = [[61,52],[52,46],[50,46],[53,45],[55,53],[69,54],[63,51],[62,52],[65]]
                  - For: 0... 1... 2... 3... 4... 6... 8... 9... space

                  Øq;"““;“,.'”Zṙ-ØD;"s2ẎW$€3,4¦ẎœiⱮQḢ€ị¢QƑịZƊQ3.75⁵Ḋ?÷$SµƝS - Main Link: list of characters
                  µƝ - for each neighbouring pair:
                  Øq - qwerty = ["qwertyuiop","asdfghjkl","zxcvbnm"]
                  ““;“,.'” - list of lists = ["",";",",.'"]
                  " - zip with:
                  ; - concatenate = ["qwertyuiop","asdfghjkl;","zxcvbnm,.'"]
                  Z - transpose = ["qaz","wsx","edc","rfv","tgb","yhn","ujm","ik,","ol.","p;'"]
                  ṙ- - rotate left -1 = ["p;'","qaz","wsx","edc","rfv","tgb","yhn","ujm","ik,","ol."]
                  ØD - digits = "0123456789"
                  " - zip with:
                  ; - concatenate = ["0p;'","1qaz","2wsx","3edc","4rfv","5tgb","6yhn","7ujm","8ik,","9ol."]
                  s2 - split into twos = [["0p;'","1qaz"],["2wsx","3edc"],["4rfv","5tgb"],["6yhn","7ujm"],["8ik,","9ol."]]
                  ¦ - sparse application...
                  3,4 - ...to indices: [3,4]
                  $€ - ...do: last two links as a monad for each:
                  Ẏ - tighten
                  W - wrap in a list = [["0p;'","1qaz"],["2wsx","3edc"],["4rfv5tgb"],["6yhn7ujm"],["8ik,","9ol."]]
                  Ẏ - tighten = ["0p;'","1qaz","2wsx","3edc","4rfv5tgb","6yhn7ujm","8ik,","9ol."]
                  Q - de-duplicate (the neighbouring letters)
                  Ɱ - map with:
                  œi - multi-dimensional index-into e.g. "fj" -> [[5,3],[6,7]]
                  - (note <space> is not there so yields an empty list)
                  Ḣ€ - head of each -> [5,6]
                  - (...and the head of an empty list is 0)
                  ¢ - call the last Link (1) as a nilad
                  ị - index-into -> [[55,53],[69,54]]
                  - (...and 0 indexes into the rightmost entry)
                  Ɗ - last three links as a monad:
                  Ƒ - invariant under?:
                  Q - de-duplicate (1 if so, else 0)
                  Z - transpose -> [[55,69],[53,54]]
                  ị - index-into -> [55,69]
                  Q - de-duplicate -> [55,69]
                  $ - last two links as a monad:
                  ? - if...
                  Ḋ - ...condition: dequeue
                  3.75 - ...then: 3.75
                  ⁵ - ...else: 10 -> 3.75
                  ÷ - divide -> [0.06818181818181818,0.05434782608695652]
                  S - sum -> 0.12252964426877469
                  S - sum





                  share|improve this answer











                  $endgroup$















                    4












                    4








                    4





                    $begingroup$


                    Jelly, 78 bytes



                    “bk¶ŀqṣṁq*E’b25+45s2
                    Øq;"““;“,.'”Zṙ-ØD;"s2ẎW$€3,4¦ẎœiⱮQḢ€ị¢QƑịZƊQ3.75⁵Ḋ?÷$SµƝS


                    Try it online!



                    How?



                    “...’b25+45s2 - Link 1, keystrokes per 10 seconds: no arguments
                    “...’ - base 250 integer = 379310849477441257135820
                    b25 - to base 25 = [16,7,7,1,5,1,8,0,10,8,24,9,18,6,17,7,20]
                    +45 - add 45 = [61,52,52,46,50,46,53,45,55,53,69,54,63,51,62,52,65]
                    s2 - split into twos
                    - = [[61,52],[52,46],[50,46],[53,45],[55,53],[69,54],[63,51],[62,52],[65]]
                    - For: 0... 1... 2... 3... 4... 6... 8... 9... space

                    Øq;"““;“,.'”Zṙ-ØD;"s2ẎW$€3,4¦ẎœiⱮQḢ€ị¢QƑịZƊQ3.75⁵Ḋ?÷$SµƝS - Main Link: list of characters
                    µƝ - for each neighbouring pair:
                    Øq - qwerty = ["qwertyuiop","asdfghjkl","zxcvbnm"]
                    ““;“,.'” - list of lists = ["",";",",.'"]
                    " - zip with:
                    ; - concatenate = ["qwertyuiop","asdfghjkl;","zxcvbnm,.'"]
                    Z - transpose = ["qaz","wsx","edc","rfv","tgb","yhn","ujm","ik,","ol.","p;'"]
                    ṙ- - rotate left -1 = ["p;'","qaz","wsx","edc","rfv","tgb","yhn","ujm","ik,","ol."]
                    ØD - digits = "0123456789"
                    " - zip with:
                    ; - concatenate = ["0p;'","1qaz","2wsx","3edc","4rfv","5tgb","6yhn","7ujm","8ik,","9ol."]
                    s2 - split into twos = [["0p;'","1qaz"],["2wsx","3edc"],["4rfv","5tgb"],["6yhn","7ujm"],["8ik,","9ol."]]
                    ¦ - sparse application...
                    3,4 - ...to indices: [3,4]
                    $€ - ...do: last two links as a monad for each:
                    Ẏ - tighten
                    W - wrap in a list = [["0p;'","1qaz"],["2wsx","3edc"],["4rfv5tgb"],["6yhn7ujm"],["8ik,","9ol."]]
                    Ẏ - tighten = ["0p;'","1qaz","2wsx","3edc","4rfv5tgb","6yhn7ujm","8ik,","9ol."]
                    Q - de-duplicate (the neighbouring letters)
                    Ɱ - map with:
                    œi - multi-dimensional index-into e.g. "fj" -> [[5,3],[6,7]]
                    - (note <space> is not there so yields an empty list)
                    Ḣ€ - head of each -> [5,6]
                    - (...and the head of an empty list is 0)
                    ¢ - call the last Link (1) as a nilad
                    ị - index-into -> [[55,53],[69,54]]
                    - (...and 0 indexes into the rightmost entry)
                    Ɗ - last three links as a monad:
                    Ƒ - invariant under?:
                    Q - de-duplicate (1 if so, else 0)
                    Z - transpose -> [[55,69],[53,54]]
                    ị - index-into -> [55,69]
                    Q - de-duplicate -> [55,69]
                    $ - last two links as a monad:
                    ? - if...
                    Ḋ - ...condition: dequeue
                    3.75 - ...then: 3.75
                    ⁵ - ...else: 10 -> 3.75
                    ÷ - divide -> [0.06818181818181818,0.05434782608695652]
                    S - sum -> 0.12252964426877469
                    S - sum





                    share|improve this answer











                    $endgroup$




                    Jelly, 78 bytes



                    “bk¶ŀqṣṁq*E’b25+45s2
                    Øq;"““;“,.'”Zṙ-ØD;"s2ẎW$€3,4¦ẎœiⱮQḢ€ị¢QƑịZƊQ3.75⁵Ḋ?÷$SµƝS


                    Try it online!



                    How?



                    “...’b25+45s2 - Link 1, keystrokes per 10 seconds: no arguments
                    “...’ - base 250 integer = 379310849477441257135820
                    b25 - to base 25 = [16,7,7,1,5,1,8,0,10,8,24,9,18,6,17,7,20]
                    +45 - add 45 = [61,52,52,46,50,46,53,45,55,53,69,54,63,51,62,52,65]
                    s2 - split into twos
                    - = [[61,52],[52,46],[50,46],[53,45],[55,53],[69,54],[63,51],[62,52],[65]]
                    - For: 0... 1... 2... 3... 4... 6... 8... 9... space

                    Øq;"““;“,.'”Zṙ-ØD;"s2ẎW$€3,4¦ẎœiⱮQḢ€ị¢QƑịZƊQ3.75⁵Ḋ?÷$SµƝS - Main Link: list of characters
                    µƝ - for each neighbouring pair:
                    Øq - qwerty = ["qwertyuiop","asdfghjkl","zxcvbnm"]
                    ““;“,.'” - list of lists = ["",";",",.'"]
                    " - zip with:
                    ; - concatenate = ["qwertyuiop","asdfghjkl;","zxcvbnm,.'"]
                    Z - transpose = ["qaz","wsx","edc","rfv","tgb","yhn","ujm","ik,","ol.","p;'"]
                    ṙ- - rotate left -1 = ["p;'","qaz","wsx","edc","rfv","tgb","yhn","ujm","ik,","ol."]
                    ØD - digits = "0123456789"
                    " - zip with:
                    ; - concatenate = ["0p;'","1qaz","2wsx","3edc","4rfv","5tgb","6yhn","7ujm","8ik,","9ol."]
                    s2 - split into twos = [["0p;'","1qaz"],["2wsx","3edc"],["4rfv","5tgb"],["6yhn","7ujm"],["8ik,","9ol."]]
                    ¦ - sparse application...
                    3,4 - ...to indices: [3,4]
                    $€ - ...do: last two links as a monad for each:
                    Ẏ - tighten
                    W - wrap in a list = [["0p;'","1qaz"],["2wsx","3edc"],["4rfv5tgb"],["6yhn7ujm"],["8ik,","9ol."]]
                    Ẏ - tighten = ["0p;'","1qaz","2wsx","3edc","4rfv5tgb","6yhn7ujm","8ik,","9ol."]
                    Q - de-duplicate (the neighbouring letters)
                    Ɱ - map with:
                    œi - multi-dimensional index-into e.g. "fj" -> [[5,3],[6,7]]
                    - (note <space> is not there so yields an empty list)
                    Ḣ€ - head of each -> [5,6]
                    - (...and the head of an empty list is 0)
                    ¢ - call the last Link (1) as a nilad
                    ị - index-into -> [[55,53],[69,54]]
                    - (...and 0 indexes into the rightmost entry)
                    Ɗ - last three links as a monad:
                    Ƒ - invariant under?:
                    Q - de-duplicate (1 if so, else 0)
                    Z - transpose -> [[55,69],[53,54]]
                    ị - index-into -> [55,69]
                    Q - de-duplicate -> [55,69]
                    $ - last two links as a monad:
                    ? - if...
                    Ḋ - ...condition: dequeue
                    3.75 - ...then: 3.75
                    ⁵ - ...else: 10 -> 3.75
                    ÷ - divide -> [0.06818181818181818,0.05434782608695652]
                    S - sum -> 0.12252964426877469
                    S - sum






                    share|improve this answer














                    share|improve this answer



                    share|improve this answer








                    edited Apr 7 at 20:01

























                    answered Apr 7 at 19:54









                    Jonathan AllanJonathan Allan

                    55.1k537176




                    55.1k537176





















                        2












                        $begingroup$


                        05AB1E, 92 86 bytes



                        Îü)v•δ'ā∍ë*8U¾Ã•₂в45+2ô9ÝÀžV€Sζ‚ø˜ð",.;'"S.;ykD4/ïD3›-D4›-‚©θ讀ËOUεXè}T/zX_iO3*8/ëθ]O


                        Try it online or verify all test cases.



                        Explanation:





                        Î # Push 0 and the input-string
                        ü) # Create all pairs of the (implicit) input-string
                        # (which will be [] if the input-string is of length 0 or 1)
                        # i.e. "ab d" → ["a","b"],["b"," "],[" ","d"]]
                        v # Loop over these pairs `y`:
                        •δ'ā∍ë*8U¾Ã• '# Push compressed integer 307264255556527588774514
                        ₂в # Converted to Base-26 as list: [7,1,5,1,8,0,10,8,24,9,18,6,17,7,16,7,20]
                        45+ # Add 45 to each: [52,46,50,46,53,45,55,53,69,54,63,51,62,52,61,52,65]
                        2ô # Split into parts of size 2: [[52,46],[50,46],[53,45],[55,53],[69,54],[63,51],[62,52],[61,52],[65]]
                        9Ý # Push list [0,1,2,3,4,5,6,7,8,9]
                        À # Rotate it once to [1,2,3,4,5,6,7,8,9,0]
                        žV # Push builtin ["qwertyuiop","asdfghjkl","zxcvbnm"]
                        €S # Convert each to a list of characters
                        ζ # Zip/transpose; swapping rows/columns, with space as default filler:
                        # [["q","a","z"],["w","s","x"],["e","d","c"],["r","f","v"],["t","g","b"],["y","h","n"],["u","j","m"],["i","k"," "],["o","l"," "],["p"," "," "]]
                        ‚ø # Pair it with the digit list, and zip/transpose again
                        ˜ # Then flatten this entire list:
                        # ["1","q","a","z","2","w","s","x","3","e","d","c","4","r","f","v","5","t","g","b","6","y","h","n","7","u","j","m","8","i","k"," ","9","o","l"," ","0","p"," "," "]
                        ð",.;'"S.;
                        # Replace the four spaces with [",", ".", ";", "'"] in order
                        yk # Get the indices of the characters in the pair `y` in this list
                        # i.e. ["b"," "] → [19,-1]
                        4/ # Divide both by 4
                        # i.e. [19,-1] → [4.75,-0.25]
                        ï # Floor the decimals to integers
                        # i.e. [4.75,-0.25] → [4,-1]
                        D3›- # If an index is larger than 3: decrease it by 1
                        # i.e. [4,-1] → [3,-1]
                        D4›- # If an index is now larger than 4: decrease it by 1 again
                        D ‚ # Pair it with the original index
                        # i.e. [[19,-1],[3,-1]]
                        © # And save it in the register (without popping)
                        θè # Then use the last of the two to index into the list of pairs
                        # i.e. [3,-1] → [[55,53],[65]]
                        ®€Ë # Check for each pair in the register if they're equal
                        # i.e. [[19,-1],[3,-1]] → [0,0]
                        O # Take the sum of that
                        U # And pop and store it in variable `X`
                        ε } # Map the pairs in the list to:
                        Xè # The `X`'th value in the pair
                        # i.e. [[55,53],[65]] and `X`=0 → [55,65]
                        T/ # Divide each by 10
                        # i.e. [55,65] → [5.5,6.5]
                        z # And take 1/value for each
                        # i.e. [5.5,6.5] → [0.181...,0.153...]
                        X_i # If variable `X` was 0:
                        O # Take the sum of these decimal values
                        # i.e. [0.181...,0.153...] → 0.335...
                        3*8/ # Multiply it by 3, and then divide it by 8
                        # i.e. 0.335... → 0.125...
                        ë # Else:
                        θ # Pop the pair of decimal values, and only leave the last one
                        ] # Close both the if-else statement and the loop
                        O # And take the sum of the stack
                        # (which is output implicitly as result)


                        See this 05AB1E tip of mine (sections How to compress large integers? and How to compress integer lists?) to understand why •δ'ā∍ë*8U¾Ã• is 307264255556527588774514 and •δ'ā∍ë*8U¾Ã•₂в is [7,1,5,1,8,0,10,8,24,9,18,6,17,7,16,7,20].






                        share|improve this answer











                        $endgroup$

















                          2












                          $begingroup$


                          05AB1E, 92 86 bytes



                          Îü)v•δ'ā∍ë*8U¾Ã•₂в45+2ô9ÝÀžV€Sζ‚ø˜ð",.;'"S.;ykD4/ïD3›-D4›-‚©θ讀ËOUεXè}T/zX_iO3*8/ëθ]O


                          Try it online or verify all test cases.



                          Explanation:





                          Î # Push 0 and the input-string
                          ü) # Create all pairs of the (implicit) input-string
                          # (which will be [] if the input-string is of length 0 or 1)
                          # i.e. "ab d" → ["a","b"],["b"," "],[" ","d"]]
                          v # Loop over these pairs `y`:
                          •δ'ā∍ë*8U¾Ã• '# Push compressed integer 307264255556527588774514
                          ₂в # Converted to Base-26 as list: [7,1,5,1,8,0,10,8,24,9,18,6,17,7,16,7,20]
                          45+ # Add 45 to each: [52,46,50,46,53,45,55,53,69,54,63,51,62,52,61,52,65]
                          2ô # Split into parts of size 2: [[52,46],[50,46],[53,45],[55,53],[69,54],[63,51],[62,52],[61,52],[65]]
                          9Ý # Push list [0,1,2,3,4,5,6,7,8,9]
                          À # Rotate it once to [1,2,3,4,5,6,7,8,9,0]
                          žV # Push builtin ["qwertyuiop","asdfghjkl","zxcvbnm"]
                          €S # Convert each to a list of characters
                          ζ # Zip/transpose; swapping rows/columns, with space as default filler:
                          # [["q","a","z"],["w","s","x"],["e","d","c"],["r","f","v"],["t","g","b"],["y","h","n"],["u","j","m"],["i","k"," "],["o","l"," "],["p"," "," "]]
                          ‚ø # Pair it with the digit list, and zip/transpose again
                          ˜ # Then flatten this entire list:
                          # ["1","q","a","z","2","w","s","x","3","e","d","c","4","r","f","v","5","t","g","b","6","y","h","n","7","u","j","m","8","i","k"," ","9","o","l"," ","0","p"," "," "]
                          ð",.;'"S.;
                          # Replace the four spaces with [",", ".", ";", "'"] in order
                          yk # Get the indices of the characters in the pair `y` in this list
                          # i.e. ["b"," "] → [19,-1]
                          4/ # Divide both by 4
                          # i.e. [19,-1] → [4.75,-0.25]
                          ï # Floor the decimals to integers
                          # i.e. [4.75,-0.25] → [4,-1]
                          D3›- # If an index is larger than 3: decrease it by 1
                          # i.e. [4,-1] → [3,-1]
                          D4›- # If an index is now larger than 4: decrease it by 1 again
                          D ‚ # Pair it with the original index
                          # i.e. [[19,-1],[3,-1]]
                          © # And save it in the register (without popping)
                          θè # Then use the last of the two to index into the list of pairs
                          # i.e. [3,-1] → [[55,53],[65]]
                          ®€Ë # Check for each pair in the register if they're equal
                          # i.e. [[19,-1],[3,-1]] → [0,0]
                          O # Take the sum of that
                          U # And pop and store it in variable `X`
                          ε } # Map the pairs in the list to:
                          Xè # The `X`'th value in the pair
                          # i.e. [[55,53],[65]] and `X`=0 → [55,65]
                          T/ # Divide each by 10
                          # i.e. [55,65] → [5.5,6.5]
                          z # And take 1/value for each
                          # i.e. [5.5,6.5] → [0.181...,0.153...]
                          X_i # If variable `X` was 0:
                          O # Take the sum of these decimal values
                          # i.e. [0.181...,0.153...] → 0.335...
                          3*8/ # Multiply it by 3, and then divide it by 8
                          # i.e. 0.335... → 0.125...
                          ë # Else:
                          θ # Pop the pair of decimal values, and only leave the last one
                          ] # Close both the if-else statement and the loop
                          O # And take the sum of the stack
                          # (which is output implicitly as result)


                          See this 05AB1E tip of mine (sections How to compress large integers? and How to compress integer lists?) to understand why •δ'ā∍ë*8U¾Ã• is 307264255556527588774514 and •δ'ā∍ë*8U¾Ã•₂в is [7,1,5,1,8,0,10,8,24,9,18,6,17,7,16,7,20].






                          share|improve this answer











                          $endgroup$















                            2












                            2








                            2





                            $begingroup$


                            05AB1E, 92 86 bytes



                            Îü)v•δ'ā∍ë*8U¾Ã•₂в45+2ô9ÝÀžV€Sζ‚ø˜ð",.;'"S.;ykD4/ïD3›-D4›-‚©θ讀ËOUεXè}T/zX_iO3*8/ëθ]O


                            Try it online or verify all test cases.



                            Explanation:





                            Î # Push 0 and the input-string
                            ü) # Create all pairs of the (implicit) input-string
                            # (which will be [] if the input-string is of length 0 or 1)
                            # i.e. "ab d" → ["a","b"],["b"," "],[" ","d"]]
                            v # Loop over these pairs `y`:
                            •δ'ā∍ë*8U¾Ã• '# Push compressed integer 307264255556527588774514
                            ₂в # Converted to Base-26 as list: [7,1,5,1,8,0,10,8,24,9,18,6,17,7,16,7,20]
                            45+ # Add 45 to each: [52,46,50,46,53,45,55,53,69,54,63,51,62,52,61,52,65]
                            2ô # Split into parts of size 2: [[52,46],[50,46],[53,45],[55,53],[69,54],[63,51],[62,52],[61,52],[65]]
                            9Ý # Push list [0,1,2,3,4,5,6,7,8,9]
                            À # Rotate it once to [1,2,3,4,5,6,7,8,9,0]
                            žV # Push builtin ["qwertyuiop","asdfghjkl","zxcvbnm"]
                            €S # Convert each to a list of characters
                            ζ # Zip/transpose; swapping rows/columns, with space as default filler:
                            # [["q","a","z"],["w","s","x"],["e","d","c"],["r","f","v"],["t","g","b"],["y","h","n"],["u","j","m"],["i","k"," "],["o","l"," "],["p"," "," "]]
                            ‚ø # Pair it with the digit list, and zip/transpose again
                            ˜ # Then flatten this entire list:
                            # ["1","q","a","z","2","w","s","x","3","e","d","c","4","r","f","v","5","t","g","b","6","y","h","n","7","u","j","m","8","i","k"," ","9","o","l"," ","0","p"," "," "]
                            ð",.;'"S.;
                            # Replace the four spaces with [",", ".", ";", "'"] in order
                            yk # Get the indices of the characters in the pair `y` in this list
                            # i.e. ["b"," "] → [19,-1]
                            4/ # Divide both by 4
                            # i.e. [19,-1] → [4.75,-0.25]
                            ï # Floor the decimals to integers
                            # i.e. [4.75,-0.25] → [4,-1]
                            D3›- # If an index is larger than 3: decrease it by 1
                            # i.e. [4,-1] → [3,-1]
                            D4›- # If an index is now larger than 4: decrease it by 1 again
                            D ‚ # Pair it with the original index
                            # i.e. [[19,-1],[3,-1]]
                            © # And save it in the register (without popping)
                            θè # Then use the last of the two to index into the list of pairs
                            # i.e. [3,-1] → [[55,53],[65]]
                            ®€Ë # Check for each pair in the register if they're equal
                            # i.e. [[19,-1],[3,-1]] → [0,0]
                            O # Take the sum of that
                            U # And pop and store it in variable `X`
                            ε } # Map the pairs in the list to:
                            Xè # The `X`'th value in the pair
                            # i.e. [[55,53],[65]] and `X`=0 → [55,65]
                            T/ # Divide each by 10
                            # i.e. [55,65] → [5.5,6.5]
                            z # And take 1/value for each
                            # i.e. [5.5,6.5] → [0.181...,0.153...]
                            X_i # If variable `X` was 0:
                            O # Take the sum of these decimal values
                            # i.e. [0.181...,0.153...] → 0.335...
                            3*8/ # Multiply it by 3, and then divide it by 8
                            # i.e. 0.335... → 0.125...
                            ë # Else:
                            θ # Pop the pair of decimal values, and only leave the last one
                            ] # Close both the if-else statement and the loop
                            O # And take the sum of the stack
                            # (which is output implicitly as result)


                            See this 05AB1E tip of mine (sections How to compress large integers? and How to compress integer lists?) to understand why •δ'ā∍ë*8U¾Ã• is 307264255556527588774514 and •δ'ā∍ë*8U¾Ã•₂в is [7,1,5,1,8,0,10,8,24,9,18,6,17,7,16,7,20].






                            share|improve this answer











                            $endgroup$




                            05AB1E, 92 86 bytes



                            Îü)v•δ'ā∍ë*8U¾Ã•₂в45+2ô9ÝÀžV€Sζ‚ø˜ð",.;'"S.;ykD4/ïD3›-D4›-‚©θ讀ËOUεXè}T/zX_iO3*8/ëθ]O


                            Try it online or verify all test cases.



                            Explanation:





                            Î # Push 0 and the input-string
                            ü) # Create all pairs of the (implicit) input-string
                            # (which will be [] if the input-string is of length 0 or 1)
                            # i.e. "ab d" → ["a","b"],["b"," "],[" ","d"]]
                            v # Loop over these pairs `y`:
                            •δ'ā∍ë*8U¾Ã• '# Push compressed integer 307264255556527588774514
                            ₂в # Converted to Base-26 as list: [7,1,5,1,8,0,10,8,24,9,18,6,17,7,16,7,20]
                            45+ # Add 45 to each: [52,46,50,46,53,45,55,53,69,54,63,51,62,52,61,52,65]
                            2ô # Split into parts of size 2: [[52,46],[50,46],[53,45],[55,53],[69,54],[63,51],[62,52],[61,52],[65]]
                            9Ý # Push list [0,1,2,3,4,5,6,7,8,9]
                            À # Rotate it once to [1,2,3,4,5,6,7,8,9,0]
                            žV # Push builtin ["qwertyuiop","asdfghjkl","zxcvbnm"]
                            €S # Convert each to a list of characters
                            ζ # Zip/transpose; swapping rows/columns, with space as default filler:
                            # [["q","a","z"],["w","s","x"],["e","d","c"],["r","f","v"],["t","g","b"],["y","h","n"],["u","j","m"],["i","k"," "],["o","l"," "],["p"," "," "]]
                            ‚ø # Pair it with the digit list, and zip/transpose again
                            ˜ # Then flatten this entire list:
                            # ["1","q","a","z","2","w","s","x","3","e","d","c","4","r","f","v","5","t","g","b","6","y","h","n","7","u","j","m","8","i","k"," ","9","o","l"," ","0","p"," "," "]
                            ð",.;'"S.;
                            # Replace the four spaces with [",", ".", ";", "'"] in order
                            yk # Get the indices of the characters in the pair `y` in this list
                            # i.e. ["b"," "] → [19,-1]
                            4/ # Divide both by 4
                            # i.e. [19,-1] → [4.75,-0.25]
                            ï # Floor the decimals to integers
                            # i.e. [4.75,-0.25] → [4,-1]
                            D3›- # If an index is larger than 3: decrease it by 1
                            # i.e. [4,-1] → [3,-1]
                            D4›- # If an index is now larger than 4: decrease it by 1 again
                            D ‚ # Pair it with the original index
                            # i.e. [[19,-1],[3,-1]]
                            © # And save it in the register (without popping)
                            θè # Then use the last of the two to index into the list of pairs
                            # i.e. [3,-1] → [[55,53],[65]]
                            ®€Ë # Check for each pair in the register if they're equal
                            # i.e. [[19,-1],[3,-1]] → [0,0]
                            O # Take the sum of that
                            U # And pop and store it in variable `X`
                            ε } # Map the pairs in the list to:
                            Xè # The `X`'th value in the pair
                            # i.e. [[55,53],[65]] and `X`=0 → [55,65]
                            T/ # Divide each by 10
                            # i.e. [55,65] → [5.5,6.5]
                            z # And take 1/value for each
                            # i.e. [5.5,6.5] → [0.181...,0.153...]
                            X_i # If variable `X` was 0:
                            O # Take the sum of these decimal values
                            # i.e. [0.181...,0.153...] → 0.335...
                            3*8/ # Multiply it by 3, and then divide it by 8
                            # i.e. 0.335... → 0.125...
                            ë # Else:
                            θ # Pop the pair of decimal values, and only leave the last one
                            ] # Close both the if-else statement and the loop
                            O # And take the sum of the stack
                            # (which is output implicitly as result)


                            See this 05AB1E tip of mine (sections How to compress large integers? and How to compress integer lists?) to understand why •δ'ā∍ë*8U¾Ã• is 307264255556527588774514 and •δ'ā∍ë*8U¾Ã•₂в is [7,1,5,1,8,0,10,8,24,9,18,6,17,7,16,7,20].







                            share|improve this answer














                            share|improve this answer



                            share|improve this answer








                            edited Apr 9 at 10:01

























                            answered Apr 8 at 16:00









                            Kevin CruijssenKevin Cruijssen

                            43.8k573224




                            43.8k573224



























                                draft saved

                                draft discarded
















































                                If this is an answer to a challenge…



                                • …Be sure to follow the challenge specification. However, please refrain from exploiting obvious loopholes. Answers abusing any of the standard loopholes are considered invalid. If you think a specification is unclear or underspecified, comment on the question instead.


                                • …Try to optimize your score. For instance, answers to code-golf challenges should attempt to be as short as possible. You can always include a readable version of the code in addition to the competitive one.
                                  Explanations of your answer make it more interesting to read and are very much encouraged.


                                • …Include a short header which indicates the language(s) of your code and its score, as defined by the challenge.


                                More generally…



                                • …Please make sure to answer the question and provide sufficient detail.


                                • …Avoid asking for help, clarification or responding to other answers (use comments instead).




                                draft saved


                                draft discarded














                                StackExchange.ready(
                                function ()
                                StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcodegolf.stackexchange.com%2fquestions%2f182782%2fhow-long-does-it-take-to-type-this%23new-answer', 'question_page');

                                );

                                Post as a guest















                                Required, but never shown





















































                                Required, but never shown














                                Required, but never shown












                                Required, but never shown







                                Required, but never shown

































                                Required, but never shown














                                Required, but never shown












                                Required, but never shown







                                Required, but never shown







                                Popular posts from this blog

                                Is flight data recorder erased after every flight?When are black boxes used?What protects the location beacon (pinger) of a flight data recorder?Is there anywhere I can pick up raw flight data recorder information?Who legally owns the Flight Data Recorder?Constructing flight recorder dataWhy are FDRs and CVRs still two separate physical devices?What are the data elements shown on the GE235 flight data recorder (FDR) plot?Are CVR and FDR reset after every flight?What is the format of data stored by a Flight Data Recorder?How much data is stored in the flight data recorder per hour in a typical flight of an A380?Is a smart flight data recorder possible?

                                Which is better: GPT or RelGAN for text generation?2019 Community Moderator ElectionWhat is the difference between TextGAN and LM for text generation?GANs (generative adversarial networks) possible for text as well?Generator loss not decreasing- text to image synthesisChoosing a right algorithm for template-based text generationHow should I format input and output for text generation with LSTMsGumbel Softmax vs Vanilla Softmax for GAN trainingWhich neural network to choose for classification from text/speech?NLP text autoencoder that generates text in poetic meterWhat is the interpretation of the expectation notation in the GAN formulation?What is the difference between TextGAN and LM for text generation?How to prepare the data for text generation task

                                Is there a general name for the setup in which payoffs are not known exactly but players try to influence each other's perception of the payoffs?Osborne, Nash equilibria and the correctness of beliefsIs there a name for this family of games (Binomial games?)?Perfect Bayesian EquilibriumCalculating mixed strategy equilibrium in battle of sexesPure Strategy SPNEIs there a commitment mechanism which allows players to achieve pareto optimal solutions?Extensive Form GamesAn $n$-player prisoner's dilemma where a coalition of 2 players is better off defectingTit-For-Stat Strategy Best RepliesPotential solutions of the $n$-player Prisoner's Dilemma