Posts by Moshi
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...
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"....
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...
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...
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...
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?
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...
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...
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...
How should we deal with flags / command line options when scoring entries?
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!
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...
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...
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...
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...
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...
JavaScript (Node.js), 6 bytes n=>n%2 Try it online! Basically does what you'd expect.
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...
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.
Python 3, 64 bytes def f(n): for i in range(n):print((' '*(n-i)+'_/'+'##'*i)[3:]) Try it online!
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...