Skip to main content

Timeline for Text-to-Morse code converter

Current License: CC BY-SA 4.0

4 events
when toggle format what by license comment
Apr 9, 2019 at 15:00 history edited DapperDan CC BY-SA 4.0
Correcting error in response to comment
Apr 9, 2019 at 9:56 comment added CiaPan Minor correction: the original loop invokes text.charAt(i) up to 6 times per iteration, not 8. Those are 5 times per all if-s and once in the conditional branch (it will never execute all three branches in a single iteration!) And those 5 only if the analyzed character is not a letter nor a digit. So a text consisting of, say, 70% letters, 10% digits and 20% spaces will require, on average, 3.8 calls to text.charAt(i) per character loop. Anyway it's still worth reducing to 1. Upvoted.
Apr 5, 2019 at 18:44 vote accept Dalu_21
Apr 6, 2019 at 21:14
Apr 5, 2019 at 18:34 history answered DapperDan CC BY-SA 4.0