Search
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...
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.
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...
PHP, 36 bytes <?php $x=(int)fgets(STDIN);echo$x%2; Try it online! Outputs 1 if odd and 0 if even.
Rockstar, 40 bytes listen to N say "listen to N say N-0+"+N Which outputs P2, where X is the input from P1: listen to N say N-0+X Try it here (Code will need to be pasted in)
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.
Haskell, 45 bytes foldl(\a b->zipWith((-).(*b))(0:a)$a++[0])[1] Try it online! Uses the "highest power first" convention. Sometimes multiplies the polynomial by $(-1)$.
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...
JavaScript (Node.js), 58 bytes ([x,...r],y)=>x?[0,...y=f(r)].map((v,i)=>v-x*(y[i]|0)):[1] Try it online!
Haskell, 74 bytes a=ord 'a' n!c|isLetter c=chr((rem((ord c -a)+n) 26)+a)|True=c f n=map (n!) Try it online!
Haskell, 47 bytes l=length f s=(l(words s),l s,l$filter(/= ' ')s) Try it online!
| == 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!
shortC, 38 bytes Bs){Rs="Bs){Rs=%c%s%c,34,s,34",34,s,34 Try it online! From GeeksForGeeks's C implementation.
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.
Haskell + hgl, 10 bytes mpn$ce~<gj Attempt This Online! Explanation mpn map across all non-empty prefixes of the input ... ce count the number of elements in each prefix equal to ... g...
Respect both sides We should consider how an approach would affect the poster of the incorrect answer, and how it would affect the posters of correct answers. Correct answers In general, allowin...
Libraries are removed when "merge variants" is on. For example, this answer written in C (clang) uses a library called BMPL, so its header is C (clang) + BMPL. While there's nothing wrong with usin...
Ruby, 75 bytes ->t,u{g=->a{a.reduce{-2*_1+_2}};('%b'%(g[t]+g[u]+(y=43690)^y)).to_i.digits} Try it online! Uses latest ruby features, so tio link will look different. Takes two digit a...