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 99 Shortened Bottles of Beer

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

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

Answer
60%
+1 −0
Challenges 99 Shortened Bottles of Beer

Sclipting, (UTF-16) 238 bytes 눰 감下❶貶下標⓶긆깯덇끬뉗꼠닶눠눦녥댠❷감侔是검摧終併終❷긆뭮긇끨뉒걷눖롬 껂밀⓹껠뙔눖띥긆뭮뉒걤닷덮긆굮뉂거눗꽳긆땴긆굲닷녮뉂렠⓺❺껠똊終棄棄껠뙇닲건닲건늆넠댷끯댦넠눖멤긆깵뎒걳닶륥긆륯댦넬긃딹긆깯덇끬뉗꼠닶눠눦녥댢걯닢건늆넠덶구닂밎 Explanation 눰 감下 For n from 99 down to 1 ...

posted 3y ago by Moshi‭

Answer
60%
+1 −0
Challenges It's Hip to be Square

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.

posted 3y ago by Moshi‭  ·  last activity 3y ago by Moshi‭

Answer
80%
+6 −0
Q&A Getting started with making (and/or solving) KOTH challenges

About King of the Hill King of the Hill (KoTH) is a relatively straightforward concept: Entrants create bots; bots compete against each other. Making a KoTH challenge The exact details of the co...

posted 3y ago by Moshi‭

Answer
71%
+3 −0
Challenges Three Number Monte

MoshiBot from numpy.polynomial import Polynomial def MoshiBot(data, history): if len(history) < 10: return [180, 180, 0] lastmin = min(history[-1]) lastmid = sorted(history[-1])[1] ...

posted 3y ago by Moshi‭

Answer
77%
+5 −0
Meta Is it good practice to change the names of variables in challenges?

Yes Unless the challenge tells you what to name your function, you're free to use anything. This means that single character names are usually the best option. Note that anonymous function submis...

posted 3y ago by Moshi‭

Answer
60%
+1 −0
Challenges 1, 2, Fizz, 4, Buzz!

Sclipting, (UTF-16) 62 bytes 감 뉀上標❷갰剩虛끦땺뎠嗎❸걐剩虛뀧녺뎠嗎併梴是⓶終丟終并겠會

posted 3y ago by Moshi‭

Answer
75%
+7 −1
Meta Default Rules: Code Golf I/O

Unless explicitly asking for exactly two values, you may use any truthy/falsey values in decision problems For instance, considering the hypothetical challenge "Determine if a number is non-divisi...

posted 3y ago by Moshi‭

Answer
60%
+1 −0
Challenges Cumulative Counts

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!

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

Answer
80%
+6 −0
Meta Default Rules: Libraries

Language + libraries count as a separate language In the header of your entry, you should have something like this: C (clang) + <libraries>, <byte count> You do not need to inclu...

posted 3y ago by Moshi‭

Answer
77%
+5 −0
Meta Default Rules: Libraries

How should we deal with golfing libraries when scoring entries? Continuation of Is my extension-like library allowed to be used in answers?, the answer to that question seems to be a "yes", now we...

1 answer  ·  posted 3y ago by Moshi‭  ·  edited 3y ago by Quintec‭

Question default-rules
83%
+8 −0
Meta Default Rules: Flags and Other Compile-Time Options

I say we follow the established rules on SE: Rather than dealing with inconsistent schemes for adding flags, let's just consider each separate invocation of a compiler/interpreter/whatever a sep...

posted 3y ago by Moshi‭

Answer
77%
+5 −0
Meta Default Rules: Flags and Other Compile-Time Options

How should we deal with flags / command line options when scoring entries?

2 answers  ·  posted 3y ago by Moshi‭  ·  last activity 3y ago by Quintec‭

Question default-rules
77%
+5 −0
Challenges Add two negabinary integers

About Negabinary Negabinary means base negative two (-2). That is, the $n$th place value is determined by $(-2)^n$. Negabinary numbers can be evaluated just like any other base system. For exampl...

3 answers  ·  posted 3y ago by Moshi‭  ·  last activity 3y ago by Shaggy‭

Question code-golf math
66%
+2 −0
Challenges Shuffle a subset of a list

JavaScript (Node.js), 75 68 bytes -7 bytes thanks to Hakerh400 (a,b)=>b.map(i=>[a[i],a[j]]=[a[j=b[Math.random()*b.length|0]],a[i]]) Try it online! Basic random swap algorithm. Unfortuna...

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

Answer
83%
+8 −0
Meta Code Golf leaderboard: Scoring tags?

Currently, the leaderboard is useless on alternative-scoring challenges. In order to make the leaderboard more flexible, I propose the creation of two new tags: "lowest-score" and "highest-score"....

0 answers  ·  posted 3y ago by Moshi‭  ·  edited 3y ago by Moshi‭

71%
+3 −0
Challenges Multiply complex numbers.

JavaScript (Node.js), 99 96 69 bytes s=>([a,b,c,d]=s.match(/-?\d+/g),a*c-b*d+(a=a*d+b*c,a<0?'':'+')+a+'i') Try it online! This regex is probably the best way to get the numbers. Also, f...

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

Answer
71%
+3 −0
Sandbox Add two negabinary integers [FINALIZED]

posted 3y ago by Moshi‭  ·  edited 11mo ago by trichoplax‭

75%
+4 −0
Challenges Evens or Odds - you know this one

JavaScript (Node.js), 6 bytes n=>n%2 Try it online! Basically does what you'd expect.

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

Answer
71%
+3 −0
Challenges Ratio limits of fibonacci-like series

JavaScript (Node.js), 27 22 bytes -5 bytes thanks to Hakerh400‭ Direct computation f=n=>(n+(n*n+4)**.5)/2 $$\frac{n+\sqrt{n^2+4}}{2}$$ Try it online!

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

Answer
77%
+5 −0
Challenges Is it a near-anagram?

JavaScript (Node.js), 131 bytes Returns true and false g=(s,t,c=[...t])=>([...s].forEach(v=>(y=c.indexOf(v),c.splice(y,y>=0))),c) f=(s,t)=>(x=g(s,t).length)<2&&(y=g(t,s).l...

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

Answer
50%
+0 −0
Challenges Prime Difference

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

posted 3y ago by Moshi‭

Answer
77%
+5 −0
Challenges Reverse an ASCII string

C, 66 59 bytes -7 bytes thanks to Lundin! In-place string reversal f(char*s){s[1]?f(s+1):0;for(char t=*s;s[1];*++s=t)*s=s[1];} Try it online!

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

Answer
50%
+0 −0
Challenges Shape of an array

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

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

Answer
71%
+3 −0
Challenges Length of a Sumac Sequence

JavaScript (Node.js), 27 25 bytes (-2 thanks to JoKing) f=(a,b)=>a<0?0:1+f(b,a-b) Try it online!

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

Answer