Posts by General Sebast1an
PHP, 114 bytes <?php for($i=1;$i<101;$i++){if($i%3!=0&$i%5!=0){echo$i;}if($i%3==0){echo"Fizz";}if($i%5==0){echo"Buzz";}echo"\n";} Try it online! As someone who doesn't code much in...
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!
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.
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?i*3+1:i/2;}System.out.print(j);}} Try it online! Fr...
shortC, 78 bytes i,j;f(Ix,Iy,I*p){R"[");O;i<x;i++)Oj=0;j<y;j++)*p++&&R"[%d,%d],",i,j);J"\b]");} Try it online! From @Lundin's C (gcc) answer.
shortC, 38 bytes Bs){Rs="Bs){Rs=%c%s%c,34,s,34",34,s,34 Try it online! From GeeksForGeeks's C implementation.
| == or This bitwise operator can sometimes be used as the replacement for or. a=-2;b=3 if(a>0)|(b>0):print(a+b) Try it online!
Set arrays without array() In a few occasions, setting an array using array() can be a bit costly. Thankfully, you can assign an array like how to assign a Python list. <?php $a=["Hello","Ma...
PHP, 57 bytes <?php $x=0;$y=1;while(1){echo(string)($x+=$y)." ";$y+=2;} Try it online! PHP's a nice language, I tell ya.
PHP, 36 bytes <?php $x=(int)fgets(STDIN);echo$x%2; Try it online! Outputs 1 if odd and 0 if even.
PHP, 55 27 21 bytes Hello, <?=$argv[1]?>! Try it online! Golfed 28 bytes thanks to my Software CD post. Golfed 6 bytes thanks to @Shaggy's advice.
Binary and code plastered a lot One of the more generic ways of adding design to a code challenge site. The binary digits can be plastered around the header in a way that it looks cryptic. But bin...
Python 3, 183 181 175 bytes def f(a,b): c=a;a=str(a) for i in range(b): y=0;z=9 for j in range(len(a)): if y<int(a[j]):y=int(a[j]) if z>int(a[j]):z=int(a[j]) c=int(a)+...
Lua, 41 40 bytes x=0 y=1while""do print(x)x=x+y y=y+2 end Try it online!
Lua, 51 bytes P1: print("print(tonumber(io.read())+"..io.read()..")") Try it online! P2 (given I inputted 10, 29 bytes): print(tonumber(io.read())+10) Try it online!
In this simple challenge, create a short program that takes 2 ints as input, output them, swap their places, then output them again. Those 2 integers can't be the same number. The program with the ...
I'm still being bugged by flags being ignored when adding the language onto the leaderboard. Take for example here on an answer in Vyxal: In case you don't know, when we write an answer, using f...