Posts by Moshi
Python 3, 47 42 40 bytes -2 bytes thanks to bastolski lambda n:'#'*n+('\n#'+' '*(n-2)+'#')*~-n Try it online! Python's string multiplication is really useful.
Python 3, 325 322 bytes -3 bytes thanks to steffan153! from base64 import* n=int.from_bytes(b85decode('8C^#Z9Uor=^}*nk`yLA}A<z=aTm_V+z!I{Y1+v7z89f>WmC>M4TN(sPp`fvySOeqafPpzk0!*=hK2{h9D...
JavaScript (Node.js), 31 bytes for(i='';;console.log(i+='*')); Try it online!
Try it online doesn't support the latest JavaScript features such as optional chaining or null coalescence, which are very useful character-saving operators. Is there another site like TIO, but whi...
Python 3, 46 bytes lambda a,x:sum(c*x**i for i,c in enumerate(a)) Try it online!
JavaScript (Node.js), 60 bytes f=([x,...r],y)=>x?[0,...y=f(r)].map((v,i)=>v-x*(y[i]|0)):[1] Try it online!
Sclipting, (UTF-16) 14 bytes 要감啃終丟併反 Explanation: Push input 要 While the top number is non-zero 감啃 Shift the top number by 1 bit and push both the bit and shifted result 終 End lo...
Sclipting, (UTF-16) 22 bytes 놵멡뉖땯더굅낔뭕뇐虛移 Nothing complicated, just replaces the regex [^aeiouAEIOU] with the empty string.
Sclipting, (UTF-16) 80 bytes 갰減먩놔 먩놦①復먩놗겮꺕똀 먩놬①復①增疊먩놣겮꺕똀會먩놣겮꺕떠 먩놩⑴復먩놝 Explanation Input n pushed on stack 갰減 Subtract 3 먩놔 "╔" 먩놦 "╦" ①復 String of above repeat...
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...
JavaScript (Node.js), 228 224 bytes -4 bytes thanks to Hakerh400 (b=n=>`${n} bottle${n-1?'s':''} of beer`,w=' on the wall')=>[...Array(99)].map((_,i)=>`${b(i=99-i)}${w}, ${b(i)}. `+(--i...
Sclipting, (UTF-16) 238 bytes 눰 감下❶貶下標⓶긆깯덇끬뉗꼠닶눠눦녥댠❷감侔是검摧終併終❷긆뭮긇끨뉒걷눖롬 껂밀⓹껠뙔눖띥긆뭮뉒걤닷덮긆굮뉂거눗꽳긆땴긆굲닷녮뉂렠⓺❺껠똊終棄棄껠뙇닲건닲건늆넠댷끯댦넠눖멤긆깵뎒걳닶륥긆륯댦넬긃딹긆깯덇끬뉗꼠닶눠눦녥댢걯닢건늆넠덶구닂밎 Explanation 눰 감下 For n from 99 down to 1 ...
Sclipting, (UTF-16) 8 bytes 根❶圜同 Takes the square root, pushes a copy, rounds the copy, and compares. Basically, checks that the square root is an integer.
JavaScript (Node.js), 34 29 26 bytes -5 bytes thanks to Shaggy's suggestion on a similar challenge -3 bytes again thanks to Shaggy! a=>a.map(d=v=>d[v]=-~d[v]) Try it online!
HTML, 25 bytes <style>*{background:#000} Not really sure if this is a legal solution, but technically you can open it in your browser...
Sclipting, (UTF-16) 18 bytes 낆녬닆묬긅덯댦롤긐 Since it hasn't been added yet.
Python, 89 bytes lambda l,g=lambda c:ord(c).bit_count():[i for i in l if min(map(g,l))<g(i)<max(map(g,l))] Attempt This Online!
JavaScript (Node.js), 38 32 bytes -6 bytes thanks to Shaggy! a=>a.map(v=>d[v]=-~d[v],d={})&&d Try it online! Basically just this but returning the result
Japt, 6 bytes -1 byte thanks to Shaggy! k ä¦ e Try it First time doing Japt so this is probably pretty bad. Just factorizes and checks that there are no duplicate factors.
JavaScript (Node.js), 39 bytes Returns dimensions from innermost to outermost f=a=>a?.pop?f(a[0]).concat(a.length):[] JavaScript (Node.js), 41 bytes Returns dimensions from outermost to ...
Implementation defines the language, so if you use extensions to a language, you should add + ... extensions to the header. E.g. for a C post using gcc extensions, the header begin with # C (gcc...
JavaScript (Node.js), 81 bytes d=(p,i=2)=>i<p?!(p%i)||d(p,i+1):0 f=(n,a=2,p=a+1)=>d(p)?f(n,a,p+1):p-a<n?f(n,p):a Try it online! Explanation: d is a helper function that returns t...
- ← Previous
- 1
- 2
- 3
- Next →