Timeline for Create a binary wall
Current License: CC BY-SA 3.0
12 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Aug 1, 2017 at 0:35 | history | edited | MD XF | CC BY-SA 3.0 |
deleted 2 characters in body
|
Jul 31, 2017 at 16:40 | comment | added | Adalynn |
Might want to actually make Java 7 link to something.
|
|
Jul 27, 2017 at 11:45 | history | edited | Java Gonzar | CC BY-SA 3.0 |
deleted 5 characters in body
|
Jul 27, 2017 at 7:29 | history | edited | Java Gonzar | CC BY-SA 3.0 |
added 6 characters in body
|
Jul 27, 2017 at 7:27 | comment | added | Java Gonzar | Great Xanderhall! Thank you :) | |
Jul 26, 2017 at 14:16 | comment | added | Xanderhall |
You can save a few bytes by switching your loop to a foreach loop. for(int x:i) Also, you can use Long.toBinaryString instead of the Integer version to save 3 bytes.
|
|
Jul 25, 2017 at 12:40 | comment | added | Java Gonzar | True! Amazing, thank you | |
Jul 25, 2017 at 12:39 | history | edited | Java Gonzar | CC BY-SA 3.0 |
added 30 characters in body
|
Jul 25, 2017 at 12:37 | comment | added | TheLethalCoder |
i++ evaluates i then increments it (whereas ++i does the opposite) so you can move the i++ out of the for loop and use b[i++] instead. Oh and whilst we're at it you only have one line inside your loop so the braces aren't needed.
|
|
Jul 25, 2017 at 12:35 | comment | added | Java Gonzar | Thank you! Could you please explain what "Post increment i at b[i] to save a byte." means? | |
Jul 25, 2017 at 12:24 | comment | added | TheLethalCoder |
Post increment i at b[i] to save a byte. You can keep the output with 1 's so no need for the .replace('1','*') . Use Java 8 instead and compile to a lambda to save bytes. If you don't want to do that int[]b saves a byte.
|
|
Jul 25, 2017 at 12:20 | history | answered | Java Gonzar | CC BY-SA 3.0 |