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
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 3y ago by Moshi‭  ·  last activity 1y ago by aspen138‭

Question code-golf math
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‭

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
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 3y ago by Moshi‭  ·  last activity 1y ago by RubenVerg‭

Question code-golf random
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
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 3y ago by Moshi‭  ·  last activity 3y ago by dzaima‭

Question default-rules
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
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
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
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 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 4y ago by Moshi‭  ·  edited 4y ago by Moshi‭

Answer
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
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 4y ago by Moshi‭  ·  edited 4y ago by Moshi‭

Answer
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 3y ago by Moshi‭

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

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

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

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

75%
+4 −0
Sandbox From the smallest seed

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 3y ago by Moshi‭

Answer
75%
+4 −0
Sandbox Compute the determinant

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

Article code-golf math
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
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 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 3y ago by Moshi‭  ·  last activity 3y ago by radarek‭

Question code-golf sorting
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 3y ago by Moshi‭  ·  edited 3y 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 3y 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‭