I hate having to use a custom close reason for something that's blatantly off topic. I really don't think sending the latest one off to SO is going to be productive, though. It'd be nice to have a sub-reason listed exactly like the initial off topic description:
> This question does not appear to be about programming puzzles or code golf within the scope defined in the help center.
@Dennis Makes sense. You must have a way with languages, given that you're from Germany, speak flawless English, and live in a Spanish-speaking country.
@Geobits SO used to have a close reason like that but one day it vanished.
Imperative... Functional… Object-Oriented... Symbolic. Long ago, the four programming paradigms lived together in harmony. Then everything changed when the Golfing Languages attacked. Only the Geobits, master of all four paradigms, could stop them. But when the world needed him most, he vanished.
So, blatantly plagiarizing from inspired by this challenge and its sequel, I thought I'd add another.
The text to match:
What do you get when you multiply six by nine
The result your function/program/etc. should print or return:
42
An online calculator for Levenshtein distance can b...
I don't know if I ever put this in the sandbox, but I had an idea once for code-gofl
The challenge is comprised of two sub-challenges. Your goal is to write two programs to solve the challenges, minimizing not only their length but the distance between them.
I believe the scoring was length of longer program + distance to shorter program
Yeah, I think so. I think the other proposal was some kind of product of distance and shortness, so it was a bit more gimmicked. I can't find it right now.
This is a new kind of challenge inspired by the Recover the mutated source code problem.
You should write two programs or functions both in the same language. The first one should solve Task #1 and the second one should solve Task #2.
Your score will be the sum of the longer program and the Le...
I always thought it was a little odd that American means "from the USA", given that America is the continent. The proper demonym is US-Amerikaner in German.
@AlexA. I guess you could call it arrogance. Or realize that most countries do the same thing. The United States part is like the Federal Republic part for Germany, or the People's Republic for China, etc. Nobody says them, it's just German or Chinese.
The only arrogant part came long ago, when we namedourselves after the continent itself ;)
Fun fact: The question mark in b?t can be replaced with any vowel (aeiou) and still form a valid word. What other three-letter patterns share this property?
@Calvin'sHobbies The best you can get with SOWPODS is 15 for M.N.S : MANAS, MANES, MANIS, MANOS, MANUS, MENES, MENUS, MINAS, MINES, MINIS, MINOS, MINUS, MONAS, MONOS, MUNIS
Save the bunny!
This King of the Hill competition is about a 2D flawn populated with bouncing balls and bunnies. The balls will collide with each other and the boundaries. If a bunny gets hit by a ball, it´s dead teleported away (for cuteness sake).
Your task is to write a AI for the bunnies, su...
A stretchy snake looks something like this:
<||=|||:)~
Each separate sequence of vertical bars (|) in a stretchy snake, known as a stretchy portion, is individually extendable to twice its width, and is drawn with alternating slashes (/,\) once extended.
The particular snake above has two suc...
@MartinBüttner for Retina an "exit on match" while loop might be nice e.g. [`.... ]`condition_regex for cases when you can't stop easily the effect of the loop regexes
a while back I suggested a challenge where I'd add graphical output to the GOLF, allowing people to write graphical demos, and making a popularity contest of the coolest demo in under 4KiB
but it was met with resistance, as not having a clear winning condition
@orlp GOLF has merit in scoring algorithms precisely, I think in a pop-con it loses this advantage, and is basically the same as image in X language, Y bytes (still could be interesting this is just one viewpoint)
Personally, I think that questions like Tweetable Maths should still be on topic here. A pretty insane amount of golfing went into several of those answers.
yeah if we had given tweetable maths a 4KiB limit, then it wouldn't really be much of a programming challenge. The size limit should be set low enough that almost every interesting submission barely fits.
@MartinBüttner My empirical rule of thumb is that if the question is closed quickly enough then the site policy is followed, but it's open long enough to hit the HNQ then there will be enough people with reopen votes who think that coolness is reason enough to keep it open that it will never stay closed.
I don't think tweetable maths was ever acceptable as a matter of policy, but I don't think that the voter pool has changed significantly since then so if it were posted for the first time today I expect that the outcome would be the same.
You are a space tourist on your way to planet Flooptonia! The flight is going to take another 47,315 years, so to pass the time before you're cryogenically frozen you decide to write a program to help you understand the Flooptonian calendar.
Here is the 208-day long Flooptonian calendar:
Month ...
hey, I've got an idea for a programming language. What if you could store code in a variable (like a function), but then be able to modify that code at a later point?
One option is to store the code as a string and execute it later with eval. Another option is to store a function, toString() it, parse the result, and then modify that... The second option is less portable.
Why does it matter if it's internally mutable or not if the behavior is the same?
I've never had qualms about using a+="ed" or whatever to concat strings (in many languages at least). It's not the same string, but it doesn't matter 99% of the time.
I could reference a mutable function to lots of places, and then modify it, and those changes would spread to everywhere else
rather than making a function that at runtime changes its nature (through if statements and such), you can make a function that is changed before it is run
In computer science, self-modifying code is code that alters its own instructions while it is executing - usually to reduce the instruction path length and improve performance or simply to reduce otherwise repetitively similar code, thus simplifying maintenance. Self modification is an alternative to the method of "flag setting" and conditional program branching, used primarily to reduce the number of times a condition needs to be tested. The term is usually only applied to code where the self-modification is intentional, not in situations where code accidentally modifies itself due to an error...
Hmm. Think of your code as a set of statements. After each is run, the interpreter jumps to a (psuedo)random one based on a supplied seed. So, to have it run "correctly", you need to know the correct seed (or find a collision).
I did actually have an idea, using about 4 extra layers of abstraction.
- Use GoL cells to create the big, customizable-rule meta-cells. - Use sets of meta-cells to create giant cells that work like wireworld wires - Use the wireworld wires to build a computer - Program the computer to have tetris
The metapixel can be programmed with any "life-like" rule (two states, 8 neighbors). The next hurdle is that wireworld does not fall into that category.
Which is why I need the next level of abstraction to create a functional "wire" with them. Thankfully, each metapixel can be programmed to have a different life-like rule.
I see some of these questions and I'd really like to get C++ involved. However the language is (as it turns out!) quite verbose.
So I propose that we be allowed to implicitly include a bunch of defines that shorten what we need into 1 character. For example:
#define C class
#define M int main(...
Now you've brought "defining a new language" into this - Grr! Can you lock a thread so only people who understand the topic can contribute? — Alec Teal3 mins ago
... says the guy with zero answers in the [code-golf] tag?
I've just come up with this ugly fella:
function fb() { return [3=>($f="fizz"),6=>$f,12=>$f,5=>$b="buzz"),15=>$f.$b]+array_fill(0, 15, null); }
function f($i) { return fb()[$i&15]?:$i; }
echo join(PHP_EOL, array_map("f", range(1,100)));
Can anybody come up with an even shorter way to generate...
@xnor Alternatively, by the letter of the rules here once it's posted it doesn't belong solely to the OP any more. This would be bound to piss people off in most cases, though ;)
Quit Whining and Quine code-golfquine
Goal:
Write a function or program that, given an integer n, will output a program.
Description of Output Program:
The output program needs to be a program that, when run, ... will output a program... that will output a program... etc, until the nth progra...