Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »

Posts by Moshi‭

75 posts
60%
+1 −0
Challenges Plain black webpage

HTML, 25 bytes <style>*{background:#000} Not really sure if this is a legal solution, but technically you can open it in your browser...

posted 3mo ago by Moshi‭

Answer
66%
+2 −0
Challenges Reverse the bits in a Byte

Sclipting, (UTF-16) 26 bytes 갠긂갠밂乘감뒄뀢감雙갿및剩 Uses a formula I found here unsigned char b; // reverse this (8-bit) byte b = (b * 0x0202020202ULL & 0x010884422010ULL) % 1023;

posted 8mo ago by Moshi‭

Answer
50%
+0 −0
Challenges Mediocre pop count

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!

posted 1y ago by Moshi‭

Answer
60%
+1 −0
Challenges Just the vowels please

Sclipting, (UTF-16) 22 bytes 놵멡뉖땯더굅낔뭕뇐虛移 Nothing complicated, just replaces the regex [^aeiouAEIOU] with the empty string.

posted 1y ago by Moshi‭

Answer
60%
+1 −0
Q&A Up to date JavaScript 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...

1 answer  ·  posted 1y ago by Moshi‭  ·  last activity 1y ago by trichoplax‭

Question try-it-online
66%
+2 −0
Challenges The holeyest base

Sclipting, (UTF-16) 86 bytes 標갠 관上가①要❶❹剩걉눑감⓶重右갰雙⓷加⓶❸分終⓷棄終并❶訂乾⓶折❷同終長괐縮⒈棄丟 Explanation: Input n 標 갠 관上 for b from 2 to 16 가 s = 0 ① n' = n 要 while n' is not 0 ❶❹剩 x = n...

posted 1y ago by Moshi‭  ·  edited 1y ago by Razetime‭

Answer
60%
+1 −0
Challenges 55 fruit salad: choose your own Kolmogorov complexity

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...

posted 1y ago by Moshi‭  ·  edited 1y ago by Moshi‭

Answer
50%
+0 −0
Challenges Make a frequency table (histogram)

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

posted 2y ago by Moshi‭  ·  edited 1y ago by Moshi‭

Answer
71%
+3 −0
Challenges From the smallest seed

Challenge It's a bootstrapping challenge this time! Write a full program that, once run, writes the source code of another program that in turn, once run, writes the source code for another progra...

2 answers  ·  posted 2y ago by Moshi‭  ·  last activity 2y ago by orthoplex‭

75%
+4 −0
Sandbox From the smallest seed

posted 2y ago by Moshi‭  ·  edited 2y ago by Moshi‭

60%
+1 −0
Challenges Looping counter

JavaScript (Node.js), 31 bytes for(i='';;console.log(i+='*')); Try it online!

posted 2y ago by Moshi‭

Answer
71%
+3 −0
Challenges Can you give me half?

Python 3, 5 unique bytes, 28 total (()==())/((()==())+(()==())) (, ), =, /, + Uses (()==()) to get True with only 3 unique characters, as well as making the later grouping of (...+...) free. ...

posted 2y ago by Moshi‭

Answer
50%
+0 −0
Challenges Determine whether an integer is square-free

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.

posted 2y ago by Moshi‭  ·  edited 1y ago by Moshi‭

Answer
66%
+2 −0
Challenges Implement Rule 110

JavaScript (Node.js), 160 bytes (r,d,n,l=r.length,s=d.length,p=(n,i)=>n?"01110110"[4*p(--n,i-1)+2*p(n,i)+1*p(n,i+1)]:i>=0&i<s?d[i]:r[(i%l+l)%l])=>[...Array(4*l+s+2*n)].map((_,i)=...

posted 2y ago by Moshi‭  ·  edited 2y ago by Moshi‭

Answer
75%
+4 −0
Sandbox Solve a Word Search!

posted 2y ago by Moshi‭  ·  edited 2y ago by Moshi‭

Article code-golf
66%
+2 −0
Challenges Run-length encode a byte sequence

JavaScript (Node.js), 101 82 bytes -19 bytes thanks to Shaggy! x=>x.replace(/(..)\1{0,62}/g,(c,g)=>c>'c'||c[5]?(192+c.length/2).toString(16)+g:c) Try it online! Everything can be sol...

posted 2y ago by Moshi‭  ·  edited 2y ago by Moshi‭

Answer
66%
+2 −0
Challenges Convert integer to English

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}'....

posted 2y ago by Moshi‭

Answer
66%
+2 −0
Challenges Find good coalitions

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...

posted 2y ago by Moshi‭  ·  edited 2y ago by Moshi‭

Answer
71%
+3 −0
Challenges Convert integer to English

Sclipting, (UTF-16) 454 406 bytes Yes. 塊匱❸곴김分倘標⓶❹演긆륩닆롩닶밎併鈉不終⓷곴김剩❶갾밈分倘⓷標⓷❺演긇끨닷녳눖멤併鈉⓶不終갾밈剩❶뉀分倘⓷標⓷❺演긆둵닦끲뉖밄併鈉⓶不終뉀剩⓶글會⓶倘❷長是긆굮뉂밀⓶終긇끨늗긠뉦뭵댢걦늖눠댶땸긇꽥덦녮긆녩뉶될닦땮뉐❷굀瀰是❶銅긂건덶녮融壹坼❸겠分掘덇밉⓸겠剩倘껐⓶⓹逆⓸終終긆뭮뉒건덶묠덆둲뉖넠뉦뭵댢걦늗뉥긇꽩...

posted 2y ago by Moshi‭  ·  edited 2y ago by Moshi‭

Answer
71%
+3 −0
Q&A Tips for golfing in Python

Use the unpacking * instead of list If you want to convert an iterator/generator into a list, use the * operator instead of using the list function, e.g. Instead of list(iterable) Use [*iter...

posted 2y ago by Moshi‭

Answer
66%
+2 −0
Challenges The Ludic Numbers

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...

posted 2y ago by Moshi‭  ·  edited 2y ago by Moshi‭

Answer
60%
+1 −0
Challenges Evaluate a single variable polynomial equation

Python 3, 46 bytes lambda a,x:sum(c*x**i for i,c in enumerate(a)) Try it online!

posted 2y ago by Moshi‭

Answer
66%
+2 −0
Challenges Weave Strings Together

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...

posted 2y ago by Moshi‭  ·  edited 2y ago by Moshi‭

Answer
66%
+2 −0
Challenges Weave Strings Together

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.

posted 2y ago by Moshi‭  ·  edited 2y ago by Moshi‭

Answer
71%
+3 −0
Challenges Collatz conjecture; Count the tries to reach $1$

Sclipting, (UTF-16) 44 34 32 bytes 貶要❶갠剩❷隔❸增갰乘嗎終并長貶 Because comparing with 1 is expensive (requires copying and decrementing), we instead use a modified version of the Collatz sequence - namely...

posted 2y ago by Moshi‭  ·  edited 2y ago by Moshi‭

Answer