Search
Create a program that gets all perfect squares starting from 0 or 1 without using any methods of multiplication (repetitive addition) and exponentiation (repetitive multiplication). Output them for...
C (gcc), 112 bytes Function solution. p,*a;f(char*s,int n){a=strdup(s);for(s=a;*s;s++)(p=isalpha(*s)?(*s&96)^96?65:97:0)&&(*s=(*s-p+n)%26+p);puts(a);} Try it online! Explanati...
JavaScript (V8), 28 bytes for(x=y=0;;++y)print(x+=++y) Try it online!
Japt, 9 bytes No infinite lists in Japt so we'll have to go with a recursive solution. ßOpTµJJµ2 Test it ßOpTµJJµ2 ß :Recursive call with (irrelevant) argument Op : ...
Husk, 3 bytes ∫İ1 Try it online! Scan from left over all odd numbers with addition. Uses this formula: $$ n^2 = \sum_{k=1}^n(2k-1) $$
JavaScript (Node.js), 148 bytes s=>s?eval(s.replace(/([^()])\1*/g,(m,g)=>(g=='!'?'+':g)+m.length).replace(/\(/g,'*(').replace(/-(\d|\(.+?\))\^(\d+)/g,(m,g,h)=>'-('+g+'**'+h+')')):0 Abu...
I haven't been involved enough in SE Code Golf to really count for much. But I do think we need to have policies stated somewhere. One advantage we have here is that once policies get reasonably fi...
I think there should be a standard set of tabs to use in Sandbox to indicate that a post has been turned into a Challenge, and possibly for other Sandbox-specific status issues as well.
JavaScript (Node.js), 57 56 bytes f=(a,b='/\\')=>a--?''.padEnd(a)+b+` `+f(a,'/'+b+'\\'):'' Try it online!
Canvas, 9 7 bytes H/×║∔}r Try it here! Explanation H/×║+}r H } push empty art and start a loop from 1..n /× repeat '/' i times ║ palindromize horizontally(no overlap) ...
Python 2, 57 bytes a,x=1,input() exec'print" "*(x-a)+"/"*a+"\\\\"*a;a+=1;'*x Prints it out line by line Try it online!
Python 2, 37 bytes l=input() while 1:print len(l);l=l[0] Try it online! This makes heavy use of programs being allowed to terminate with error, which I assume is allowed by default because ...
C (compliant), 19 bytes (gcc -std=c18 -pedantic-errors) int main(){main();} Godbolt
Husk, 10 bytes L►LfΛo<0-Ṗ Try it online! Explanation L►LfΛo<0-Ṗ Ṗ power set of input f get elements which match the following: Λo - all pairwise difference...
Japt, 10 bytes o ÅÔò cÔiU Try it o ÅÔò cÔiU :Implicit input of integer U o :Range [0,U) Å :Slice off the first element Ô :Reverse ò ...
Japt -R, 11 bytes ;Bå+ mê ê û Test it ;Bå+ mê ê û ;B :Uppercase alphabet å+ :Cumulatively reduce by concatenation m :Map ê : Palindro...
HTML, 26 13 bytes Hello, World! Golfed 13 bytes thanks to @Razetime's advice.
Japt, 13 bytes o ï æ@¶Xx*Xej Try it o ï æ@¶Xx*Xej :Implicit input of integer U o :Range [0,U) ï :Cartesian product æ :First pair X that r...
Japt v2.0a0, 19 18 17 bytes I need more caffeine! Takes input as an array of lines. Output is a reversed array. [Uc¸¬U¬Ucq\s f]ml Try it - includes all test cases, header splits string on new...
Python 3, 235 185 141 118 bytes a=[[],[],[]] n=1;exec("d=sum(i for i in range(1,n)if n%i<1)-n;a[[[1,2][d<0],0][d>0]]+=n,;n+=1;"*int(input())) print(a) Try it online! Golfed 50 byt...