Timeline for Enlarge ASCII art
Current License: CC BY-SA 3.0
20 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jan 28, 2014 at 15:27 | comment | added | Danny | Thanks all. Seems I still need to learn a few trick on minifying my code. | |
Jan 28, 2014 at 15:27 | history | edited | Danny | CC BY-SA 3.0 |
deleted 4 characters in body
|
Jan 28, 2014 at 15:17 | comment | added | Yurii Shylov |
Another 4 bytes: Integer.valueOf(a[0]) -> new Integer(a[0])
|
|
Jan 28, 2014 at 13:52 | history | edited | Danny | CC BY-SA 3.0 |
deleted 5 characters in body
|
Jan 28, 2014 at 13:25 | comment | added | daniero |
Hm ok. Here is 3 chars saved by rearranging the outter for loop a little bit: enum M{;public static void main(String[]a){int f=Integer.valueOf(a[0]),i=-1,j,k;a=a[1].split("\n");for(;++i<a.length*f;System.out.println())for(j=0;j<a[i/f].length();j++)for(k=0;k++<f;)System.out.print(a[i/f].charAt(j));}}
|
|
Jan 28, 2014 at 13:15 | comment | added | Danny |
Reusing a[0] and appending to it to print, ended up with the same amount of chars for me.
|
|
Jan 28, 2014 at 13:05 | history | edited | Danny | CC BY-SA 3.0 |
deleted 1 characters in body
|
Jan 28, 2014 at 11:07 | comment | added | daniero |
Doesn't seem optimal to write out System.out.print twice; I'd suggest something like making an empty string, append to it instead of the first ...print and then println it at the end.
|
|
Jan 28, 2014 at 8:35 | comment | added | Yurii Shylov |
Spare another byte by replacing for(k=0;k<f;k++) with for(k=0;k++<f;)
|
|
Jan 28, 2014 at 0:39 | comment | added | Mark Plotnick |
Yeah, with any language where just the declaration of main takes more bytes than entire programs in other languages, contestants are going to be getting bogeys.
|
|
Jan 27, 2014 at 16:23 | history | edited | Danny | CC BY-SA 3.0 |
deleted 9 characters in body
|
Jan 27, 2014 at 15:24 | comment | added | manatwork |
You can spare: 1 character by initializing i in the declaration instead of the for ; 8 characters by using a instead of x (a=a[1].split("\n") , and change all x with a).
|
|
Jan 27, 2014 at 15:12 | comment | added | Danny | @Gareth darn, missed that too. Should be fixed now. | |
Jan 27, 2014 at 15:10 | history | edited | Danny | CC BY-SA 3.0 |
added 56 characters in body
|
Jan 27, 2014 at 15:02 | review | First posts | |||
Jan 27, 2014 at 15:55 | |||||
Jan 27, 2014 at 15:01 | comment | added | Gareth |
The input characters need to expand downwards as well as across (so there should be 3 lines of aaabbb and 3 lines of cccddd in your output example above).
|
|
Jan 27, 2014 at 14:58 | history | edited | Danny | CC BY-SA 3.0 |
deleted 4 characters in body
|
Jan 27, 2014 at 14:58 | comment | added | Danny |
Ah, your right it should be abcd typo :/
|
|
Jan 27, 2014 at 14:54 | comment | added | manatwork | Are you sure the input is correct? | |
Jan 27, 2014 at 14:44 | history | answered | Danny | CC BY-SA 3.0 |