538
\$\begingroup\$

This "sandbox" is a place where Code Golf users can get feedback on prospective challenges they wish to post to main. This is useful because writing a clear and fully specified challenge on your first try can be difficult, and there is a much better chance of your challenge being well received if you post it in the sandbox first.

Sandbox FAQ

Posting

To post to the sandbox, scroll to the bottom of this page and click "Answer This Question". Click "OK" when it asks if you really want to add another answer.

Write your challenge just as you would when actually posting it, though you can optionally add a title at the top. You may also add some notes about specific things you would like to clarify before posting it. Other users will help you improve your challenge by rating and discussing it.

When you think your challenge is ready for the public, go ahead and post it, and replace the post here with a link to the challenge and delete the sandbox post.

Discussion

The purpose of the sandbox is to give and receive feedback on posts. If you want to, feel free to give feedback to any posts you see here. Important things to comment about can include:

  • Parts of the challenge you found unclear
  • Comments addressing specific points mentioned in the proposal
  • Problems that could make the challenge uninteresting or unfit for the site

You don't need any qualifications to review sandbox posts. The target audience of most of these challenges is code golfers like you, so anything you find unclear will probably be unclear to others.

If you think one of your posts needs more feedback, but it's been ignored, you can ask for feedback in The Nineteenth Byte. It's not only allowed, but highly recommended!

It is recommended to leave your posts in the sandbox for at least several days, and until it receives upvotes and any feedback has been addressed.

Other

Search the sandbox / Browse your pending proposals

The sandbox works best if you sort posts by active.

To add an inline tag to a proposal use shortcut link syntax with a prefix: [tag:king-of-the-hill]. To search for posts with a certain tag, include the name in quotes: "king-of-the-hill".

Get the Sandbox Viewer to view the sandbox more easily!

\$\endgroup\$
0

3548 Answers 3548

-2
\$\begingroup\$

Feedback Wanted

  • Is this too vague? should I change it to something like "create a quine with the fewest unique bytes", or perhaps adapt another existing challenge that might otherwise use lots of repeated bytes?
  • Maybe the idea is just too boring on its own and I should create a new proper challenge based around it?
  • Should I change the scoring system (votes - unique_bytes) - should it be divided instead, or use a more complex formula?

Introduction

This is , but not as you know it. Instead of every byte, This is sort-of also a question.

Challenge

Write an interesting program that uses the fewest unique bytes. This is not really about what the program does, but what you can do with a limited set of characters.

Rules

  • Your program must run on Try It Online
  • Programming languages with only a few permissible bytes anyway like Brainfuck's +-.,[]<>, are allowed, but officially considered boring

Apart from this, you can write anything.

Scoring

  • Hybrid of and "fewest-unique-bytes". Score is calculated as votes - unique_bytes
  • Unique bytes is based on bytes, not characters or whatever. You can calculate unique bytes using this Python snippet: len(set(b"your code here"))
\$\endgroup\$
4
  • 4
    \$\begingroup\$ It's definitely too vague. "Interesting" could mean anything, and you'd have to argue with several people over whether their ignore-input-and-print-0 program counts as interesting before the challenge is closed as too broad or unclear. [popularity-contest] is also a dangerous tag, in that it's very hard to do well and has fallen out of favor long ago. This extends to all scoring systems that involve votes. \$\endgroup\$
    – Zgarb
    Aug 21 '20 at 19:33
  • 1
    \$\begingroup\$ I think this idea has been largely covered by Fewest (distinct) characters for Turing Completeness. Many languages require surprisingly few characters to run arbitrary code, so I expect there's not much interesting room for specific programs that use fewer characters than needed for that. \$\endgroup\$
    – xnor
    Aug 21 '20 at 22:39
  • 1
    \$\begingroup\$ As far as I remember, there exists a Lenguage quine (that uses only 1 unique byte). I think combining popularity-contest with something else is even worse than simply using popularity-contest. \$\endgroup\$ Aug 22 '20 at 3:00
  • 1
    \$\begingroup\$ For future reference, start your sandbox entries with the title of your challenge rather than a generic "feedback wanted". It's the prevailing convention and doing something different is a little confusing to scroll past. \$\endgroup\$
    – Beefster
    Aug 24 '20 at 16:18
-2
\$\begingroup\$

Solving P=NP!

Today, we are going to solve P=NP, kinda...

Input

A guaranteed prime positive integer, P.

Output

The smallest composite number (NonPrime,NP) which sum of digits equals P.

Examples

Input (P)    Output (NP)      Why? (for reference)
  2              20          2+0=2 and 11 is prime
  3              12                 1+2=3
  5              14                 1+4=5
  7              16                 1+6=7
  11             38          3+8=11 and 29 is prime
  13             49                 4+9=13
  17             98          9+8=17 and 89 is prime

Check OEIS A073868 for more results.

Challenge

Write a function or program that, given a positive prime number P as input, calculates NP, the smallest composite number which sum of digits equals P.

  • Range of input: any integer prime number greater than 1, up to the limit of the chosen language.
  • Range of output: also according to the limits of the chosen language.
  • Means of input/output: free to choose.

Winning condition

This is a challenge. The shortest code wins!

Tags

Meta

I have searched if this was already posted, but with no success.

\$\endgroup\$
2
  • 1
    \$\begingroup\$ To me, this isn't all that interesting of a challenge because it's a mash-up of "find a number whose digit sum is X" and "check if a number is prime." If a language has a built-in for primality, it's done. If not, it's still been done over and over again. The fact that the input is prime doesn't really add anything here for me. And skipping over primes as possible answers doesn't either. Why not do "find the smallest number whose digits add to X?" or "Find the Yth number whose digits add to X" where both x and y are inputs? \$\endgroup\$
    – Xcali
    Dec 23 '20 at 20:37
  • \$\begingroup\$ The challenge itself looks to be well specified but I dislike the title. I'm all for using clever/controversial titles to attract attention, but not at the expense of accurately conveying what the challenge is about. \$\endgroup\$
    – Dingus
    Jan 1 at 1:38
-2
\$\begingroup\$

Enumerate all possible IPv4 addresses

Title might make the challenge hard, but it's easy.

You have to print all the possible IPv4 addresses from 0.0.0.0 to 255.255.255.255

Standard loopholes apply, no internet usage for this

Tags: ,,

\$\endgroup\$
2
-2
\$\begingroup\$

English Grammar Checker

Being tired of checking English grammar, I decided to write an English grammar regular expression.

Notations

  1. All capital letters denote an expression.
  2. Quoted strings (like "a") and lower-case letters denotes literals.
  3. AB means concatenating expressions / literals A and B together.
  4. (...) groups the expression inside the parentheses, as a whole expression.
  5. A* means repeating the expression A zero or more times.
  6. A? means the expression A is optional here.
  7. A|B means either A or B can be placed here.
  8. A=B means all expression A should be replaced by B.

Grammatical Rules

Parts of Speech

For simplicity, all parts of speech are substituted using symbols.

Symbol Part of Speech
a article
b verb
j adjective
m numeral
n noun
r pronoun
v adverb

Rules

There's a whole bunch of rules in English grammar. For simplicity, I only chose a tip of the iceberg. Your RegEx should only match all valid S's.

  1. S=N+V
  2. N=((a|m)?j*n(pN)?)|r
  3. V=b((pN)*|N)?v?

Examples

These should be matched Real-life example
anb The man runs
rbpajjnv He dives into the deep blue sea quickly
anpanbpr The wave on the sea came towards me
mnpambv Two friends of the man walks slowly
anpmjjnbajjnv The robot of two tall thin girls greets the young handsome man repeatedly
These shouldn't be matched Real-life "wrong" sentences example
nn Man child
nabr Student a told me
arbv The you laughed happily
anbvv The woman sang slowly beautifully
rbvj He is very funny

Notice that the last example is a valid English sentence, but it doesn't match our simplified rules. You shouldn't match them.

Tips

You can assume that there's no whitespaces and line feeds in the input.

You can assume that you only need to match 1 input per time.

You can use any RegEx dialects no newer than this challenge.

Scoring

Your score is the bytes in your RegEx. Flags are not counted.

The least score wins!

\$\endgroup\$
18
  • 3
    \$\begingroup\$ Are you sure that this grammar is really decidable with a regex? \$\endgroup\$
    – DELETE_ME
    Feb 19 at 9:12
  • \$\begingroup\$ YES @user202729 and I've already made one; but not decided to make it public yet. \$\endgroup\$ Feb 19 at 9:14
  • \$\begingroup\$ It's better if you explain what format the rules are specified in. (while I can understand it, it isn't obvious) The standard is Backus-Naur form I guess? \$\endgroup\$
    – DELETE_ME
    Feb 19 at 9:20
  • \$\begingroup\$ Any dialect restriction? \$\endgroup\$
    – DELETE_ME
    Feb 19 at 9:21
  • \$\begingroup\$ I wrote the format for rules in Notation section; is it unclear? \$\endgroup\$ Feb 19 at 9:22
  • \$\begingroup\$ Originally I overlook that = can be recursive and I can't find capital N in the table. \$\endgroup\$
    – DELETE_ME
    Feb 19 at 9:24
  • \$\begingroup\$ Err, yes, but I don't have good ideas about how to explain ='s. It's just kind of, substitution? But it can be recursive? Anyone have ideas? \$\endgroup\$ Feb 19 at 9:26
  • \$\begingroup\$ Perhaps you can show an example of a simple (recursive) pattern matching a simple string. \$\endgroup\$
    – DELETE_ME
    Feb 19 at 9:30
  • \$\begingroup\$ Not sure if you're asking an example regex matching a recursive rule. For A=(yA)|x using the same notation, regex: y*x. \$\endgroup\$ Feb 19 at 9:37
  • \$\begingroup\$ Does "without flags" mean ", flags are not counted"? That sentence can be interpreted as "regex flags are not allowed" too. \$\endgroup\$
    – DELETE_ME
    Feb 20 at 8:44
  • 2
    \$\begingroup\$ English grammar is not regular and cannot be matched with a regular expression. At best, you can tease out some subset that is context-free, but realistically, this is not a good challenge as it is written. Natural languages tend to be riddled with all sorts of crazy complexity that makes them highly context-sensitive and possibly undecidable. \$\endgroup\$
    – Beefster
    Feb 22 at 16:55
  • 1
    \$\begingroup\$ @Beefster As I wrote in the challenge you should only match the simplified "rules", as in section Rules. There're only 3 rules. As I commented before I already wrote a regex that can match these rules, so the challenge is absolutely solvable. \$\endgroup\$ Feb 23 at 2:54
  • \$\begingroup\$ @Beefster And op did do that. (op claim that the chosen subset is context-free, but I didn't verify it) \$\endgroup\$
    – DELETE_ME
    Feb 24 at 3:52
  • \$\begingroup\$ @user202729 if you want to verify, <S> ::= <N><V>, <J> ::= "j"<J> | "", <N> ::= "r" | "a"<J>"np"N | "a"<J>"n" | "m"<J>"np"N | "m"<J>"n" | <J>"np"N | <J>"n", <P> ::= "p"N<P> | "", <V> ::= "b" | "bv" | "b"<N> | "b"<N>"v" | "b"<P> | "b"<P>"v". Really verbose. \$\endgroup\$ Feb 24 at 4:08
  • \$\begingroup\$ Even with this limited subset, reducing it to a regex really only has one optimal approach and isn't particularly interesting in lending itself to many different approaches. \$\endgroup\$
    – Beefster
    Feb 24 at 16:31
-2
\$\begingroup\$

Given a positive even integer \$n\$, generate a random Brainfuck snippet of length \$n\$, containing only +-<>, that do no modify to the tape or tapehead.

To avoid random generation and try again or fallback into a trivial nop for invalid nops, your solution should run in polynomial time, and the ratio of possibility returning any two nops should be below polynomial.

\$\endgroup\$
-2
\$\begingroup\$

Compress La Campanella.

Notice that music theory may give you more rules than general compress give, but I don't know music theory that much, so I won't post this

\$\endgroup\$
-2
\$\begingroup\$

Self-Obfuscator Program

According to Wikipedia,

obfuscation is the deliberate act of creating source or machine code that is difficult for humans to understand.

In this challenge, you need to create a program that'll be able to obfuscate itself and produce a program with the same functionality, using the shortest amount of bytes required.

Rules

  • Standard loopholes are prohibited.
  • The output must always be consistent for each input. If you take the original code (iteration 0) and run it through itself 10 times to get a very long obfuscated code (iteration 10), running the initial code through it should give a code identical to iteration 1 code.
  • The output must be at least twice as long from the input for each iteration.

Obfuscated, not verbose

  • The obfuscation process must make the code longer, but it mustn't add any comments, no-op or no-effect statements, or any statements or expressions that don't directly affect the output code.
  • The output should have minimal resemblance to the input. No sequence of 5 bytes should repeat in the output.
  • The code must be able to obfuscate itself, obfuscations of itself from further ahead iterations and code from earlier iterations. It's not required to be able to obfuscate anything else.
\$\endgroup\$
2
  • 4
    \$\begingroup\$ Bonus in code golf is highly discouraged. And "the output should have minimal resemblance to the input" should be more rigorously defined. \$\endgroup\$
    – Bubbler
    Nov 13 at 23:19
  • \$\begingroup\$ The idea is fine, but you need more detailed and cleaner define about obsfucate and the meaning of statement that don't directly affect the output code \$\endgroup\$
    – okie
    Nov 22 at 8:43
-3
\$\begingroup\$

Code-challenge: Guess my number

The challenge

You have a number from 1 to 10 in mind, and your program should ask questions to find out which number. These questions can be any questions, the program only has to find out the number as fast as possible.

Your program should ask a question, such as "Is the number a prime?", and the user must answer either y or n (yes or no). Ask questions until you know the number.

The scoring

To calculate the score, you need to take the sum of the question count for each number. For example, if you need 1 question to find the number 1, 2 questions to find the number 2, and so on, the score is 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10, so the score is 55.

Important note: the question count for a specific number must always be the same. For example, if you need 4 questions to find out the number 10, then you have to ask always 4 questions to find out the number 10, otherwise it is impossible to calculate the score.

\$\endgroup\$
3
  • 6
    \$\begingroup\$ boooring. The Huffman tree for a uniform set is any perfectly balanced tree. The question asks us to perform a binary search on the usr device. Is the number greater than 5? Is the number greater than 2? Is the number greater than 1? Hey' I think it's 1. \$\endgroup\$ Jan 2 '14 at 11:49
  • 3
    \$\begingroup\$ Maybe if this were a pop-contest and the goal was to make the most original set of questions while still keeping the score at its theoretical minimum. \$\endgroup\$ Jan 3 '14 at 5:28
  • \$\begingroup\$ This is off-topic and AI is off-topic for this site \$\endgroup\$
    – Fmbalbuena
    Nov 12 at 17:39
-3
\$\begingroup\$

Bovine Ignorance

I'm curious about code which still works after being mangled by figlet, toilet, cowsay et al, but I'm not sure whether this in any way sane.

What I'm toying with is a challenge in which a participant may submit any program in any language. It should be possible to use this program's source code as input to cowsay or whatever, and the result should be another valid program in any language, which still does a similar thing. For instance, the following bf program prints Hello world! with no newline:

+++++ +++++
[
> +++++ ++
> +++++ +++++
> +++
> +
<<<< -
]
> ++ .
> + .
+++++ ++ .
.
+++ .
> ++ .
<< +++++ +++++ +++++ .
> .
+++ .
----- - .
----- --- .
> + .
+++++++++++++++++++++++++++++++++++++++++

Running cat ./prog.bf | cowsay -e .. -T $'>.' yields the following output:

 _________________________________________
/ +++++ +++++ [ > +++++ ++ > +++++ +++++  \
| > +++ > + <<<< - ] > ++ . > + . +++++   |
| ++ . . +++ . > ++ . << +++++ +++++      |
| +++++ . > . +++ . ----- - . ----- --- . |
| > + .                                   |
| +++++++++++++++++++++++++++++++++++++++ |
\ ++                                      /
 -----------------------------------------
        \   ^__^
         \  (..)\_______
            (__)\       )\/\
             >. ||----w |
                ||     ||

Which is itself a valid bf program which prints Hello world!!!, followed by a newline.

The problem with using bf here is that it ignores most of the cow, making this a bit too easy. The problem with using any other language is that it doesn't ignore most of the cow, making this far too difficult. Is there a sensible middle ground I could pick for this? I don't think it's impossible, I'm fairly sure you can exploit cowsay's behavior on one-liners to produce valid svgs, but I'm not sure how best to pose this challenge. Any ideas?

\$\endgroup\$
6
  • 2
    \$\begingroup\$ I could not think of any language that falls in the middle ground. Even brainfuck is affected by the -----------------------------------------..>.---- inserted by cowsay. Most languages have strong parsing rules that would not cope with being post-processed by cowsay. The few exceptions for this will be either completely unaffected or badly affected, making the challenge uninteresting. \$\endgroup\$ Feb 19 '14 at 12:32
  • \$\begingroup\$ Actually, you can't transform just any brainfuck program to cowsay-brainfuck. Namely those that can output fewer than three characters cannot be transformed at all. \$\endgroup\$ Feb 19 '14 at 14:52
  • \$\begingroup\$ @JanDvorak, I was intending to allow competitors to choose the parameters of their calls to cowsay. For the uninitiated, -e controls the string used for eyes and defaults to oo, and -T controls the string used for the tongue, defaulting to ` U`. This is all yak-shaving, though, and having written this up and read the comments, I suspect that this idea has neither legs, horns nor udders. \$\endgroup\$
    – ymbirtt
    Feb 19 '14 at 23:19
  • 2
    \$\begingroup\$ If I could propose a variant that is more feasible, you could do a challenge like "Write a program in your language of choice that draws ASCII art of a cow saying something (does not have to be identical or even similar to the cowsay art). The entire drawing must itself be valid source code that does something other than no-op. Post results of both programs." That gives people more leeway to work around the specific restrictions of their compiler. \$\endgroup\$ Feb 21 '14 at 23:22
  • \$\begingroup\$ Ok, I found a language that falls within the middle ground: whitespace. Anyway, this question has a too narrow scope to develop an interesting challenge. \$\endgroup\$ Feb 22 '14 at 18:31
  • \$\begingroup\$ @JonathanVanMatre That would be a subjective validity criterion, and would probably be closed as too broad. \$\endgroup\$
    – wastl
    Jul 2 '18 at 13:55
-3
\$\begingroup\$

99 Bottles of Errors

While there are already many versions of "print 99 Bottles of Beer," I thought another one wouldn't hurt.


The challenge is fairly simple: print the lyrics to 99 bottles of Beer to STDERR. I don't care how you do it, so long as the entire lyrics show up. An entire program is required, so the following Java program would be invalid (even if it did do the correct thing):

System.out.println("99 Bottles of Beer on the Wall, take one down and pass it around...");

The scoring:

  • This challenge is , so shortest code by byte count wins.
  • If necessary, assume UTF-8 is the character encoding used.

The rules

  • All the code must be in one file.
  • Any language is allowed.
  • Reading input, whether it is from STDIN, a file, or the web, is not allowed.
\$\endgroup\$
1
  • 6
    \$\begingroup\$ This is trivial in some languages (Java), where it reduces to a simple kolmogorov challenge, and impossible in others (those that have no distinct STDERR) \$\endgroup\$ Mar 27 '14 at 7:42
-3
\$\begingroup\$

Create an Identicon Generator

The challenge is to create an identicon generator. The identicons must be randomly generated, so we get a new identicon for each key the program receives. You can input a key using std-in or you can use your language's random number generator for the key.

In order to make your identicon look reasonably nice, it must generate a picture, then rotate that picture around the bottom right corner, the way this mockup shows:

enter image description here

The output must be to a PNG file. Shortest code wins.

\$\endgroup\$
3
  • 5
    \$\begingroup\$ Far too broad. As this stands I can create a 1-pixel image whose colour is just the key. I don't think this question will be ready to go until you've found a way to prevent me from making the images differ only in their palette (and to pre-empt, I think that adding a rule "Images may not differ only in their palette" isn't a real fix). \$\endgroup\$ Mar 28 '14 at 14:50
  • 5
    \$\begingroup\$ If you just ask for "random" images, you'll get images that are either hardly random at all (a solitary pixel in a random location), or completely random (noise). To get something "reasonably nice", you'll have to provide very clear instructions on how to produce these images. I suggest you try creating a few of these yourself, and find a minimal set of rules that produces results that look OK. Include requirements on dimensions (100x100px?), selection of colours (at least 2, not too similar), and drawing method (e.g., "five triangles with random vertices and a minimum area of 20 px²"). \$\endgroup\$
    – r3mainer
    Mar 28 '14 at 15:25
  • 1
    \$\begingroup\$ How important is the PNG file output? This will be a challenge in itself for many languages. Would you accept an uncompressed non-interlaced format like PPM? \$\endgroup\$
    – trichoplax
    Apr 16 '14 at 9:45
-3
\$\begingroup\$

Underhand Bejewled

Help me to write a game of bejewled, which cannot be lost!

Bejewled game rules

If you ever played bejewled, you can skip this, but for those who did not see it ever:

  • Playing field of 8*8 grid is filled in with gems of 7 different types randomly
  • By swapping two adjective stones, your goal is to create a line of at least three same type of stones in the either vertical or horizontal line
  • If did so, the gems will dissappear, points are added (say 20 points for a matching) and new gems are provided randomly from the top
  • image related:

enter image description here

Your challenge

Provide me a game which cannot be lost. In other words, the gems falling from the top are not random at all, but are falling in order that there is always at least one possibility to match three gems

But, from looking at the code at level of newbie programmer, it should look like that game acts as if it was random

Output

Playable game. As long as it is the grid of 8*8 filled in with 7 different types of "gems" the game is ok. It does not to have killer graphics, neither it does not need to be playable by mouse. (But in that case please make sure you show which "gem" is hovered and then selected)

Winning criteria

This is popularity contest. So highest rated game wins

\$\endgroup\$
2
  • 1
    \$\begingroup\$ I think this is too big a task to work well for an underhanded contest. The programs will be way too large for anyone to actually read the source and try to find what's underhanded about it. \$\endgroup\$ Nov 11 '14 at 8:32
  • \$\begingroup\$ Thats what I was also afraid of. I will either take it as lesson to progress on my programming skill, or abandon the idea completly \$\endgroup\$ Nov 11 '14 at 8:38
-3
\$\begingroup\$

Shortest Program that May or May not Terminate:

Write a program such that whether or not it terminates depends on the answer to an unsolved question in Computer Science or Mathematics. For example, your program might test the Goldbach conjecture for every N and quit if a counterexample is found, or hunt for odd perfect numbers. Please include an explanation of why your program may or may not terminate!

Note: assume infinite memory and stack size, because otherwise they all terminate. Your program must be self contained, take no input, and only use standard libraries. This is Codegolf, so shortest code wins!

\$\endgroup\$
6
  • \$\begingroup\$ What about "unsolvable" problems, e.g. halting problem? Can I take another code as input and terminate if that terminates? Because that other program may or may not terminate, and there's no way to tell. \$\endgroup\$ Nov 20 '14 at 18:03
  • \$\begingroup\$ The intention was that the program isn't allowed to take input. I'll be more specific. \$\endgroup\$ Nov 20 '14 at 18:50
  • 2
    \$\begingroup\$ Does this differ from this previous question in the sandbox? \$\endgroup\$
    – trichoplax
    Nov 20 '14 at 19:34
  • \$\begingroup\$ (even if not the comments explaining why that one wouldn't work as a question may help Taylor this one) \$\endgroup\$
    – trichoplax
    Nov 20 '14 at 19:35
  • \$\begingroup\$ The intent of this doesn't differ significantly from the question you linked, I searched posted questions but forgot to search the sandbox. \$\endgroup\$ Nov 20 '14 at 19:41
  • \$\begingroup\$ Infinite memory isn't required. \$\endgroup\$
    – feersum
    Nov 20 '14 at 21:46
-3
\$\begingroup\$

Something Else - ASCII Art maker:

A text to ASCII art generator maker, the program must input a string and return ASCII art from it. Something like patorjk.com/software/taag/. It has to use the Graffiti font. The winning criteria is the whoever gets the most likes.

\$\endgroup\$
2
  • 1
    \$\begingroup\$ Hello! Just a few things to point out: 1) The current spec is very broad. For example, what fonts, how does spacing look, what characters need to be supported... there's a lot more details that need to be included than just "return ASCII art of this text" \$\endgroup\$
    – Sp3000
    Feb 24 '15 at 4:07
  • 1
    \$\begingroup\$ 2) What's the winning criterion? Popularity contest? Code golf? \$\endgroup\$
    – Sp3000
    Feb 24 '15 at 4:08
-3
\$\begingroup\$

Identifying a Sonnet

This challenge is about determining if a given file (read-in from stdin) meets the criteria to be a sonnet. You may use any language for this challenge. If your language supports an API to use an online dictionary you may use that API, if your language doesn't then too bad.

Additionally, it is preferred if your language is one that can be ran directly from the command line and is a language that has a compiler or interpreter available directly from my distro's repos(Fedora), as I would rather just use a bash script to test the various programs, then test each program manually.

Definition of a Sonnet

  • Has 14 Lines (lines are denoted as the standard newline on your operating system).
  • Has a definite rhyme scheme, it will have one of the following rhyme schemes
    • ABBA ABBA CD CD CD
    • ABBA ABBA CDE CDE
    • ABAB ABBA EFEF GG
  • Iambic Pentameter - consists of alternating stressed, unstressed syllables. This doesn't have to be perfect 100% of the time, just at least 50% of the time.

In order for your program to declare a given string a sonnet, it must meet all of the above criteria.

Additional Notes

You do not have to identify the following:

  • Thought Structure - too intense for a code golf challenge, and too subjective.
  • Topic - computer lacks context to determine this

Input

Input will be read from stdin. This is the string that you will be declaring to be or not to be a sonnet.

Output

Your program will output either yes or no for the question:

Does this string meet the given requirements to be a sonnet?

As this is code golf yes or no can be abbreviated to Y/N.

Winner

The solution with fewest number of bytes win that has the highest accuracy ratio for the correct identification of a sonnet. The preference is for higher accuracy rather than brevity of the program.

Test Data and Resources

What is not a sonnet

The following are examples that you program should return false on:

  • Beowulf
  • Haiku
  • Input that doesn't have exactly 14 Lines in it
  • The text of this question.
  • The text of just about any other question on StackExchange.
  • Things that don't have a rhyme scheme. See Below

Not A Sonnet

A man got on a boat
The boat was leaky
and had poor construction
For it was made by a one-eyed blind man
and his dumb intern
As soon as he got out of port
at the fort
it started to sink
eventually, it tanked.
And it capsized
If only that shipwright
wasn't so blind deaf and dumb
as microsoft tech support
That's not much support at all.
\$\endgroup\$
9
  • 3
    \$\begingroup\$ I think without dictionaries for rhymes and stresses this is probably not a good idea. Of course you can use some sort of accuracy ratio, but then you also need false positives, and you need a lot more examples than the few on the pages you've linked. But if you do this there's no requirement to actually recognise the sonnets by their rhymes and stresses - instead, I'm pretty sure, people will just regex golf the test sets. \$\endgroup\$ Mar 24 '15 at 19:36
  • \$\begingroup\$ @MartinBüttner I updated the requirements with an accuracy percentage, and added the option to use an API to look up terms from a dictionary. \$\endgroup\$
    – HSchmale
    Mar 24 '15 at 19:57
  • 1
    \$\begingroup\$ 1. Test data which only covers one possible output isn't test data. I can write a program which always outputs Y in as little as one byte and it will pass all of the linked "test data", but it comes nowhere near to meeting spec. 2. Unless you specify which rhyme/stress dictionary to use, you can't guarantee that the test data is "correct". \$\endgroup\$ Mar 24 '15 at 20:20
  • \$\begingroup\$ @PeterTaylor I added examples of what is not a Sonnet. \$\endgroup\$
    – HSchmale
    Mar 24 '15 at 20:32
  • 1
    \$\begingroup\$ I'm not sure how to say this, but it feels as though this task has a lot of individual parts, each of which could be quite tricky. Especiallly detecting rhymes/syllables/stresses, since words can be pronounced/stressed differently based on context. Also if you're using Shakespeare's sonnets I have no idea where to get rhyming and stress dictionaries for Elizabethan English... \$\endgroup\$
    – Sp3000
    Mar 25 '15 at 14:18
  • \$\begingroup\$ To make this interesting, you'll need some interesting near-misses: non-sonnets that can't be detected by something simple like counting lines or words per line. \$\endgroup\$
    – xnor
    Mar 25 '15 at 20:59
  • \$\begingroup\$ @xnor You mean a file with a that looks like a sonnet but has no rhyme. \$\endgroup\$
    – HSchmale
    Mar 25 '15 at 21:04
  • \$\begingroup\$ Yes, for example. Or, one with rhyme by wrong rhythm. Or, one with nonsense characters that seem to "rhyme". \$\endgroup\$
    – xnor
    Mar 25 '15 at 21:06
  • \$\begingroup\$ @Sp3000 You can just use modern english, or just base it on words that have similar endings. \$\endgroup\$
    – HSchmale
    Mar 25 '15 at 21:11
-3
\$\begingroup\$

Represent a Number in the Strangest Way You Can Think Of.. while staying under 8 unique characters

Your goal is to represent some numbers in the strangest way possible.

Rules:

  • The result must be a number that can be used in the programming language like any other ordinary number. For instance, <my expression> + 3 should return 3 more than the value of <my expression>.
  • The code must be under 20 kilobytes. That's a rather large size for a number so you should be all set.
  • The expression must have under 8 unique characters! The length of it can be as long you want, just keep it under 8 unique characters. aaaaaaaaaaaaaaaaaa is valid (if it works in the programming language) but abcdefghijklm isn't valid because it uses 8 or more unique characters.

Guidelines:

  • The goal here is to represent a number in the strangest and most interesting way possible, so if I ask you to represent the number 35 it would be a good idea to respond with something more interesting than 35 or 12 + 23.
  • This isn't a ! Feel free to make your code as long as you want, so long as it's under 20 kilobytes. Fancy code can look nice!
  • The code doesn't need to support decimals (floats) but if it does, it will get 10 extra points (see below).
  • The code also doesn't need to support negative numbers (for instance -37) but if it does, it will get 10 extra points (see below).
  • Try to make your post follow the below:

Post format:

Language

Description

0

...

1

...

30

...

108

...

1337

...

1234567890

...

3.1415 [10 bonus points if you can get this!]

...

-25 [10 bonus points if you can get this!]

...

Bonus numbers:

...

The points is equivalent to the number of votes on the answer plus 10 if it supports decimals with 10 more points if it supports negative numbers. Whoever has the highest points is considered the current winner. Have fun!


This is my first go at making a popularity contest so if you have any tips those would be appreciated.. :)

\$\endgroup\$
7
  • \$\begingroup\$ This is a great challenge... whoever downvoted this has to rethink their concept of code-restriction challenges... \$\endgroup\$ Jul 15 '15 at 22:49
  • \$\begingroup\$ Ah, thank you. :) \$\endgroup\$
    – Florrie
    Jul 15 '15 at 23:28
  • \$\begingroup\$ Updated again with negative numbers added (-25), as well as 1 and 0. \$\endgroup\$
    – Florrie
    Jul 15 '15 at 23:33
  • \$\begingroup\$ @Sp3000 8 unique chars, not 8 total. \$\endgroup\$
    – isaacg
    Jul 16 '15 at 10:04
  • \$\begingroup\$ @isaacg Didn't I state that? \$\endgroup\$
    – Florrie
    Jul 16 '15 at 11:11
  • \$\begingroup\$ @liam_ You did, the person I was responding to who deleted their comment missed it. \$\endgroup\$
    – isaacg
    Jul 16 '15 at 11:32
  • 1
    \$\begingroup\$ TBH, I think this is such a poor popcon that it can't be rescued, but if you want to at least make it clear what you're asking then: 1. You talk about representing "a" number, but also about "support[ing] decimals" and "support[ing] negative numbers". What exactly do you want? A function which maps numbers to code? But if so, the "Post format" makes no sense. 2. What is the code which has a 20kB limitation? Total for all the numbers listed in the "Post format"? Each individual number listed in the "Post format"? Something else? 3. Are the 8 distinct characters per number or for all numbers? \$\endgroup\$ Jul 17 '15 at 16:19
-3
\$\begingroup\$

Stop the dance!

Your sister was at the hospital, but now she's fine, awfully, you lost a day of work, one of your most important days.

You work at your local television, and they have a contest, called "Stop the dance!", what is it about?: People is dancing, they have a big screen in the wall, while it says "Dance!", they have to dance, if it says "Stop!", they must stop, if you move, you lose.

You don't have internet at the studio, so you use some strange offline data sharing method. The day you weren't there, another programmer came, such a silly programmer! He made a "Reciever" program, basically, gets data, processes data and prints data in the Big Screen Wall.

The programmer was bored, so he made a way to get data, well, you don't know what way he choose! (Author comment: Let's assume he made all the possible ways. Cya.) Now you have to make a sender program, in any language, that sends data to that program using the protocol specified under this section.

You are an expert code golfer, so you decide that you must make the shortest code possible. (Another author comment: Any lang is allowed. Cya.)

How did I came out with this idea?

Having a shower, my friend...

Your task

You must make the shortest (and winner) code possible, that sends data to the reciever, using this protocol:

The reciever must recieve:

$displaytext:"<text here>";$instnm:<integer here>;

$displaytext corresponds to what it is going to be displayed on the Big Screen Wall.

$instnm corresponds to the number of the instruction, the count of things displayed, starts from 1.

Your program may take an input, and send the data, in any way (except the ones in Rules) to the Reciever. Remember there's no internet.

The winner will be the user with shortest bytes of code.

Rules

As a good code golfer, you may not:

  • You can't use program arguments to send the data.
  • It must be an application.
  • If you apply for the bonus, mind you have to make both programs, if not, just the sender.
  • The string you have to send it has to be STRICT, no different ones, if not, unvalid answer. (I decided to call that "Strict JASON Protocol", get the joke?)

Bonus

You can make the reciever program, and you get -1 byte. Not much, but k. (In bytes, you must not decrement your byte result, you must do: "n Bytes + Bonus")

Example Input and Output

Input:

From Sender program:

Dance! or Stop!

Protocol:

Inbetween both commands

$displaytext:"Dance!";$instnm:5

Output:

In Reciever program:

Dance! (9) or Stop! (187)

Overall objective:

Send data between two programs, without internet connection.

Edit: i can't post an example answer, because then i can give ideas of how to do this codegolf/puzzle, while the ideas are limited, i'm finding for the creativity of the user.

\$\endgroup\$
4
  • 9
    \$\begingroup\$ I have no idea what you're asking me to do. \$\endgroup\$ Feb 3 '16 at 21:26
  • \$\begingroup\$ It is pretty clear what is asking you to, is defined in Task (You must make the shortest (and winner) code possible, that sends data to the reciever, using this protocol), all the story and background is defined on Introduction. I dont see any hole on the post. \$\endgroup\$
    – TheCrimulo
    Feb 3 '16 at 22:11
  • \$\begingroup\$ @TheCrimulo Example answer? \$\endgroup\$
    – Xwtek
    Feb 7 '16 at 7:06
  • \$\begingroup\$ There is no Example, because you are just sending the same info you wrote in. If you type ´Dance!´, the output will be Dance! (n), n being the number of the sequence. The idea isn't to read input, and append (n) to it. You have to make it, in anyway (except command args/internet), dropping out the enoded data (input in the protocol), and, if necessary, make a reciever program, the reciever program its a bonus that discounts 1 byte, also, it can help you making your sender smaller. I can, i.e., make a file with the info on it. As explained, the reciever will read it. \$\endgroup\$
    – TheCrimulo
    Feb 7 '16 at 15:54
-3
\$\begingroup\$

Biggest single character

This challenge is simple, its like the challenges we've had before where the goal is to produce the biggest output one can. But in this one, you can only use one character in your code.

You get no input, your code has to be a single character (not byte), and the person with the largest output in byte wins, ties broken by posting time.

\$\endgroup\$
7
  • 5
    \$\begingroup\$ Doesn't this boil down to which language has the biggest output stored in a predefined variable? \$\endgroup\$
    – Denker
    Apr 3 '16 at 20:50
  • \$\begingroup\$ @DenkerAffe true. maybe i should make it 2 byte src code. that might allow some interesting stuff \$\endgroup\$
    – Maltysen
    Apr 3 '16 at 20:52
  • 1
    \$\begingroup\$ I think I would raise the char amount a bit more to allow for some competition between the same language. Also you should keep in mind that this rules out every non-golfing language. While this should be allowed per meta consensus, I am not sure how much the community likes this. \$\endgroup\$
    – Denker
    Apr 3 '16 at 20:58
  • \$\begingroup\$ G for pyth wins :D :D \$\endgroup\$
    – Leaky Nun
    Apr 4 '16 at 4:45
  • 3
    \$\begingroup\$ Befunge & co. would probably win via infinite output. If output has to be finite though, I wouldn't consider this a very interesting challenge since it would just be one big language hunt. \$\endgroup\$
    – Sp3000
    Apr 4 '16 at 10:27
  • \$\begingroup\$ Actually, N in Seriously wins. 11752 bytes output. \$\endgroup\$
    – user45941
    Apr 6 '16 at 4:06
  • \$\begingroup\$ @Mego Vitsy wins. 0 bytes, 11752 bytes of output. \$\endgroup\$ Apr 7 '16 at 17:07
-3
\$\begingroup\$

Alphabetization 101 (popularity contest)

Your task is to use all 52 letters of both the uppercase and lowercase alphabet, ONCE and ONCE only, and make a program.

You are free to use any other ASCII character more than once, or use a letter of the alphabet more than once if it's required for the language to function.

Meta:

  • Not sure if this has been done before.
  • Any questions regarding the task?
\$\endgroup\$
5
  • \$\begingroup\$ Not really meta: Is there any place I can go to (like a chat or something) to post a question about BF? StackOverflow probably isn't suitable. \$\endgroup\$
    – clismique
    Apr 17 '16 at 6:48
  • 1
    \$\begingroup\$ Come to our chatroom! :) \$\endgroup\$
    – Leaky Nun
    Apr 17 '16 at 6:50
  • 3
    \$\begingroup\$ I would vote to close this as too broad. It's not a particularly interesting restriction per se, and it certainly doesn't make a good question without some restriction on the task to be performed. \$\endgroup\$ Apr 17 '16 at 14:07
  • \$\begingroup\$ @PeterTaylor That's why it's a popularity contest, though - it lets the people decide whether the program made is good or not. What WOULD be a good restriction on the task? \$\endgroup\$
    – clismique
    Apr 18 '16 at 1:40
  • \$\begingroup\$ The popularity-contest tag is not an excuse for a broad challenge. "Write a program that does anything..." is pretty much the definition of "too broad", regardless of any source code restriction put on the program. So at least you should choose a specific task. Could be anything really, but if it relates to the restriction it might be more interesting (e.g. a pangram checker). Even so, I agree with Peter that the restriction isn't particularly interesting. There are tons of languages where it's trivial to avoid unwanted letters and then include the remaining ones in a string or comment. \$\endgroup\$ Apr 21 '16 at 7:04
-3
\$\begingroup\$

Why did I come to Sandbox?

I have a very specific challenge, and I wanted to see if it was too specific.

The challenge is to output "Valdosta ACM" using the shortest number of characters with the BrainF**k programming language.

I've noticed it isn't the norm to specify a programming language on this domain, so I've come here to get feedback on whether or not this is acceptable.


Introduction

As a challenge to the members of my local Association for Computing Machinery(ACM) chapter, I asked them to produce the shortest Brainf**k code that would output "Valdosta ACM".

This was a very fun challenge for all of our members, and we got very competitive! I was impressed with the solutions turned in, but I wondered if it was possible to beat our best solution. Surely it's possible, but who could do it?

Challenge

Output the string "Valdosta ACM".

Stipulations:

  • Use only the Brainf**k programming language (you can test your code here)

  • No input can be accepted by your program

  • Your program must halt

  • The space in the string must be ASCII character #032.

These are the ASCII values of each character, as they appear in the string, for convenience:

 086 097 108 100 111 115 116 097 032 065 067 077

The winner is determined by the shortest code, by character count.

Example Input and Output

Input:

NO input is allowed

Output:

Valdosta ACM

\$\endgroup\$
5
  • \$\begingroup\$ Welcome to Programming Puzzles & Code Golf! Thanks for using the Sandbox. :) A few things to note: 1.) Generally we discourage language-specific challenges, 2.) typically code golf is scored by bytes rather than characters, and 3.) printing a fixed string like this would be insufficiently different from the Hello, World! challenge to avoid it being closed as a duplicate. \$\endgroup\$
    – Alex A.
    Apr 25 '16 at 3:38
  • \$\begingroup\$ Thanks Alex! Since I want to compare the results of my local competition with the results of the challenge here, is there anything I could change about the challenge to make it acceptable? I don't see a way to do this, but I was so excited about seeing if anyone here could do better than our coders. And thanks for the warm welcome! :) \$\endgroup\$
    – Matt C
    Apr 25 '16 at 3:48
  • \$\begingroup\$ You could look at Brainf**k solutions to other challenges (like this one), and see if the techniques used there can help you improve your solution. \$\endgroup\$
    – ugoren
    Apr 25 '16 at 7:09
  • \$\begingroup\$ We also have a tips question that may be of interest. \$\endgroup\$
    – trichoplax
    Apr 26 '16 at 6:30
  • 2
    \$\begingroup\$ Although this particular challenge is probably too similar to "Hello, World!" (as Alex pointed out), if you had a different challenge that you wanted to see solutions for in a specific language, you can still post it but just allow all languages to compete. If you don't see solutions in your specific language you can post a bounty for that language to encourage it. \$\endgroup\$
    – trichoplax
    Apr 26 '16 at 6:33
-3
\$\begingroup\$

The FitnessGram™ Code Golf Test

Same concept and rules to the well-known Rick Astley post a while back, only instead of using samples of various sizes, sample length is limited to what number sample it is. And different text for the program to write.
It's code golf, so standard loopholes apply, and fewest bytes wins.

\$\endgroup\$
5
  • 1
    \$\begingroup\$ Closed as a dupe. And/or unclear. \$\endgroup\$ May 19 '16 at 20:04
  • \$\begingroup\$ Paragraphs of text are boring for compression. Unless there's some particular structure in the text, the same techniques apply to all of them. \$\endgroup\$
    – xnor
    May 19 '16 at 20:07
  • \$\begingroup\$ First off, thank you for using the Sandbox before posting on main. That said, I don't understand what your challenge is supposed to be: what is the sample length? What is a sample? In addition to that, if this challenge winds up being "print some fixed string" then it is a duplicate of the rick astley post, as the techniques used for compression will be identical. \$\endgroup\$ May 19 '16 at 20:09
  • \$\begingroup\$ we want to give them a challenge, not a flashback.... \$\endgroup\$
    – user56309
    Aug 4 '16 at 19:42
  • \$\begingroup\$ This sandbox post has had little activity in a while and little positive reception from the community. Please improve / edit it or delete it to help us clean up the sandbox. \$\endgroup\$
    – user58826
    Jun 9 '17 at 14:12
-3
\$\begingroup\$

Obfuscate your program

In this challenge, you must create a program which does something but you need to obfuscate it so that it becomes hard to understand (so don't explain it in your post).

It can accept anything as input and output anything.

Score

The shorter program (in bytes) which hasn't been understood wins.

Example

Can you guess what does this code calculate?

var t=1e5,s=t/1e4,n=s*0.1,i=n*s*7.5,r=!true,b=1,t='01'.split('').map(c=>parseInt(c)).concat(Array(i).join('.').split('.').map(m=>{a=r+b;(r=b)&&(b=a);return a})),t=t.join('').length,b=s,t=r,s=4+NaN;

Rules

  • You should say what language you used
  • You must not use any obfuscation tool
\$\endgroup\$
2
  • 3
    \$\begingroup\$ At a minimum, you should state an actual objective: "obfuscate a program that does x". Otherwise it's just too broad and will likely be closed as such. You'll also need something else to explain the scoring, since "shortest that isn't understood" seems odd to me. Understood when? How do you show that it hasn't been understood? Do you mean something like Cops and Robbers?. \$\endgroup\$
    – Geobits
    Jun 4 '16 at 19:06
  • \$\begingroup\$ This sandbox post has had little activity in a while and little positive reception from the community. Please improve / edit it or delete it to help us clean up the sandbox. \$\endgroup\$
    – user58826
    Jun 9 '17 at 14:12
-3
\$\begingroup\$

"01_firstHole" Challenge for Performance Golf

First there was code golf. Now, there is Performance Golf. FORE!

Motivations

This is a crowd-sourced approach to easier and better performance troubleshooting. Performance problems are everywhere, so java technicians need access to easy-to-use diagnostic tools at every step of the SDLC.

How to play?

  1. Start by installing the live demonstrations of Java Performance Problems in this repo.

  2. Pick one of the six holes of golf to play. You can do this by picking one of the six numbered folders in the repo. This particular codegolf.stackexchange.com challenge is for the 01_firstHole.

  3. One at a time, run the 'a' load test and the 'b' load test for the hole you selected. The a & b tests are two different implementations of the same REST/SOA service. See the 'installing' link, above, for how to run the tests.

  4. Compare the performance of the two tests, a & b. Which has better response time / throughput?

  5. Using the least amount of tooling/instrumentation, identify the performance problem of the slower test. Hook it up your self and run the tests.

  6. At codegolf.stackexchange.com, there is one "Stack Exchange Challenge" for each hole of golf. Post the following two things for your solution to that challenge:

    • Post a description of the tools/techniques you used to detect the performance problem. Must be detailed enough so that others can reproduce your work. Performance golf always compares two different loads -- a & b. The solution must identify the inefficient code in the slower of the two examples. It must also show the absence of that inefficient processing in the faster of the two examples.
    • Tally the number of strokes for your approach, using the "Scorecard" below. All solutions must specify the # of strokes incurred, and it must be specified in the answer heading/title.
  7. Upvote the solutions that best identify the performance problem and have the fewest strokes (see Scorecard, below). Similar solutions on different platforms (Mac/Linux/MS-Win) deserve roughly the same number of upvotes.

Scorecard

This scorecard determines the approach with the least amount of tooling/instrumentation. Lowest score wins!

  • 1 stroke if JVM restart is required to hook up your monitoring tool of choice.
  • 1 stroke for any tool with any $$ licensing cost.
  • 1 stroke for every separate install process. No strokes for JVM and pre-installed OS tools.
  • 1 stroke for tools/techniques specific to a particular Database vendor. Ex: Oracle AWR report. Even ‘EXPLAIN PLAN’ solutions are proprietary.

Example One -- zero strokes :-D

This example does not use this github repo, but it will give you the general idea.

This solution to solving a high CPU problem would get lowest=best instrumentatin score: zero strokes. Only JVM and OS tools are used (thread dump and top -H). There are no tool license costs and a JVM restart was not required for the thread dump.

Example Two -- 3 strokes :-(

This example also does not use this github repo, but it will give you the general idea of what we mean by the best troubleshooting with the least tooling/instrumentation.

A modern, commercial profiler (YourKit, JProfiler, etc...) would easily solve the high CPU problem in example 1. But look how many strokes (1+1+1=4!) are taken off with this approach: * 1 stroke because a JVM restart is required to hook up the tool * 1 stroke because there are licensing costs. * 1 stroke to install profiling the tool

\$\endgroup\$
8
  • 2
    \$\begingroup\$ Answers in this site normally involve writing code, so this doesn't really appear to be on topic. \$\endgroup\$
    – feersum
    Jun 16 '16 at 7:43
  • \$\begingroup\$ Thanks for using the sandbox! I do however, see some problems with this challenge. For one, I think you would need to clarify a lot of the stroke criteria, as something like "rarely used" is pretty subjective. In addition, there doesn't seem to be a way to enforce a person to not use a high level tool, and then after figuring out the problem finding it again with a more basic tool. Even further, why couldn't someone look at another answer and then reuse their data to get a better score? cont... \$\endgroup\$ Jun 16 '16 at 13:22
  • \$\begingroup\$ After all that, there doesn't seem to be an objective winning criterion, unless it is number of strokes. If number of strokes determines the winner, then won't there be many ties? I think you would need something more granular. \$\endgroup\$ Jun 16 '16 at 13:24
  • \$\begingroup\$ Sounds like I need to work on the "rarely used" part mentioned by @FryAmTheEggMan. Regarding the same commenter's comments about the high-level tool and the basic tool. That is part of the natural progression of monitoring. We learn to do it one way, then we learn a better, less intrusive, less expensive way. As long as the user of the basic tool is "detailed enough so that others can reproduce your work", who cares how much refinement was involved? \$\endgroup\$ Jun 16 '16 at 22:45
  • \$\begingroup\$ Regarding @FryAmTheEggman's question of "many ties". I look at auction sites like eBay as reasonable crowd-sourced arbiters of value of a given object for sale. I was hoping the voters would provide that kind of assessment, but I see where lack of objectivity could cause cronyism and perhaps other problems. Could someone point me to codegolf tolerance/lack of for ties? I'll try to work on that. \$\endgroup\$ Jun 16 '16 at 22:48
  • \$\begingroup\$ @FryAmTheEggman, you mentioned that my "rarely used" criteria was pretty subjective. That's a good call, so just edited / removed that. \$\endgroup\$ Jun 18 '16 at 21:36
  • \$\begingroup\$ @FryAmTheEggman, the "many ties" concern could also looked at from a different perspective -- that Performance Golf will provide a very useful "catalog" of answers. This "catalog" concept got 18 upvotes here. \$\endgroup\$ Jun 18 '16 at 21:43
  • 4
    \$\begingroup\$ The catalogue concept is a failed experiment, and your mention of it is one of the reason why. "It's a catalogue question" should not be used to justify why a question should be closed even though it's off-topic and wouldn't have an effective scoring mechanism even if it were on-topic. \$\endgroup\$ Jun 19 '16 at 13:31
-3
\$\begingroup\$

Make a Fork Bomb

under construction, please constructively (no pun intended) criticize

Create a program which forks itself at twice and exits, or forks itself once and idles. Whether it continues forever or exits is your choice. Forks can be OS forks or simply a command to relaunch the program.

Rules

  • No spoon bombs allowed, please.
  • Don't make any assumptions about the location of the program.

Bash, 10 chars

./$0|./$0&

Acts as a standard punching bag for other solutions.


Microsoft Windows Batch file, 5 chars

 %0|%0

Anybody who beats this one gets a million internet points. (and maybe a bounty)

\$\endgroup\$
3
  • 4
    \$\begingroup\$ I assume that the downvote is because someone considers that this violates our policy on malicious code. I think it's borderline, but if it's on the right side of the border then the question has other issues. 1. Why fork itself at least twice? Surely forking once is enough for a fork bomb? 2. Define "OS forks" in a way which doesn't rely on the OS being POSIX. Or, better, remove that requirement: it seems to me to limit the languages permitted more than necessary for no benefit. 3. What's a spoon bomb? Google is not being helpful. \$\endgroup\$ Jul 14 '16 at 13:49
  • \$\begingroup\$ @PeterTaylor 1. the chat said it was fine 2. If you only fork once and exit, you have a constant amount of processes 3. Good idea. Any tips for windows forks? 4. it's a joke \$\endgroup\$ Jul 14 '16 at 16:38
  • \$\begingroup\$ I'm downvoting because I think it's close enough to malicious. A fork bomb can hang a computer. \$\endgroup\$
    – mbomb007
    Jul 22 '16 at 19:27
-3
\$\begingroup\$

Stump The Golfing Languages

This is the seed of an idea. I'm unclear on the details that might make it work.

I want people to submit answers in the form of a program in a "normal" language (defined how?), such that reproducing its functionality in a golfing language isn't much smaller. That is, I want to find the algorithms that Jelly and Pyth and Matl and such are not optimized for.

I would appreciate suggestions on how to make this work. Maybe cops and robbers? Maybe each entry just contains two programs, and comments are given to help golf the smaller one?

\$\endgroup\$
7
  • \$\begingroup\$ The only language that could possibly win is mathematica \$\endgroup\$ Aug 23 '16 at 1:52
  • 2
  • 2
    \$\begingroup\$ It's very easy to come up with boring examples e.g. print this exact trace, reproduce the output of this random number generator, etc. I don't see any way to get interesting answers. \$\endgroup\$
    – feersum
    Aug 23 '16 at 6:31
  • \$\begingroup\$ @feersum I'd probably disqualify errors and crashes and stacktrace outputs and such, and maybe all built-in non-trivial algorithms. Thanks for pointing those out. \$\endgroup\$
    – Sparr
    Aug 24 '16 at 7:26
  • \$\begingroup\$ @DestructibleWatermelon you don't have to beat the golfing language to win. The winning entry will probably still have a shorter Jelly solution than Python (or whatever). \$\endgroup\$
    – Sparr
    Aug 24 '16 at 7:27
  • \$\begingroup\$ I don't know of any golfing languages where creating a simple webserver is possible. All this would be is finding a task that isn't normally required for when doing code-golf \$\endgroup\$
    – Blue
    Aug 24 '16 at 14:16
  • \$\begingroup\$ I'm thinking of restricting it to algorithms and output, not stuff like network and file access. \$\endgroup\$
    – Sparr
    Aug 24 '16 at 22:11
-3
\$\begingroup\$

Draw "Stack Exchange"

Stack Exchange has many site (159) and It has a logotype too. Anyway, In this challenge you'll need to draw Stack Exchange in the most shortest way.

This is a code-golf. challenge.

Rules

  1. Have fun!
  2. You've to draw Stack Exchange, you can't use Paint or something like that, you can't use libraries.
\$\endgroup\$
3
  • \$\begingroup\$ Challenges that start with "Most creative" are almost certainly guaranteed to not generate creative answers (or any answers for that matter) \$\endgroup\$
    – Fatalize
    Sep 8 '16 at 13:47
  • \$\begingroup\$ @Fatalize I changed the challenge. \$\endgroup\$
    – Rizze
    Sep 8 '16 at 13:54
  • \$\begingroup\$ Now there is basically no interesting solution possible to the challenge, because there is no patterns in Stack Exchange. So all shortest solutions will to print that string directly or a compressed version of it. \$\endgroup\$
    – Fatalize
    Sep 8 '16 at 13:58
-3
\$\begingroup\$

Open the browser, polyglot edition.

Your job is to open a browser window of the default browser to https://codegolf.stackexchange.com in as many languages as possible.

Your code must open the browser itself, and cannot rely on an open one.

Rules

  • Versions of the same language are considered a single language
\$\endgroup\$
2
  • 1
    \$\begingroup\$ Define "default browser" in the context of non-Windows OSes. \$\endgroup\$ Sep 25 '16 at 21:47
  • 3
    \$\begingroup\$ @PeterTaylor Whatever browser the open command works with. There was a previous version of this challenge, it worked then. \$\endgroup\$ Sep 25 '16 at 22:24
-3
\$\begingroup\$

Mad lads!

Inspired by the paper calculator episode of Numberphile.

Your challenge in this puzzle is to take in two two-bit (0-3) numbers and output the sum of the two numbers... using ordinary household objects.

Some possibilities of how this can be done:
Dominoes
Paper
Marbles
music box (+ some helpers..)

Input:

input must always be involving two sets of two-bit integers, which can be represented by anything you like, so long as the cardinality of the representations is the same.

Output:

The output should be a single 3-bit integer which represents the addition of the two inputs.

Rules:

  • your device cannot have the capability to connect to the internet in any way (sorry, this also disqualifies carrier pigeons). Your device must also not be able to perform this function alone (eg a calculator).
  • It must be somewhat original. put your own twist on it!
  • though, your entry can be alive (does your dog add??), so long as your entry is not in discomfort.
  • Pictures are required for each entry to show how it works. videos would be better, but aren't required!
  • The sole function of your machine does not have to be adding, it can do other things as well. This means that older projects that may serve a slightly different function are welcome, so long as they meet the rules stated above.
  • Your device can be as simple or as complex as you like, so long as it doesn't get to a point where it's completely esoteric.

Judging:

You will be judged based on ease of use, ease of understanding, as well as originality! This means that entries should be easily explained, used, and be unique in some way.

This is a , so the most upvotes wins! good luck!

\$\endgroup\$
7
  • 2
    \$\begingroup\$ In my opinion, this is not a programming challenge. Once we start leaving the realm of a computer-based programming paradigm, a challenge becomes more difficult to test, replicate, and verify. Plus, something done with Dominoes, for example, may not "run" to completion 100% of the time, and in my opinion that makes it non-deterministic. \$\endgroup\$
    – mbomb007
    Sep 26 '16 at 18:43
  • \$\begingroup\$ Related meta: meta.codegolf.stackexchange.com/a/10151/34718. TLDR, if you want to program with dominoes, find or create a domino simulator where programs can be scored in bytes. Instead of marbles, use Marbelous. \$\endgroup\$
    – mbomb007
    Sep 26 '16 at 18:52
  • \$\begingroup\$ @mbomb007 what about papers, and counting dogs? This isn't a code golf, it's a popularity contest \$\endgroup\$
    – user56309
    Sep 26 '16 at 19:20
  • 2
    \$\begingroup\$ Popcons still require the use of programming languages. meta.codegolf.stackexchange.com/q/2028/34718. See both linked meta questions. What you are trying to do is off-topic for this site. \$\endgroup\$
    – mbomb007
    Sep 26 '16 at 19:42
  • \$\begingroup\$ @mbomb007 I'm not sure you linked the correct thing. I have found no reference of popularity contests in your recent link.. \$\endgroup\$
    – user56309
    Sep 26 '16 at 19:44
  • \$\begingroup\$ Rules and meta consensus apply to all challenges, not just code-golf. \$\endgroup\$
    – mbomb007
    Sep 26 '16 at 20:21
  • \$\begingroup\$ Popcons should be held to a higher standard than other questions, not a lower one as your comments imply. \$\endgroup\$ Sep 27 '16 at 7:33
-3
\$\begingroup\$

99 selttob fo reeb no eht llaw

I teb ev'uoy lla draeh tuoba eht doog 'lo 99 selttob fo reeb no eht llaw. Llew ti os sneppah taht I emoc morf na evitanretla esrevinu - eht esrevinu erehw ew etirw gnihtyreve ni esrever! Ew peek eht snoitisop fo lanigiro hguoht. Siht osla snaem reporp noitazilatipac fo tsrif (ekil rettel ni siht txet). Ruoy egnellahc si ot etirw a margorp taht stuptuo eht lausu 99 selttob fo reeb no eht llaw, tub ni esrever (ni ruo egaugnal uoy dluow llac ti 99 bottles of beer on the wall). Siht si a ytiralupop tsetnoc, os teg evitaerc dna yrt ot sserpmi eht dworc. Doog kcul!

I bet you've all heard about the good ol' 99 bottles of beer on the wall. Well it so happens that I come from an alternative universe - the universe where we write everything in reverse! We keep the positions of original though. This also means proper capitalization of first letter(like in this text). Your challenge is to write a program that outputs the usual 99 bottles of beer on the wall, but in reverse (in our language you would call it 99 selttob fo reeb no eht llaw). This is a popularity contest, so get creative and try to impress the crowd. Good luck!

Elpmas fo derised tuptuo:

Sample of desired output:


99 selttob fo reeb no eht llaw, 99 selttob fo reeb. Ekat eno nwod dna ssap ti dnuora, 89 selttob fo reeb no eht llaw.

89 selttob fo reeb no eht llaw, 89 selttob fo reeb. Ekat eno nwod dna ssap ti dnuora, 79 selttob fo reeb no eht llaw.

...

1 elttob fo reeb no eht llaw, 1 elttob fo reeb. Ekat eno nwod dna ssap ti dnuora, on erom selttob fo reeb no eht llaw.

On erom selttob fo reeb no eht llaw, on erom selttob fo reeb. Og ot eht erots dna yub emos erom, 99 selttob fo reeb no eht llaw.

\$\endgroup\$
8
  • 3
    \$\begingroup\$ There's no need for the reversed text in the description - it distracts the viewer from the challenge at hand. \$\endgroup\$
    – clismique
    Oct 21 '16 at 12:06
  • \$\begingroup\$ @Qwerp-Derp I wanted to make this a bit more "unique" and "immersing", so I thought about giving the reversed description(I like it). I also included original text(although in spoilers), but I was also wondering about distracting readers. Do you have some other idea on how to keep both versions without making it look obscure? \$\endgroup\$ Oct 21 '16 at 12:10
  • 2
    \$\begingroup\$ 1. This should not be a popularity-contest. 2. It's fundamentally a duplicate of codegolf.stackexchange.com/q/64198/194 . 3. If you're going to muck around with the question text, write a program that mucks it around correctly. "elpmaS" doesn't follow the specified transformation rule. \$\endgroup\$ Oct 21 '16 at 12:34
  • \$\begingroup\$ @PeterTaylor 1. why not? 2. It's not. You can't simply reverse, and counting is a bit different. \$\endgroup\$ Oct 21 '16 at 13:24
  • 2
    \$\begingroup\$ Do X creatively popularity contests have fallen out of scope. This will get closed if posted on main. \$\endgroup\$
    – Dennis
    Oct 21 '16 at 13:46
  • \$\begingroup\$ @Dennis Damn, too bad. I guess I won't be posting it then, it's boring "shortest code". \$\endgroup\$ Oct 21 '16 at 14:16
  • 2
    \$\begingroup\$ What does this add to the original '99 bottles of beer on the wall'? \$\endgroup\$
    – 0WJYxW9FMN
    Oct 21 '16 at 20:54
  • \$\begingroup\$ This sandbox post has had little activity in a while and little positive reception from the community. Please improve / edit it or delete it to help us clean up the sandbox. \$\endgroup\$
    – user58826
    Jun 9 '17 at 14:08
-3
\$\begingroup\$

Best n out of 2n - 1

Challenge:

This one should be relatively simple. Output this exact text:

Best [n] out of [2n - 1].

given n as an input.

Input:

Just the integer n, can be from stdin or as an argument. n will always be greater than 0.

Output:

The exact text above. Trailing spaces/newlines are allowed.

Rules:

This is , so shortest code in bytes wins. Standard loopholes are forbidden.

Meta:

Is this too simple? What other tags should be included, ?

\$\endgroup\$
3
  • 1
    \$\begingroup\$ Seems like a dupe of 2spooky4me, just with a different operator. \$\endgroup\$
    – Geobits
    Nov 1 '16 at 17:52
  • 1
    \$\begingroup\$ Your wording specifies "this exact text" while I think your intent is "Best 5 out of 9." or the like. \$\endgroup\$ Nov 1 '16 at 17:53
  • \$\begingroup\$ @Geobits Aha, I knew I remembered a similar challenge. Just forgot the exact name, so I thought maybe I was just imagining things after I tried to find it. My bad. \$\endgroup\$
    – Yodle
    Nov 1 '16 at 17:55

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .