Search
Python 3, 46 bytes Saved 8 bytes thanks to Shaggy! lambda n:[n-i*i or exit(1)for i in range(1+n)] Try it online! Python 3.8 (pre-release), 50 54 52 bytes Fixed a silly mistake thanks to Sh...
Reorder expressions in order to save whitespace Consider the following code: if c=='U':c='X' The space between if and c obviously cannot be removed, as that would merge them to the identifier ...
Haskell, 352 bytes f a=let{(d,e)=y$filter(>'-')a;f=drop 1e;g=0!h;h=fst n;i=scanr(:)[]h;(j,k)=elem '.'f%(1!head(filter(\a->a>[]&&elem(a++a)i)i++[[last$'0':h]]));(l,m)=(read('0':d...
JavaScript (Node.js), 242 234 bytes s=>([l,p,i,j,_,r]=/(-)?\+?(\d*)\.?(\d*?)(((\d+)\6|\d)\.|$)/.exec(s),[i,r]=c(c([i|0,1],[j|0,10**(l=j.length)]),[r=r||'0',10**l*(10**r.length-1)]),[(p?-i:i)/(j...
Japt, 15 bytes É©Òß[U*3ÄUz]gUv Try it É©Òß[U*3ÄUz]gUv :Implicit input of integer U É :Subtract 1 © :Logical AND with Ò :Negate the ...
BQN, 31 28 bytes {1+(1≠𝕩)◶¯1‿𝕊2(|⊑÷˜∾1+3×⊢)𝕩} Try it online! An anonymous function which takes a number. the ¯1 branch is a bit tacky but saves a byte over (1+𝕊).
Python 3, 72 69 bytes lambda l:''.join(sum(zip(*[[*i]+['']*max(map(len,l))for i in l]),())) Try it online! Uses this method to flat zip, with modifications to pad the shorter lists.
Python 2, 58 54 bytes lambda l:''.join(filter(None,sum(map(None,'',*l),()))) Try it online! Amazingly, shorter than my Python 3 answer! Uses this method to zip unequal-length lists and this me...
Ruby, 51 bytes ->a{(0..a.map(&:size).max).map{|n|a.map{_1[n]}}*""} ->a{ } # lambda taking array `a` (0..a.map(&:size).max) ...
FALSE, 198 bytes [" on the wall"]c:[$." bottle"$1=~["s"]?" of beer"]b:99[$1>][b;!c;!", "b;!". Take one down, pass it around, "1-b;!c;!". "]#1b;!" on the wall, "1b;!". Go to the store and b...
Scala, 60 bytes _.map(_ map "".+).reduce(_.zipAll(_,"","")map(_+_)).mkString Try it in Scastie! First, _.map(_ map "".+) turns every string into a list of strings containing a single character...
Challenge Write a program that prints its reversed self. For example, if your code is foo() Then it'll output: )(oof Make sure that the quine is a valid one, as defined here: No cheatin...
Vyxal D, 10 bytes `:qpṘ`:qpṘ Try it Online! `:qp `:qp # Standard quine structure Ṙ Ṙ # Reverse Or, more interestingly... Vyxal D, 31 bytes `q\`:Ė#\`+øm`:Ė#Ė:`mø+`\#Ė:`\q` Try ...
Python 3, 69 bytes i="))43,]1-::[i,43,73(%ci(tnirp;%c%s%c=i";print(i%(37,34,i[::-1],34)) Try it online!
Python 3, 202 bytes a,i='bottle%s of beer on the wall',99 while i:i-=1;x=a%'s'[:i];print(i+1,x+',',i+1,x[:-12]+'.\n'+'GToa kteo otnhee dsotwonr ea nadn dp absusy isto maer omuonrde,,'[i>0...
Python 3, 34 bytes lambda a,b:''.join(b*i for i in a) Try it online!
Python 3.8 (pre-release), 98 bytes lambda s,n:''.join((c,chr((ord(c)+n-1-(o:=(64,96)[c.islower()]))%26+o+1))[c.isalpha()] for c in s) Try it online!
Sclipting, (UTF-16) 58 52 bytes 가匱❸增平갠下氫終要鈮貶⓶梴감⓶上❸乘殲終終并鈮掘增 Gives the nth ludic number, 0-indexed. 가 Start list of Ludics with 0 匱❹增平갠下氫終 Create a list of numbers from 2 to n+1 squared 要 W...
Python 3, 80 77 75 72 bytes def f(): yield 1;l=[*range(2,236425)] while l:yield l[0];del l[::l[0]] Try it online! Prints out the whole sequence. I did my best to get the biggest number t...
C (gcc), 774 bytes #define S strcat(o, #define I(s)if(n)S s);else{S" ");return;} #define B);break;case n,N,s;char*i,o[999],*d[]={"zero ","one ","two ","three ","four ","five ","six ","seven "...
Haskell, 219 194 bytes h!n=x n?(a?c$d>n&&(even a?f(<)$f(==)))$h where(a,b)=e!!(c-1);(c,d)=dropWhile((<n).snd)e!!0;f g=g(n*2)$b+d x n=m?(2^(e-1)*(m+32))$e<1where(e,m)=divMod ...
Python 3, 191 bytes lambda p:[c for c in chain(*[C(p,r)for r in range(len(p)+1)])if all(all(i==(sum(p.values())/2>=sum(p[n]for n in d))for d in C(c,len(c)-i))for i in[0,1])] from itertools imp...
Python 3, 399 bytes def f(n): if n<1:return'zero' t=1000;m=t*t;r='r fif six seven eigh nine ';b=f'one two three four five six seven eight nine ten eleven twelve thir fou{r}twen thir fo{r}'....
Vyxal, 3 bytes k∨↔ Try it Online! ↔ # Keep chars from k∨ # vowels