Activity for General Sebast1anâ€
Type | On... | Excerpt | Status | Date |
---|---|---|---|---|
Comment | Post #290596 |
Albeit not what I expected, this is actually interesting. (more) |
— | 10 months ago |
Edit | Post #284326 |
Post edited: |
— | over 1 year ago |
Edit | Post #279408 |
Post edited: |
— | about 2 years ago |
Edit | Post #283972 |
Post edited: |
— | almost 3 years ago |
Edit | Post #282951 |
Post edited: |
— | about 3 years ago |
Edit | Post #284605 |
Post edited: |
— | about 3 years ago |
Edit | Post #284589 |
Post edited: |
— | about 3 years ago |
Edit | Post #282901 |
Post edited: |
— | about 3 years ago |
Edit | Post #282901 |
Post edited: |
— | about 3 years ago |
Edit | Post #284611 |
Post edited: |
— | about 3 years ago |
Edit | Post #284611 |
Post edited: |
— | about 3 years ago |
Edit | Post #284614 |
Post edited: |
— | about 3 years ago |
Edit | Post #284614 |
Post edited: |
— | about 3 years ago |
Edit | Post #284614 | Initial revision | — | about 3 years ago |
Answer | — |
A: Reverse an ASCII string [Java (JDK)], 88 83 bytes static void f(String s){for(int i=s.length();i>0;System.out.print(s.charAt(--i)));} Try it online! (more) |
— | about 3 years ago |
Edit | Post #284611 |
Post edited: |
— | about 3 years ago |
Edit | Post #284611 |
Post edited: |
— | about 3 years ago |
Edit | Post #284611 | Initial revision | — | about 3 years ago |
Answer | — |
A: Make $2 + 2 = 5$ [Java (JDK)], 51 50 23 21 bytes x->y->x==y&y==2?5:x+y Try it online! Golfed 27 bytes thanks to @Moshi's advice. Golfed 2 bytes thanks to @user's advice on Discord. (more) |
— | about 3 years ago |
Edit | Post #284605 | Initial revision | — | about 3 years ago |
Answer | — |
A: Tips for golfing in Java A clever way to replace `Math` functions You can shorten `if-else` statements through the `a?b:c` syntax, where `a` is the statement of `if`, `b` is the result of `if`, and `c` is the result of `else`. static void main(String[]a){ 	int i = 95; 	System.out.print(i>0?"positive":"ne... (more) |
— | about 3 years ago |
Edit | Post #284604 | Initial revision | — | about 3 years ago |
Answer | — |
A: Tips for golfing in Java Booleans are replaceable Java, like Python, has pretty convenient yet nasty ways to golfing down code through comparison operators. Especially this case, this time with booleans. You can compare `int`s and it will result to either `false` or `true`, which helps you break 1 and 2 bytes respectively... (more) |
— | about 3 years ago |
Edit | Post #284603 | Initial revision | — | about 3 years ago |
Answer | — |
A: Collatz conjecture; Count the tries to reach $1$ [Java (JDK)], 150 bytes interface M{static void main(String[]a){int i=new java.util.Scanner(System.in).nextInt(),j=0;for(;i!=1;j++){i=i%2==1?i3+1:i/2;}System.out.print(j);}} Try it online! From my shortC answer. (more) |
— | about 3 years ago |
Edit | Post #284589 |
Post edited: |
— | about 3 years ago |
Edit | Post #284589 |
Post edited: |
— | about 3 years ago |
Comment | Post #284578 |
I defy your rules! https://codegolf.codidact.com/posts/283141/284589#answer-284589 (more) |
— | about 3 years ago |
Edit | Post #284589 |
Post edited: |
— | about 3 years ago |
Edit | Post #284589 | Initial revision | — | about 3 years ago |
Answer | — |
A: 99 Shortened Bottles of Beer [Java (JDK)], 311 301 296 bytes interface A{static void main(String[]x){String a=" bottle",b=" of beer",c=" on the wall. ",e;for(int i=99;i>0;i--){e=i>1?"s":"";System.out.println(i+a+e+b+c+(i)+a+e+b+(i>1?".\nTake one down and pass it around. ":".\nGo to the store and buy some more. ")+(i>1... (more) |
— | about 3 years ago |
Edit | Post #284588 | Initial revision | — | about 3 years ago |
Answer | — |
A: Tips for golfing in Java Use `interface` The special thing about this is that it lets you drop `public` when you originally call a `class` to run the `main` function. ```java class F{public static void main(String[]a{}} interface M{static void main(String[]a){}} ``` Try it online! Used on "Hello, {name}!" (more) |
— | about 3 years ago |
Comment | Post #284578 |
@#53837 Are you challenging me? (more) |
— | about 3 years ago |
Edit | Post #284579 | Initial revision | — | about 3 years ago |
Answer | — |
A: Tips for golfing in Java Use `for(;;)` instead of `while(true)` The title's self-explanatory. A byte saver. (more) |
— | about 3 years ago |
Edit | Post #284578 |
Post edited: |
— | about 3 years ago |
Edit | Post #284578 | Initial revision | — | about 3 years ago |
Question | — |
Tips for golfing in Java This is a list of golfing tips for the language known as Java. If you have a tip, add it in! (more) |
— | about 3 years ago |
Edit | Post #284337 |
Post edited: |
— | about 3 years ago |
Edit | Post #284407 |
Post edited: |
— | about 3 years ago |
Edit | Post #284407 |
Post edited: |
— | about 3 years ago |
Edit | Post #284519 |
Post edited: |
— | about 3 years ago |
Comment | Post #284520 |
Yeah, I'm not so sure if that's even a valid way to set your inputs. Might update later. (more) |
— | about 3 years ago |
Edit | Post #284519 |
Post edited: |
— | about 3 years ago |
Edit | Post #284407 |
Post edited: |
— | about 3 years ago |
Edit | Post #284407 |
Post edited: |
— | about 3 years ago |
Edit | Post #284519 | Initial revision | — | about 3 years ago |
Question | — |
Operation "Find The Operator" Challenge Make a program that takes input of 3 non-negative integers: a result and 2 other values that once calculated results to the 3rd value. - The program must figure out how to get the 2 first numbers to equivalence itself with the 3rd. It could be either addition, subtraction, multiplicat... (more) |
— | about 3 years ago |
Edit | Post #284407 |
Post edited: |
— | about 3 years ago |