Replace all instances of first bracket type recursively until no more can be found. Then do the same for the next bracket type. And so on. It won't go back and check if replacements of the 2nd bracket type creates possible matches of the first bracket type to replace.
@Riley The code linked in that post is old and has been changed quite a lot since then.
JS in general is pretty decent for a language that was thrown together in 10 days, and for a while had various interpreters supporting completely different features, and even giving different results for the same features
The keyboard layout people commonly use is the QWERTY layout as shown below.
But there are also other keyboards layouts :
DVORAK
COLEMAK
WORKMAN
YOUR TASK
Your code will take two inputs : the name of the keyboard layout and a string.
Your goal is to convert your qwerty input as if y...
What I want:
Take an input, x
Take a formula. It has to be capable of reading something in the format:
ax^m + bx^n + cx^o ... where m, n, o and any terms after that can represent any value.
coefficients, again for any number. For example, 6x^2. (That means 6(x^2))
Doesn't necessarily have ...
Variably Incremented Chained Ranges code-golf
Your task will be, given a well-formed input string s, to parse it as a range, with special properties:
A traditional range is defined as a..b = [a, a+1, .., b-1, b].
An incremental range is an extension of the traditional range in the format a.c....
(there's also ", which vectorizes both at once by doing the operation on corresponding elements, and þ, which vectorizes both individually, leading to a square matrix output)
Your task is to find the nth Fibonacci number, but n is not necessarily an integer.
The Fibonacci sequence, 0-indexed, goes as follows:
0, 1, 2, 3, 4, 5, 6, 7, ...
1, 1, 2, 3, 5, 8, 13, 21, ...
However, what happens if we want the 2.4th number?
The 2.4th number is 0.4 times the differenc...
it's normally easier to use a mod flag (or obsolete flag, but a mod flag works better if there are lots of comments to be affected) for that sort of request; that way you don't have to wait for any particular mod to be online, and it's all tracked by the flagging system rather than needing chat to understand what's going on
As you are maybe aware by now, Brain-Flak's Birthday is coming up soon! This is the third challenge leading up to the big event. Find out more here.
Challenge
For this challenge your objective will be to find the very first pair of matching brackets in a fully matched string of ()[]{}<> bra...
@Dennis Thx for the reminder that that's a thing. It isn't enabled by default on eOS. Got me 3GB more free memory w/o any noticable performance impact (on a Core 5 M)
OEIS A071816 - Equality Comes in Threes
Your task, given an upper bound of n, is to find the number of solutions that satisfy the following equation:
a+b+c = x+y+z, where 0 <= a,b,c,x,y,z < n
The sequence starts out as described on the OEIS page, and as below:
1, 20, 141, 580, 1751, 4332, 93...
@EriktheOutgolfer I know :) I can't get it to work in a buggy Octave-version, and I'm unsure if it would work in other languages... (My programming knowledge is very limited)
MicroVersion: Planned service degradation: All Stack Overflow/Stack Exchange sites read-only for 20 minutes on Wed, May 3, 2017 shortly after midnight UTC (8PM US/Eastern). If you blink, you'll miss it.
Short version:
There will be a service degradation for up to 20 minutes shortly after midnig...
This is a variant on the self-replicating program, defined here as a program that outputs its source (or a quine). Below is an example of a self-replicating program in Python:
s = 's = %r\nprint(s%%s)'
print(s%s)
When run from a file, this script should output itself.
Instead of a self-replic...
@HyperNeutrino Allowed, yes. Required, no. Also, if it quickly (two or three iterations) returns to its original state, I would consider that less interesting.
But obviously that last bit is subjective.
user165474
Yes. Okay. I think it's clear; I will re-open nominate it.
It can receive and send if you spawn a process or handle it with process.on IIRC
Anonymous
Spawn a thread that waits for a certain amount of time then sends SIGALRM to the main thread, main thread handles SIGALRM by terminating the function call
Im wondering how steam knows Im playing a game so it can start itself first.How do you add your code into compiled app?
what is this called? How can I learn it? where can I learn it?
@ETHproductions this is arguably an FGITW problem; people giving stock close reasons that don't quite fit are going to be able to press the "close" button faster than people typing out custom reasons
hmm, perhaps we should allow close votes beyond 5 to be cast, and to be able to change the close reason
Im wondering how steam knows Im playing a game so it can start itself first.How do you add your code into compiled app?
what is this called? How can I learn it? where can I learn it?
1 : Accept (+2 if you accept, +15 if your answer is accepted)
2 : Upvote (+5 for question, +10 for answer)
3 : Downvote (-1 if you downvote answer, -2 if you get downvoted)
4 : ?
5 : ?
6 : ?
7 : ?
8 : Give bounty
9 : Receive bounty
16: Approved edit (+2)
Anyone know what the missing ones are, or if they exist at all?
@StewieGriffin Maybe one of them is serial vote reversal?
Anonymous
Though I've had serial vote reversal happen to me (both positive and negative), but I didn't find anything other than the ones you listed as known on my page
If a string in a stack-based language pushes the individual chars to the top of the stack, would it be more convenient for the first char to go on the bottom and the last on the top, or reversed?
== Physical limits ==
There are several physical and practical limits to the amount of computation or data storage that can be performed with a given amount of mass, volume, or energy:
The Bekenstein bound limits the amount of information that can be stored within a spherical volume to the entropy of a black hole with the same surface area.
Thermodynamics limit the data storage of a system based on its energy, number of particles and particle modes. In practice it is a stronger bound than Bekenstein bound.
Landauer's principle defines a lower theoretical limit for energy consumption: kT ln 2 joules...
Taken from: OEIS-A071816
Your task, given an upper bound of n, is to find the number of solutions that satisfy the equation:
a+b+c = x+y+z, where 0 <= a,b,c,x,y,z < n
The sequence starts out as described on the OEIS page, and as below (1-indexed):
1, 20, 141, 580, 1751, 4332, 9331, 18152, 32...
The Median of Practically Recreational Quines
According to the TIO Nexus there are two types of programming languages:
Practical (seen in many corporate environments as a development standard).
Recreational (if seen in a corporate environment, you're probably fired).
Your task here is to mix...
Your task is to write a program that outputs the exact string "Programming Puzzles" (trailing newline optional), but when all spaces, tabs, and newlines are removed it outputs "Code Golf" (trailing newline optional.)
Your byte count is the count of the first program, with spaces still there.
G...
@programmer5000 While I personally understand what you're asking for, it wouldn't hurt to add an extra paragraph or two to the explains that explains what exactly you are asking for. Some pseudocode, maybe.
@programmer5000 any additional content you can add that is non-contradictory always seems to be useful to the challenge. Formatting is also key, if it looks like you put less work into your question than the others, I feel like it's more likely to recieve a close vote. Also, the simple fact that "output a string" has been done before may be the reason for many of those votes.
Even explaining the fact that capitalization of the P, G and C, G would be a boon to the question itself.
Ooo... I see the option when clicking on you, but when visiting a user's profile, there is nothing to speak of to generate a room. I've had people make rooms for me when I've asked a complex question requiring a chat, but want to know how to do the same for new users asking complex questions in the SE.
Your task is to write a program that outputs the exact string "Programming Puzzles" (trailing newline optional), but when all spaces, tabs, and newlines are removed it outputs "Code Golf" (trailing newline optional.)
Your byte count is the count of the first program, with spaces still there.
N...