Timeline for Pronounce numbers
Current License: CC BY-SA 3.0
12 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jun 6, 2017 at 12:10 | history | edited | PunPun1000 | CC BY-SA 3.0 |
MIssed change in ungolfed version
|
Jun 6, 2017 at 11:58 | history | edited | PunPun1000 | CC BY-SA 3.0 |
Moved things to for loop declaration and removed unneccessary local variable
|
Jun 6, 2017 at 6:51 | comment | added | Kevin Cruijssen |
Two small things you can golf. You can remove the String t , because you only use it once. So t.charAt(i)+"" becomes "OIREASGTBP".charAt(i)+"" (-4 bytes). And you can place the last line inside the for-loop after the i<9; inside the for-loop declaration. So it becomes for(;i<9;s=b?s.replace(v,c):s.replace(c,v)){ (-1 byte). Oh, and you can put the s=b?... that comes right after the int i=-1; inside the for-loop as well: for(s=b?...;i<9;... (-1 byte).
|
|
Jun 2, 2017 at 19:39 | history | edited | PunPun1000 | CC BY-SA 3.0 |
Shortened match regex representation
|
Jun 2, 2017 at 19:26 | history | edited | PunPun1000 | CC BY-SA 3.0 |
Converted if/else to ternaries
|
Jun 2, 2017 at 17:57 | comment | added | Cyoce |
since all your branches of the if statement are assignments (which return a value), try replacing the if ...else if ...else with the conditional operator ?: , prefacing it with Object _= to make it a valid statement. Not sure if this would actually help the byte count, but I think it will.
|
|
Jun 2, 2017 at 17:38 | comment | added | PunPun1000 | @Cyoce every byte helps | |
Jun 2, 2017 at 17:37 | history | edited | PunPun1000 | CC BY-SA 3.0 |
Shortened match regex representation
|
Jun 2, 2017 at 17:29 | comment | added | Cyoce |
Not that it significantly improves your massive byte count, but you can remove the parentheses around (s)->
|
|
Jun 2, 2017 at 17:01 | history | edited | PunPun1000 | CC BY-SA 3.0 |
Removed extraneous string concatenation
|
Jun 2, 2017 at 16:54 | history | edited | PunPun1000 | CC BY-SA 3.0 |
Updated test cases on TIO
|
Jun 2, 2017 at 15:17 | history | answered | PunPun1000 | CC BY-SA 3.0 |