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
50%
+0 −0
Challenges Expand a polynomial

JavaScript (Node.js), 58 bytes ([x,...r],y)=>x?[0,...y=f(r)].map((v,i)=>v-x*(y[i]|0)):[1] Try it online!

posted 2y ago by Moshi‭

Answer
66%
+2 −0
Challenges Decode periodic decimal fractions

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

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

Answer
66%
+2 −0
Challenges Abbreviate everything

JavaScript (Node.js), 91 68 65 bytes s=>s.toUpperCase().match(/(?<=^| )[A-Z]|:|;|(?<=[.?!]) /g).join`` Assumes that the original text is properly formatted (has a space after punctuati...

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

Answer
66%
+2 −0
Challenges Expand a polynomial

Challenge Given the roots of a polynomial (that is, the $x$ values where the polynomial evaluates to zero), as an array of real numbers, return the polynomial's coefficients. That is, given real ...

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

Question code-golf math
66%
+2 −0
Challenges Reverse an ASCII string

Sclipting, (UTF-16) 2 bytes 反 Yay for builtins~

posted 2y ago by Moshi‭

Answer
71%
+3 −0
Challenges Stairs? Stairs! Stairs.

Python 3, 64 bytes def f(n): for i in range(n):print((' '*(n-i)+'_/'+'##'*i)[3:]) Try it online!

posted 2y ago by Moshi‭

Answer
71%
+3 −0
Challenges When The Ternary Is Balance

JavaScript (Node.js), 47 40 50 49 bytes -1 (possibly -3) bytes thanks to Shaggy! f=(n,s='0')=>n?f(n/3+n%3/2|0,'')+"+-0+-"[n%3+2]:s Try it online! A basic recursive solution.

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

Answer
60%
+1 −0
Challenges "Hello, {name}!"

Sclipting, (UTF-16) 14 bytes 낆녬닆묬글⑴긐

posted 2y ago by Moshi‭

Answer
71%
+3 −0
Challenges Generalized Sort

Challenge We all know and love the generic sort function, right? However, it only sorts based off one criterion - what if we want more? That's where you come in. Your task is to sort an array bas...

6 answers  ·  posted 2y ago by Moshi‭  ·  last activity 2y ago by radarek‭

Question code-golf sorting
75%
+4 −0
Sandbox Expand a polynomial [FINALIZED]

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

75%
+4 −0
Meta Posting guidelines modifications

Since no one has posited anything yet... I think everything but the last three bullets can be kept. Other than that, we could add in the tips about challenge specifications. Challenges Posting...

posted 2y ago by Moshi‭

Answer
60%
+1 −0
Challenges Make my value binary

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

posted 2y ago by Moshi‭

Answer
50%
+0 −0
Challenges "Hello, World!"

Sclipting, (UTF-16) 18 bytes 낆녬닆묬긅덯댦롤긐 Since it hasn't been added yet.

posted 2y ago by Moshi‭

Answer
66%
+2 −0
Challenges Compute the determinant

C, 147 bytes float d(float**m,int r){if(r<2)return**m;int i=r,j;float s=0,*n[--r];for(;i--;s+=(i%2?-1:1)**m[i]*d(n,r))for(j=r;j--;)n[j]=m[j+(j>=i)]+1;return s;} Try it online! Basically ...

posted 2y ago by Moshi‭

Answer
83%
+8 −0
Challenges Compute the determinant

Challenge A simple challenge: Given a two-dimensional matrix (an array of arrays) of real numbers, compute the determinant. The determinant of a matrix is a mathematical construct used in many ap...

9 answers  ·  posted 2y ago by Moshi‭  ·  last activity 1y ago by aspen138‭

Question code-golf math
60%
+1 −0
Sandbox Generalized Sort

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

60%
+1 −0
Challenges My house is destroyed! Can you make me one?

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.

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

Answer
81%
+7 −0
Challenges Roll n fair dice

Challenge This is a simple randomness challenge: Given a non-negative integer $n$, and positive integer $m$, simulate rolling and summing the results of $n$ fair dice, each of which have $m$ sides...

10 answers  ·  posted 2y ago by Moshi‭  ·  last activity 10mo ago by RubenVerg‭

Question code-golf random
60%
+1 −0
Challenges In The Jailhouse Now

Sclipting, (UTF-16) 80 bytes 갰減먩놔 먩놦①復먩놗겮꺕똀 먩놬①復①增疊먩놣겮꺕똀會먩놣겮꺕떠 먩놩⑴復먩놝 Explanation Input n pushed on stack 갰減 Subtract 3 먩놔 "╔" 먩놦 "╦" ①復 String of above repeat...

posted 2y ago by Moshi‭

Answer
50%
+1 −1
Meta Default Rules: Extensions

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

posted 2y ago by Moshi‭

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

Since there have been some discussions about the use of GCC extensions, I decided to make a default-rules post about it. How should we deal with compiler extensions to languages?

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

Question default-rules
66%
+2 −0
Challenges Coat of Many Colours

C (gcc), 301 bytes Function taking in an array of null-terminated strings and the array's length. #include <string.h> #include <stdlib.h> char*s="edellowreenrowncarletlackchreachuby...

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

Answer
75%
+4 −0
Sandbox Compute the determinant

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

Article code-golf math
75%
+4 −0
Challenges Coat of Many Colours

JavaScript (Node.js), 153 147 bytes -6 bytes thanks to Shaggy! a=>a.sort((x,y)=>g(x)-g(y),g=x=>"y gree br sc bla oc pe rub ol v f li go ch m cre c s ro a l ru g pu w p o b".split` `.find...

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

Answer
60%
+1 −0
Challenges A chunk of symbols is a calculation

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

posted 3y ago by Moshi‭

Answer