571
\$\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 requires more feedback, but it's been ignored, you can ask for feedback in The Nineteenth Byte. It's not only allowed, but highly recommended! Be patient and try not to nag people though, you might have to ask multiple times.

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".

\$\endgroup\$
1
  • \$\begingroup\$ What if I posted on the sandbox a long time ago and get no response? \$\endgroup\$
    – None1
    May 15 at 14:05

4689 Answers 4689

1
153 154 155 156
157
-6
\$\begingroup\$

Shortest Possible 240 Sided Die Program: Using No Constant Greater than 6

Have you ever played Yahtzee with a 240-sided die? No, probably not. Anyway, I came up with the idea of a 240-sided die program, but to make it hard, you cannot use a constant with an absolute value greater than 6. For example, randInt(1,240) wouldn't work. The chances of any number 1-240 must be completely equal, and using expressions that represent numbers with an absolute value larger than 240 is not allowed. For example, randInt(1,4*6*2*5) is against the rules, since 4*6*2*5 evaluates to 240. Standard loopholes prohibited, and you're code golfing.

\$\endgroup\$
1
  • \$\begingroup\$ Comments are not for extended discussion; this conversation has been moved to chat. \$\endgroup\$
    – DJMcMayhem
    Apr 27, 2018 at 20:19
-6
\$\begingroup\$

Merge two code in two languages into a polyglot.

E.g. If you choose C & Python 3, you can merge

main(){puts("a");}

and

print(6)

into

#define print(x) main(){puts("a");}
print(6)

(for it's hard to have a score on language difficulty, optimizy, etc.)

\$\endgroup\$
2
  • 2
    \$\begingroup\$ This is way too broad as it is currently written. "Do X Creatively" is out of scope, even for popularity-contests. \$\endgroup\$ May 17, 2018 at 18:04
  • \$\begingroup\$ @AdmBorkBork It seems not a creatively challenge? though I don't vote it that high either \$\endgroup\$
    – l4m2
    May 17, 2018 at 18:20
-6
\$\begingroup\$

I recently made a language called bit, and your challenge is to create a valid program that takes 2 numbers from STDIN, and outputs the sum of them. You may assume the numbers are no more than 5 digits, and your output doesn't need to be more than 5 digits long

Bit Specification

You can find the specification and an interpreter at the GitHub repo

\$\endgroup\$
13
  • \$\begingroup\$ Do you have a reference interpreter or compiler? How can we test a solution? \$\endgroup\$
    – qwr
    Sep 7, 2018 at 20:57
  • \$\begingroup\$ @qwr I do, in Java, should I add it to the question? \$\endgroup\$
    – kepe
    Sep 7, 2018 at 21:01
  • \$\begingroup\$ Yes it's very helpful \$\endgroup\$
    – qwr
    Sep 7, 2018 at 22:06
  • \$\begingroup\$ @qwr Actually how am I going to do that, the file isn't online anywhere \$\endgroup\$
    – kepe
    Sep 7, 2018 at 22:11
  • \$\begingroup\$ You may just paste the java code in your question, or even better link a TIO script (tio.run/#java-openjdk) so people can run it online \$\endgroup\$
    – qwr
    Sep 9, 2018 at 5:32
  • \$\begingroup\$ @qwr It's much more than 1k lines of code, and multiple classes, however I have a GitHub now, added to question \$\endgroup\$
    – kepe
    Sep 9, 2018 at 15:31
  • \$\begingroup\$ Ok that suggests to me the problem may be too long. Others may feel differently \$\endgroup\$
    – qwr
    Sep 9, 2018 at 19:18
  • \$\begingroup\$ @qwr Not really, Java code tends to be long, there's no problem in that \$\endgroup\$
    – kepe
    Sep 10, 2018 at 18:19
  • 1
    \$\begingroup\$ Well the meta here is for challenges that don't feel arbitrary, and to me this is leaning towards an arbitrary list of commands for your own personal language. \$\endgroup\$
    – qwr
    Sep 10, 2018 at 20:57
  • \$\begingroup\$ @qwr So you think the idea is bad? \$\endgroup\$
    – kepe
    Sep 10, 2018 at 21:49
  • \$\begingroup\$ I wouldn't call it bad, which is a pretty broad term, but challenges that are easy to understand and conceptualize are generally better received and get more responses (if that is what you want) \$\endgroup\$
    – qwr
    Sep 11, 2018 at 20:09
  • \$\begingroup\$ Unrelated: Github is generally for hosting source code and packages/binaries like .jar (these can be included in releases) \$\endgroup\$
    – qwr
    Sep 11, 2018 at 20:11
  • 2
    \$\begingroup\$ If you posted this it would likely get closed as a dupe of Add two numbers. Instead of posting this, I'd recommend just submitting solutions in Bit yourself and seeing if anyone else is interested \$\endgroup\$
    – Jo King Mod
    Sep 13, 2018 at 8:02
-6
\$\begingroup\$

Count up to N without math or inbuilds

Idea:

The challenge is the following: count from 0 up to N without using mathematical operations or other (counting, list or whatever) inbuilds. You handle the incoming number N as a string on which you can't apply mathematical operations like addition or substraction for example. Also don't use list things like print [0..N] or something other inbuilt of your language. Counting inside arrays, for example at index x+1 or something like that to get position after another is allowed. But you must not apply any (mathematical) operations on the numbers between 0 and N itself.

Think that you are like a small child and don't know anything about maths. You only know: after 0 comes 1, after 1 comes 2 ... after 8 comes 9 and after 9 comes 0 and you have to "increment" the number in front of it.

Examples:

  • So after the number 9 (with leading, but not outwritten zero) comes, you write zero and place the number 1 in front of it for 10.
  • For 19 you write 0 and "increment" the number in front to the next one, making it 20.
  • For 399 you do: last 9 goes to zero, 9 in front goes to 0 too and the 3 goes to 4, making it 400.

Task:

Write a function or program which takes N via the way you want to as its input.
Output the numbers from 0 up to N (element after element or once as a list)
Important: use a seperator as 01234567891011 will become unreadable with larger numbers

Test Case:

Taking a string of seperated numbers and your seperator, you can check your answer here.

Ah, and also don't forget that this is code-golf, so shortest answer in bytes will win. Also, all standard loophole rules and so on apply (you should know from all the other challenges!)


Sandbox

I hope this challenge has never been here, I did not found it while searching trough the already asked challenges (maybe I did not found it because I did not knew the correct english words to search for because english is not my first language). Thank you already in advance for helping to improve this challenge.

Tags:

counting, code-golf

\$\endgroup\$
9
  • 7
    \$\begingroup\$ Thank you for putting your first challenge into the Sandbox! Know that do-X-without-Y [are difficult to get right], and generally discouraged for those that do not have a lot of challenge writing experience. If all built-in language features are prohibited, then the challenge is obviously impossible, and if not, how will you decide what is and what isn't allowed for all languages. Please do not make assumptions about language features — there are odd languages out there. \$\endgroup\$
    – Adám
    Jul 24, 2019 at 6:29
  • \$\begingroup\$ @Adám I see what you mean with built ins, but dont know how to specify it in other terms. i mean things like inbuild methods that automatically output from [0..N] wihtout doing anything as a programmer. What I want to see, is the numbers from 0 to N, each seen as a string with no mathematical operations on it. The counting should happen in a way of the "algorithm" of how small children (with no knowledge about mathematics) count, pattern matching stlye. A child sees the 1, takes the next known value 2 and that it is.,Is it understandable what I mean? \$\endgroup\$
    – pixma140
    Jul 24, 2019 at 7:00
  • 1
    \$\begingroup\$ Sure it is clear what you want, but challenges must be unambiguous, and it must be possible to objectively judge if an answer is allowed or not. \$\endgroup\$
    – Adám
    Jul 24, 2019 at 7:43
  • 1
    \$\begingroup\$ Maybe instead you rephrase the challenge as: Given a list of digits, increment the number that they represent in base-10. This way, you can require that solutions handle inputs that are way too wide for normal integer representations. Of course, some languages have "infinite-precision" integers, but such solutions then just don't deserve upvotes for cleverness. \$\endgroup\$
    – Adám
    Jul 24, 2019 at 7:48
  • \$\begingroup\$ @Adám - or is it possible to write it like: "'count' from 0 to N, but not by interpreting 0 to N as numbers, they are strings. you are a small child, you know nothing about arithmetics and you only know the word representations of numbers and what number comes after another by following rules. [...]". or does this still opens the possibility to use the numbers as integers for example? \$\endgroup\$
    – pixma140
    Jul 25, 2019 at 5:45
  • \$\begingroup\$ That doesn't help, we'll just evaluate the string, find the range, then stringify the numbers. Also, if you prohibit arithmetic, how are we to add digits? With a lookup table? \$\endgroup\$
    – Adám
    Jul 25, 2019 at 6:47
  • \$\begingroup\$ Yeah that is what I want to achieve. The one solving the task needs to lookup what number comes after the one he is looking at (without doing calculus on the number itself). something like having a string all="01234567890" and with that you search for s in all and look at the next symbol (next symbol can be fetched with +1, this is allowed, but you are not allowed to add +1 to s directly). e.g. you have the number 5, you lookup the next number in all, which is 6, and so on. the "next" operation is something the child does intuitive, without knowing that this is an mathematical operation. \$\endgroup\$
    – pixma140
    Jul 25, 2019 at 7:38
  • \$\begingroup\$ on top of that, there is one special case when going from most significant position of the number beeing a 9 to a 0 and adding a new 1 as most significant position. (9->10, 99->100, 999->1000 and so on ...). is that too simple? guess it can be interesting what kind of solution people come up on the lookup thing and special case optimization - @Adám \$\endgroup\$
    – pixma140
    Jul 25, 2019 at 7:50
  • \$\begingroup\$ Let us continue this discussion in chat. \$\endgroup\$
    – Adám
    Jul 25, 2019 at 8:41
-6
\$\begingroup\$

Thoughts on a scoring system that levels the playing field between golfing languages and common languages.

Divide the byte length of a program by a "popularity" metric e.g.

  • Wikipedia page views in the last 30 days (or esolangs.org)
  • Wikipedia edits
  • questions on Stack Overflow tagged with that language

Idea would be to encourage golfing in languages used day to day rather than the languages written purely for the purpose of golfing.

Pros

  • Code Golf questions often reach the "Hot network questions" sidebar but then new/unfamiliar users are met with incomprehensible code, this could reduce that
  • encourage new users to attempt an answer
  • whilst users are encouraged to compete with others in the same language, the overall winner normally gets the accepted answer, this could help that

Cons

  • this is Code Golf, so least bytes is the goal!
  • people have put immense effort into creating the golfing languages and that shouldn't be punished
  • finding/creating a "good" popularity metric is probably going to be a lot of work

Case studies

Rescoring Covfefify a string by dividing the length by * wikipedia (or eslangs.org if no wiki page) number of edits * 1000. Then rounded down.

Lang - OG score - Edits - New score

Jelly - 57 - 9 - 6333

JavaScript - 103 - 7695 - 13

Jelly - 39 - 9 - 4333

C - 175 - 8659 - 20

CJam - 56 - 9 - 6222

Perl 5 (Perl) - 71 - 4133 - 17

PHP - 121 - 11287 - 10

Pyth - 54 - 22 - 2454

Python 3 (Python) - 139 - 8850 - 15

Java 8 (Java) - 222 - 8978 - 24

Haskell - 136 - 2089 - 65

Ruby - 90 - 2936 - 30

Results in a HTML table

<google-sheets-html-origin style="color: rgb(0, 0, 0);"><table xmlns="http://www.w3.org/1999/xhtml" cellspacing="0" cellpadding="0" dir="ltr" border="1" style="table-layout: fixed; font-size: 10pt; font-family: Arial; width: 0px; border-collapse: collapse; border: none;">
  <thead>
    <tr style="height: 21px;">
      <th>Lang</th>
      <th>OG score</th>
      <th>Edits</th>
      <th>New score</th>
      <th>Log(edits) score</th>
    </tr>
  </thead><colgroup><col width="100"><col width="100"><col width="100"><col width="100"><col width="100"></colgroup>
  <tbody>
    <tr style="height: 21px;">
      <td data-sheets-value="{&quot;1&quot;:2,&quot;2&quot;:&quot;Jelly&quot;}" style="border: 1px solid rgb(204, 204, 204); overflow: hidden; padding: 2px 3px; vertical-align: bottom;">Jelly</td>
      <td data-sheets-value="{&quot;1&quot;:3,&quot;3&quot;:57}" style="border: 1px solid rgb(204, 204, 204); overflow: hidden; padding: 2px 3px; vertical-align: bottom; text-align: right;">57</td>
      <td data-sheets-value="{&quot;1&quot;:3,&quot;3&quot;:9}" style="border: 1px solid rgb(204, 204, 204); overflow: hidden; padding: 2px 3px; vertical-align: bottom; text-align: right;">9</td>
      <td data-sheets-value="{&quot;1&quot;:3,&quot;3&quot;:6333.333333333333}" data-sheets-numberformat="{&quot;1&quot;:2,&quot;2&quot;:&quot;0&quot;,&quot;3&quot;:1}" data-sheets-formula="=R[0]C[-2]/R[0]C[-1]*1000" style="border: 1px solid rgb(204, 204, 204); overflow: hidden; padding: 2px 3px; vertical-align: bottom; text-align: right;">6333</td>
      <td data-sheets-value="{&quot;1&quot;:3,&quot;3&quot;:59.733243317247464}" data-sheets-formula="=R[0]C[-3]/LOG(R[0]C[-2])" style="border: 1px solid rgb(204, 204, 204); overflow: hidden; padding: 2px 3px; vertical-align: bottom; text-align: right;">59.73324332</td>
    </tr>
    <tr style="height: 21px;">
      <td data-sheets-value="{&quot;1&quot;:2,&quot;2&quot;:&quot;JavaScript&quot;}" style="border: 1px solid rgb(204, 204, 204); overflow: hidden; padding: 2px 3px; vertical-align: bottom;">JavaScript</td>
      <td data-sheets-value="{&quot;1&quot;:3,&quot;3&quot;:103}" style="border: 1px solid rgb(204, 204, 204); overflow: hidden; padding: 2px 3px; vertical-align: bottom; text-align: right;">103</td>
      <td data-sheets-value="{&quot;1&quot;:3,&quot;3&quot;:7695}" style="border: 1px solid rgb(204, 204, 204); overflow: hidden; padding: 2px 3px; vertical-align: bottom; text-align: right;">7695</td>
      <td data-sheets-value="{&quot;1&quot;:3,&quot;3&quot;:13.385315139701104}" data-sheets-numberformat="{&quot;1&quot;:2,&quot;2&quot;:&quot;0&quot;,&quot;3&quot;:1}" data-sheets-formula="=R[0]C[-2]/R[0]C[-1]*1000" style="border: 1px solid rgb(204, 204, 204); overflow: hidden; padding: 2px 3px; vertical-align: bottom; text-align: right;">13</td>
      <td data-sheets-value="{&quot;1&quot;:3,&quot;3&quot;:26.50398111914659}" data-sheets-formula="=R[0]C[-3]/LOG(R[0]C[-2])" style="border: 1px solid rgb(204, 204, 204); overflow: hidden; padding: 2px 3px; vertical-align: bottom; text-align: right;">26.50398112</td>
    </tr>
    <tr style="height: 21px;">
      <td data-sheets-value="{&quot;1&quot;:2,&quot;2&quot;:&quot;Jelly&quot;}" style="border: 1px solid rgb(204, 204, 204); overflow: hidden; padding: 2px 3px; vertical-align: bottom;">Jelly</td>
      <td data-sheets-value="{&quot;1&quot;:3,&quot;3&quot;:39}" style="border: 1px solid rgb(204, 204, 204); overflow: hidden; padding: 2px 3px; vertical-align: bottom; text-align: right;">39</td>
      <td data-sheets-value="{&quot;1&quot;:3,&quot;3&quot;:9}" style="border: 1px solid rgb(204, 204, 204); overflow: hidden; padding: 2px 3px; vertical-align: bottom; text-align: right;">9</td>
      <td data-sheets-value="{&quot;1&quot;:3,&quot;3&quot;:4333.333333333333}" data-sheets-numberformat="{&quot;1&quot;:2,&quot;2&quot;:&quot;0&quot;,&quot;3&quot;:1}" data-sheets-formula="=R[0]C[-2]/R[0]C[-1]*1000" style="border: 1px solid rgb(204, 204, 204); overflow: hidden; padding: 2px 3px; vertical-align: bottom; text-align: right;">4333</td>
      <td data-sheets-value="{&quot;1&quot;:3,&quot;3&quot;:40.870113848643}" data-sheets-formula="=R[0]C[-3]/LOG(R[0]C[-2])" style="border: 1px solid rgb(204, 204, 204); overflow: hidden; padding: 2px 3px; vertical-align: bottom; text-align: right;">40.87011385</td>
    </tr>
    <tr style="height: 21px;">
      <td data-sheets-value="{&quot;1&quot;:2,&quot;2&quot;:&quot;C&quot;}" style="border: 1px solid rgb(204, 204, 204); overflow: hidden; padding: 2px 3px; vertical-align: bottom;">C</td>
      <td data-sheets-value="{&quot;1&quot;:3,&quot;3&quot;:175}" style="border: 1px solid rgb(204, 204, 204); overflow: hidden; padding: 2px 3px; vertical-align: bottom; text-align: right;">175</td>
      <td data-sheets-value="{&quot;1&quot;:3,&quot;3&quot;:8659}" style="border: 1px solid rgb(204, 204, 204); overflow: hidden; padding: 2px 3px; vertical-align: bottom; text-align: right;">8659</td>
      <td data-sheets-value="{&quot;1&quot;:3,&quot;3&quot;:20.21018593371059}" data-sheets-numberformat="{&quot;1&quot;:2,&quot;2&quot;:&quot;0&quot;,&quot;3&quot;:1}" data-sheets-formula="=R[0]C[-2]/R[0]C[-1]*1000" style="border: 1px solid rgb(204, 204, 204); overflow: hidden; padding: 2px 3px; vertical-align: bottom; text-align: right;">20</td>
      <td data-sheets-value="{&quot;1&quot;:3,&quot;3&quot;:44.44480858549206}" data-sheets-formula="=R[0]C[-3]/LOG(R[0]C[-2])" style="border: 1px solid rgb(204, 204, 204); overflow: hidden; padding: 2px 3px; vertical-align: bottom; text-align: right;">44.44480859</td>
    </tr>
    <tr style="height: 21px;">
      <td data-sheets-value="{&quot;1&quot;:2,&quot;2&quot;:&quot;CJam&quot;}" style="border: 1px solid rgb(204, 204, 204); overflow: hidden; padding: 2px 3px; vertical-align: bottom;">CJam</td>
      <td data-sheets-value="{&quot;1&quot;:3,&quot;3&quot;:56}" style="border: 1px solid rgb(204, 204, 204); overflow: hidden; padding: 2px 3px; vertical-align: bottom; text-align: right;">56</td>
      <td data-sheets-value="{&quot;1&quot;:3,&quot;3&quot;:9}" style="border: 1px solid rgb(204, 204, 204); overflow: hidden; padding: 2px 3px; vertical-align: bottom; text-align: right;">9</td>
      <td data-sheets-value="{&quot;1&quot;:3,&quot;3&quot;:6222.222222222223}" data-sheets-numberformat="{&quot;1&quot;:2,&quot;2&quot;:&quot;0&quot;,&quot;3&quot;:1}" data-sheets-formula="=R[0]C[-2]/R[0]C[-1]*1000" style="border: 1px solid rgb(204, 204, 204); overflow: hidden; padding: 2px 3px; vertical-align: bottom; text-align: right;">6222</td>
      <td data-sheets-value="{&quot;1&quot;:3,&quot;3&quot;:58.68529168010277}" data-sheets-formula="=R[0]C[-3]/LOG(R[0]C[-2])" style="border: 1px solid rgb(204, 204, 204); overflow: hidden; padding: 2px 3px; vertical-align: bottom; text-align: right;">58.68529168</td>
    </tr>
    <tr style="height: 21px;">
      <td data-sheets-value="{&quot;1&quot;:2,&quot;2&quot;:&quot;Perl 5 (Perl)&quot;}" style="border: 1px solid rgb(204, 204, 204); overflow: hidden; padding: 2px 3px; vertical-align: bottom;">Perl 5 (Perl)</td>
      <td data-sheets-value="{&quot;1&quot;:3,&quot;3&quot;:71}" style="border: 1px solid rgb(204, 204, 204); overflow: hidden; padding: 2px 3px; vertical-align: bottom; text-align: right;">71</td>
      <td data-sheets-value="{&quot;1&quot;:3,&quot;3&quot;:4133}" style="border: 1px solid rgb(204, 204, 204); overflow: hidden; padding: 2px 3px; vertical-align: bottom; text-align: right;">4133</td>
      <td data-sheets-value="{&quot;1&quot;:3,&quot;3&quot;:17.17880474231793}" data-sheets-numberformat="{&quot;1&quot;:2,&quot;2&quot;:&quot;0&quot;,&quot;3&quot;:1}" data-sheets-formula="=R[0]C[-2]/R[0]C[-1]*1000" style="border: 1px solid rgb(204, 204, 204); overflow: hidden; padding: 2px 3px; vertical-align: bottom; text-align: right;">17</td>
      <td data-sheets-value="{&quot;1&quot;:3,&quot;3&quot;:19.633514701742165}" data-sheets-formula="=R[0]C[-3]/LOG(R[0]C[-2])" style="border: 1px solid rgb(204, 204, 204); overflow: hidden; padding: 2px 3px; vertical-align: bottom; text-align: right;">19.6335147</td>
    </tr>
    <tr style="height: 21px;">
      <td data-sheets-value="{&quot;1&quot;:2,&quot;2&quot;:&quot;PHP&quot;}" style="border: 1px solid rgb(204, 204, 204); overflow: hidden; padding: 2px 3px; vertical-align: bottom;">PHP</td>
      <td data-sheets-value="{&quot;1&quot;:3,&quot;3&quot;:121}" style="border: 1px solid rgb(204, 204, 204); overflow: hidden; padding: 2px 3px; vertical-align: bottom; text-align: right;">121</td>
      <td data-sheets-value="{&quot;1&quot;:3,&quot;3&quot;:11287}" style="border: 1px solid rgb(204, 204, 204); overflow: hidden; padding: 2px 3px; vertical-align: bottom; text-align: right;">11287</td>
      <td data-sheets-value="{&quot;1&quot;:3,&quot;3&quot;:10.720297687605209}" data-sheets-numberformat="{&quot;1&quot;:2,&quot;2&quot;:&quot;0&quot;,&quot;3&quot;:1}" data-sheets-formula="=R[0]C[-2]/R[0]C[-1]*1000" style="border: 1px solid rgb(204, 204, 204); overflow: hidden; padding: 2px 3px; vertical-align: bottom; text-align: right;">11</td>
      <td data-sheets-value="{&quot;1&quot;:3,&quot;3&quot;:29.857533728767567}" data-sheets-formula="=R[0]C[-3]/LOG(R[0]C[-2])" style="border: 1px solid rgb(204, 204, 204); overflow: hidden; padding: 2px 3px; vertical-align: bottom; text-align: right;">29.85753373</td>
    </tr>
    <tr style="height: 21px;">
      <td data-sheets-value="{&quot;1&quot;:2,&quot;2&quot;:&quot;Pyth&quot;}" style="border: 1px solid rgb(204, 204, 204); overflow: hidden; padding: 2px 3px; vertical-align: bottom;">Pyth</td>
      <td data-sheets-value="{&quot;1&quot;:3,&quot;3&quot;:54}" style="border: 1px solid rgb(204, 204, 204); overflow: hidden; padding: 2px 3px; vertical-align: bottom; text-align: right;">54</td>
      <td data-sheets-value="{&quot;1&quot;:3,&quot;3&quot;:22}" style="border: 1px solid rgb(204, 204, 204); overflow: hidden; padding: 2px 3px; vertical-align: bottom; text-align: right;">22</td>
      <td data-sheets-value="{&quot;1&quot;:3,&quot;3&quot;:2454.5454545454545}" data-sheets-numberformat="{&quot;1&quot;:2,&quot;2&quot;:&quot;0&quot;,&quot;3&quot;:1}" data-sheets-formula="=R[0]C[-2]/R[0]C[-1]*1000" style="border: 1px solid rgb(204, 204, 204); overflow: hidden; padding: 2px 3px; vertical-align: bottom; text-align: right;">2455</td>
      <td data-sheets-value="{&quot;1&quot;:3,&quot;3&quot;:40.22578042776074}" data-sheets-formula="=R[0]C[-3]/LOG(R[0]C[-2])" style="border: 1px solid rgb(204, 204, 204); overflow: hidden; padding: 2px 3px; vertical-align: bottom; text-align: right;">40.22578043</td>
    </tr>
    <tr style="height: 21px;">
      <td data-sheets-value="{&quot;1&quot;:2,&quot;2&quot;:&quot;Python 3 (Python)&quot;}" style="border: 1px solid rgb(204, 204, 204); overflow: hidden; padding: 2px 3px; vertical-align: bottom;">Python 3 (Python)</td>
      <td data-sheets-value="{&quot;1&quot;:3,&quot;3&quot;:139}" style="border: 1px solid rgb(204, 204, 204); overflow: hidden; padding: 2px 3px; vertical-align: bottom; text-align: right;">139</td>
      <td data-sheets-value="{&quot;1&quot;:3,&quot;3&quot;:8850}" style="border: 1px solid rgb(204, 204, 204); overflow: hidden; padding: 2px 3px; vertical-align: bottom; text-align: right;">8850</td>
      <td data-sheets-value="{&quot;1&quot;:3,&quot;3&quot;:15.706214689265536}" data-sheets-numberformat="{&quot;1&quot;:2,&quot;2&quot;:&quot;0&quot;,&quot;3&quot;:1}" data-sheets-formula="=R[0]C[-2]/R[0]C[-1]*1000" style="border: 1px solid rgb(204, 204, 204); overflow: hidden; padding: 2px 3px; vertical-align: bottom; text-align: right;">16</td>
      <td data-sheets-value="{&quot;1&quot;:3,&quot;3&quot;:35.21712638535709}" data-sheets-formula="=R[0]C[-3]/LOG(R[0]C[-2])" style="border: 1px solid rgb(204, 204, 204); overflow: hidden; padding: 2px 3px; vertical-align: bottom; text-align: right;">35.21712639</td>
    </tr>
    <tr style="height: 21px;">
      <td data-sheets-value="{&quot;1&quot;:2,&quot;2&quot;:&quot;Java 8 (Java)&quot;}" style="border: 1px solid rgb(204, 204, 204); overflow: hidden; padding: 2px 3px; vertical-align: bottom;">Java 8 (Java)</td>
      <td data-sheets-value="{&quot;1&quot;:3,&quot;3&quot;:222}" style="border: 1px solid rgb(204, 204, 204); overflow: hidden; padding: 2px 3px; vertical-align: bottom; text-align: right;">222</td>
      <td data-sheets-value="{&quot;1&quot;:3,&quot;3&quot;:8978}" style="border: 1px solid rgb(204, 204, 204); overflow: hidden; padding: 2px 3px; vertical-align: bottom; text-align: right;">8978</td>
      <td data-sheets-value="{&quot;1&quot;:3,&quot;3&quot;:24.72711071508131}" data-sheets-numberformat="{&quot;1&quot;:2,&quot;2&quot;:&quot;0&quot;,&quot;3&quot;:1}" data-sheets-formula="=R[0]C[-2]/R[0]C[-1]*1000" style="border: 1px solid rgb(204, 204, 204); overflow: hidden; padding: 2px 3px; vertical-align: bottom; text-align: right;">25</td>
      <td data-sheets-value="{&quot;1&quot;:3,&quot;3&quot;:56.157327114648886}" data-sheets-formula="=R[0]C[-3]/LOG(R[0]C[-2])" style="border: 1px solid rgb(204, 204, 204); overflow: hidden; padding: 2px 3px; vertical-align: bottom; text-align: right;">56.15732711</td>
    </tr>
    <tr style="height: 21px;">
      <td data-sheets-value="{&quot;1&quot;:2,&quot;2&quot;:&quot;Haskell&quot;}" style="border: 1px solid rgb(204, 204, 204); overflow: hidden; padding: 2px 3px; vertical-align: bottom;">Haskell</td>
      <td data-sheets-value="{&quot;1&quot;:3,&quot;3&quot;:136}" style="border: 1px solid rgb(204, 204, 204); overflow: hidden; padding: 2px 3px; vertical-align: bottom; text-align: right;">136</td>
      <td data-sheets-value="{&quot;1&quot;:3,&quot;3&quot;:2089}" style="border: 1px solid rgb(204, 204, 204); overflow: hidden; padding: 2px 3px; vertical-align: bottom; text-align: right;">2089</td>
      <td data-sheets-value="{&quot;1&quot;:3,&quot;3&quot;:65.10292005744375}" data-sheets-numberformat="{&quot;1&quot;:2,&quot;2&quot;:&quot;0&quot;,&quot;3&quot;:1}" data-sheets-formula="=R[0]C[-2]/R[0]C[-1]*1000" style="border: 1px solid rgb(204, 204, 204); overflow: hidden; padding: 2px 3px; vertical-align: bottom; text-align: right;">65</td>
      <td data-sheets-value="{&quot;1&quot;:3,&quot;3&quot;:40.96461499473064}" data-sheets-formula="=R[0]C[-3]/LOG(R[0]C[-2])" style="border: 1px solid rgb(204, 204, 204); overflow: hidden; padding: 2px 3px; vertical-align: bottom; text-align: right;">40.96461499</td>
    </tr>
    <tr style="height: 21px;">
      <td data-sheets-value="{&quot;1&quot;:2,&quot;2&quot;:&quot;Ruby&quot;}" style="border: 1px solid rgb(204, 204, 204); overflow: hidden; padding: 2px 3px; vertical-align: bottom;">Ruby</td>
      <td data-sheets-value="{&quot;1&quot;:3,&quot;3&quot;:90}" style="border: 1px solid rgb(204, 204, 204); overflow: hidden; padding: 2px 3px; vertical-align: bottom; text-align: right;">90</td>
      <td data-sheets-value="{&quot;1&quot;:3,&quot;3&quot;:2936}" style="border: 1px solid rgb(204, 204, 204); overflow: hidden; padding: 2px 3px; vertical-align: bottom; text-align: right;">2936</td>
      <td data-sheets-value="{&quot;1&quot;:3,&quot;3&quot;:30.653950953678475}" data-sheets-numberformat="{&quot;1&quot;:2,&quot;2&quot;:&quot;0&quot;,&quot;3&quot;:1}" data-sheets-formula="=R[0]C[-2]/R[0]C[-1]*1000" style="border: 1px solid rgb(204, 204, 204); overflow: hidden; padding: 2px 3px; vertical-align: bottom; text-align: right;">31</td>
      <td data-sheets-value="{&quot;1&quot;:3,&quot;3&quot;:25.953382726479024}" data-sheets-formula="=R[0]C[-3]/LOG(R[0]C[-2])" style="border: 1px solid rgb(204, 204, 204); overflow: hidden; padding: 2px 3px; vertical-align: bottom; text-align: right;">25.95338273</td>
    </tr>
  </tbody>
</table></google-sheets-html-origin>

Just using the number of edits makes the golfing languages irrelevant. The log(edits) brings everything into quite a nice grouping.

\$\endgroup\$
1
  • 10
    \$\begingroup\$ As far as I can tell this is not a challenge idea, so it should be a standalone meta question instead of a sandbox post \$\endgroup\$
    – bsoelch
    Oct 2, 2023 at 11:25
-11
\$\begingroup\$

Delete or a file disapear as fast as possible!

Requirements to participate:

  • have a HDD hard drive, witch you will use to compete
  • Use Windows (version 7 or more recent) for this challenge.

Assume that you already know the file path. no input needed.

You can use any language you want for this challenge, but you will need to explain the logic in your code.

You will delete a 2GB file.

How do you win?

You win this challenge by creating a piece of code that can delete a file in the OS as fast as possible, the winner is the one with less time to delete a file.

\$\endgroup\$
4
  • 3
    \$\begingroup\$ This is a) too wide open to interpretation; b) far more dependent on the hardware than on the software. \$\endgroup\$ May 23, 2017 at 13:41
  • \$\begingroup\$ so what? I say in the begining what the requirements to participate are, only the ones that match the requirements can participate, else the results will be so diferent i cant even evaluate @PeterTaylor \$\endgroup\$
    – jeyejow
    May 23, 2017 at 13:51
  • \$\begingroup\$ And what do you mean "wide open to interpretation?" @PeterTaylor \$\endgroup\$
    – jeyejow
    May 23, 2017 at 13:52
  • 1
    \$\begingroup\$ What does it mean to "make a file disappear"? If I unmount the disk, does that count? How about if I format the index block? Change the permissions so that I can no longer see it? Rename it? Toggle the disk header so that it seems to be a different filesystem and won't mount? Is rm acceptable, or do I need to shred? Can I insist on a filesystem of my choice (probably FAT)? \$\endgroup\$ May 23, 2017 at 14:40
-11
\$\begingroup\$

Worst language Ever

Let's find out the worst language.

Make a program that does anything that is shortest.

The worst language would be the longest of all.

I'll go with C first.

C (gcc), 15 bytes

f(){puts("1");}

Try it online!

It prints 1.

It does print something and it is the shortest code.

Swift 4, 8 bytes

print(2)

Try it online!

It prints 2. It does print something that is shortest.

\$\endgroup\$
5
  • \$\begingroup\$ How would you define "does anything"? \$\endgroup\$
    – DELETE_ME
    Jan 9, 2018 at 4:05
  • 3
    \$\begingroup\$ Also it's nontrivial to verify whether a program is the shortest possible, unless you tried all programs shorter than that. \$\endgroup\$
    – DELETE_ME
    Jan 9, 2018 at 4:06
  • \$\begingroup\$ Print anything except nothing. You can have an input \$\endgroup\$
    – buttercrab
    Jan 9, 2018 at 4:06
  • 4
    \$\begingroup\$ So this is a code-golf challenge which ask users to output anything? Isn't this too broad? I will let others to judge... \$\endgroup\$
    – DELETE_ME
    Jan 9, 2018 at 4:09
  • \$\begingroup\$ Doing all of that, we can find the worst language. \$\endgroup\$
    – buttercrab
    Jan 9, 2018 at 4:13
-13
\$\begingroup\$

Divisibility by 4

Your job is to write a program that checks divisibility of an integer by 4.

Restrictions:

You can't use:

  • modulo
  • binary shift/rotates
  • Divisions

You must instead do it like a HUMAN DOES by checking the last 2 digits and output a truthy value when is divisible and a falsey when not.

Non-printable characters; golfing-dedicated, whitespace and esoteric languages are forbidden.

The winner will be the code that has less characters, where white space doesn't count (tabs, spaces and newlines).

\$\endgroup\$
10
  • \$\begingroup\$ People never like when they can't use their favorite language for a challenge. I would seriously recommend removing the language restriction as it not only is it next to impossible to reliably enforce (you have been already linked several meta discussions so I'll leave that out) but it is most importantly not very fun for the people involved. \$\endgroup\$
    – Wheat Wizard Mod
    Jan 9, 2017 at 0:35
  • 7
    \$\begingroup\$ @LearnHowToBeTransparent There are a number of problems here, which it is useful to point out, but I think "I hate this challenge" is unnecessary. \$\endgroup\$ Jan 9, 2017 at 0:36
  • \$\begingroup\$ Can I forbid only whitespace languages, as they would automatically win by my measures? \$\endgroup\$
    – sergiol
    Jan 9, 2017 at 0:39
  • \$\begingroup\$ Are we allowed to check / use the other digits, too or just the last two digits? Does looping through all digits to reach the last two digits count as "checking / looking at / using"? \$\endgroup\$
    – nimi
    Jan 9, 2017 at 0:39
  • \$\begingroup\$ I think that you could because it is objective. But the much better alternative would be to simply count whitespace. Why do you want to not count whitespace. \$\endgroup\$
    – Wheat Wizard Mod
    Jan 9, 2017 at 0:41
  • \$\begingroup\$ @nimi: One more time I tell you that is absolutely not necessary. You can, but that will for sure increase your non-whitespace char count! \$\endgroup\$
    – sergiol
    Jan 9, 2017 at 0:42
  • \$\begingroup\$ @WheatWizard: I want to measure it in terms of "Visual Overload". Whitepace does not have any visual load and when exists even alleviates the "visual overload" of characters that have it! \$\endgroup\$
    – sergiol
    Jan 9, 2017 at 0:43
  • \$\begingroup\$ Since the discussion has already grown quite long I have created a room here: chat.stackexchange.com/rooms/51421/… \$\endgroup\$
    – Wheat Wizard Mod
    Jan 9, 2017 at 0:43
  • \$\begingroup\$ Implements question using whitespace. \$\endgroup\$ Jan 9, 2017 at 15:11
-15
\$\begingroup\$

Write the worst Hello World program you can [popularity-contest] [super rough]

Who needs conventions? Write the most terrible Hello World program you can think of. Inefficiency, spaghetti code, you name it. Add a few gotos here and there to spice it up. Write code that has gone against everything you've ever been taught.

Be creative. This isn't about obfuscation: it's about bad code quality. Try making up your own ways of writing inefficient or unadaptable code. Have fun!

\$\endgroup\$
4
  • 8
    \$\begingroup\$ VTC because of no winning criterion, objective or not. Needs some work. \$\endgroup\$
    – Riker
    Feb 28, 2016 at 2:11
  • 1
    \$\begingroup\$ I suggest a code-bowling criterion, but this is still way too broad. \$\endgroup\$ Feb 28, 2016 at 2:13
  • 1
    \$\begingroup\$ As I said, it's super rough and needs a lot of work. \$\endgroup\$ Feb 28, 2016 at 2:13
  • 4
    \$\begingroup\$ This is essentially code trolling, which was deemed off topic a few years ago. \$\endgroup\$
    – Dennis
    Mar 9, 2016 at 1:13
1
153 154 155 156
157

You must log in to answer this question.

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