Posts by General Sebast1an
Whitespace can be removed in between keywords and variables You can easily remove the whitespace that's in-between a keyword (return or a function that doesn't need parentheses) and a variable (ei...
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 vo...
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 i...
shortC, 47 bytes a,b;AOK"%d",&b);b-1;b=b%2?b*3+1:b/2)a++;R"%d",a Try it online! From @ugoren's C answer from CGCC.
shortC, 223 bytes AOC*w=" bottles of beer on the wall",i=100;--i;)R"%d%.*s%s, %d%.*s%.8s.\n%s, %d%.*s%s.\n\n",i,i-1?8:7,w,w+8,i,i-1?8:7,w,w+8,i^1?"Take one down and pass it around":"Go to the stor...
shortC, 40 37 bytes i;f(C*s,In){O;*s;s++)Oi=n;i--;P*s));} Try it online! A shortC conversion of @Lundin's C (gcc) implementation.
shortC, 24 bytes f(C*s){*s&&f(s+1)^P*s);} Try it online! A shortC conversion of @Sisyphus's C (gcc) implementation.
Python 3, 268 250 235 233 210 197 148 bytes def a(n):e=(n>>6).bit_length();f=2**e;l=n&(f-1);N=(n>>e)&31;return((e+(n>31))<<5)+N+(2*l+N%2>f) def b(r):E=r>>5...
shortC, 95 93 91 bytes AIi;Wi++<100){C*h[]={"%d "," "},**p=h;i%3||(*p++="Fizz%2$s");i%5||(*p="Buzz ");R*h,i,h[1]); Try it online! From @celtschk's C (gcc) answer.
Python 3, 596 589 585 482 468 467 429 bytes def f(x): s="";i="r fif six seven eigh nine";a=f"zero one two three four five six seven eight nine ten eleven twelve thir fou{i} twen thir fo{i}".sp...
Anything that's outside the script is echoed This probably has to deal with the fact that PHP is a script commonly used on HTML, and anything that is written on the HTML document--not inside the s...
Background While we do have a "Hello, World!" challenge, we still don't have one regarding input. So let's do one! Challenge Create a program that takes an input (not as a function argument) the...
Chef, 558 485 bytes H. Ingredients. 72 l H 101 l e 108 l l 111 l o 44 l _comma 32 l _space 87 l w 114 l r 100 l d 33 l _bang Method. Put _bang into mixing bowl.Put d into mixing b...
Forget, 319 bytes push 72;cleanse;pop;out;push 101;cleanse;pop;out;push 108;cleanse;pop;out;push 108;cleanse;pop;out;push 111;cleanse;pop;out;push 44;cleanse;pop;out;push 32;cleanse;pop;out;push 8...
Japt, cracked by Shaggy, 17 bytes "Cops and Robbers Try it online! Don't think much recognize this language at all. This is supposed to be from Pyth, but Japt has this too, so it's certainly v...
!@#$%^&*()_+, 17 bytes ^dlroW ,olleH(@) Try it online! Might learn this sometime but I found this.
Charcoal, 13 bytes Hello, World! Try it online! I'm surprised no one even used Charcoal in the challenge. Guess I'll take it.
Python 3, 51 25 bytes n=int(input());print(n%2) Try it online! Golfed 26 bytes using the technique from my PHP answer.