Timeline for Make a ;# interpreter
Current License: CC BY-SA 3.0
17 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Aug 11, 2017 at 9:55 | comment | added | Olivier Grégoire |
Entirely golfed, for 81 bytes as a Consumer<char[]> : s->{char i=0;for(int b:s){if(b==59)i++;if(b==35){System.out.print(i%=127);i=0;}}}
|
|
Aug 11, 2017 at 9:49 | comment | added | Olivier Grégoire |
4 bytes shorter: s->{int i=0;for(int b:s.getBytes()){if(b==59)i++;if(b==35){System.out.printf("%c",i%127);i=0;}}} (careful with StackExchange's hidden characters). 1 byte is removed due to the fact that the final semicolon is not part of the answer; in TIO, just put a ; as first character of the "footer" section. Can be further golfed if you accept a char[] instead of a String .
|
|
May 24, 2017 at 8:54 | comment | added | JollyJoker | @GeroldBroser The java compiler takes an -encoding parameter that accepts any of the supported charsets. The source code can be any of these. | |
May 23, 2017 at 20:24 | comment | added | user18932 | @GeroldBroser Unicode is a character set: UTF-8 and UTF-16 are two encodings of that character set. ASCII source is perfectly valid as a Java program, and I have plenty of Java source files encoded in ASCII (which is also valid UTF-8, hence also a Unicode encoding). | |
May 23, 2017 at 19:34 | comment | added | Gerold Broser | @unascribed No, it doesn't. The first sentence in the section I linked reads "Programs are written using the Unicode character set.". String literals are covered in a diffferent section. | |
May 23, 2017 at 18:19 | comment | added | Una | @GeroldBroser Your link refers to Strings in Java, not Java source code. Java source code is usually UTF-8, and I believe UTF-16 is a syntax error. This answer is 100 bytes. | |
May 23, 2017 at 16:34 | comment | added | Gerold Broser | @JollyJoker Arguing with the JLS isn't among the best things a Java developer can do. | |
May 23, 2017 at 14:58 | comment | added | JollyJoker | @GeroldBroser Java source code can be 7-bit ASCII if you want to call this 87,5 bytes | |
May 23, 2017 at 14:54 | comment | added | JollyJoker | Argh. I've been thinking far too long about how to beat this by splitting the String around # and ; and just using the length. I suspect it just becomes too long. | |
May 23, 2017 at 12:50 | comment | added | Gerold Broser | Java uses UTF-16 for its programs. So, these aren't 100 bytes but 100 characters. | |
May 23, 2017 at 9:00 | history | edited | Okx | CC BY-SA 3.0 |
edited body
|
May 22, 2017 at 20:26 | comment | added | Jonathan Allan | I added a link to an online interpreter with the FizzBuzz example for you (link text was too long to fit in a comment) | |
May 22, 2017 at 20:26 | history | edited | Jonathan Allan | CC BY-SA 3.0 |
added 759 characters in body
|
May 22, 2017 at 16:31 | review | Low quality posts | |||
May 22, 2017 at 17:07 | |||||
May 22, 2017 at 16:25 | comment | added | DJMcMayhem | Welcome to the site! :) | |
May 22, 2017 at 16:21 | review | First posts | |||
May 22, 2017 at 16:25 | |||||
May 22, 2017 at 16:12 | history | answered | svp | CC BY-SA 3.0 |