This is the cop's thread of a challenge. You can view the robber's thread here

A pretty common beginner style question is to print some string, but there's a catch! You need to do it without using any of the characters in the string itself!

For this challenge, we will find out who is the best at printing X without X. There are two threads to this, a cop's thread and a robber's thread.

In the cop's thread (this thread), users will choose a language (which we will call Y) and a string (which we will call X) and write a program in language Y which takes no input, and outputs exactly X without using any of the characters in X. The cop will then post both X and Y without revealing the program they have written.

Robbers will select the cop's answers and write programs in language Y which take no input and output X. They will post these "cracks" as answers in their thread. A crack need only work, not to be the intended solution.

Once a cop's answer is one week old, so long as it has not been cracked, the cop may reveal their program and mark it as "safe". Safe answers can no longer be cracked and are eligible for scoring.

Cops will be scored by length of X in characters with smaller scores being better. Only safe answers are eligible for scoring.

Extra Rules

You may be as specific or precise in choosing your language as you wish. For example you may say your language is Python, or Python 3, Python 3.9 (pre-release), or even point to a specific implementation. Robber's solutions need only work in one implementation of the given language. So, for example, if you say Python is your language, a robber's crack is not required to work in all versions of Python, only one.

Since command line flags and repls count as different languages. If your language is one of those then you should indicate that as at least a possible option for the language. For ease of use, I ask that you assume there are no command line flags in cases where command line flags are not mentioned.

You may choose to have your output as an error. If your intended solution does output as an error, you must indicate this in your answer.

Find Uncracked Cops

<script>site = 'meta.codegolf'; postID = 5686; isAnswer = false; QUESTION_ID = 207558;</script><script src='https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js'></script><script>jQuery(function(){var u='https://api.stackexchange.com/2.2/';if(isAnswer)u+='answers/'+postID+'?order=asc&sort=creation&site='+site+'&filter=!GeEyUcJFJeRCD';else u+='questions/'+postID+'?order=asc&sort=creation&site='+site+'&filter=!GeEyUcJFJO6t)';jQuery.get(u,function(b){function d(s){return jQuery('<textarea>').html(s).text()};function r(l){return new RegExp('<pre class="snippet-code-'+l+'\\b[^>]*><code>([\\s\\S]*?)</code></pre>')};b=b.items[0].body;var j=r('js').exec(b),c=r('css').exec(b),h=r('html').exec(b);if(c!==null)jQuery('head').append(jQuery('<style>').text(d(c[1])));if (h!==null)jQuery('body').append(d(h[1]));if(j!==null)jQuery('body').append(jQuery('<script>').text(d(j[1])))})})</script>

  • 1
    \$\begingroup\$ @user I believe errors are considered output, by our standard rules. I defer to those, so I believe the answer is yes. \$\endgroup\$
    – Wheat Wizard
    Jul 25 '20 at 15:53
  • 1
    \$\begingroup\$ @SomoKRoceS You can use any characters. \$\endgroup\$
    – Wheat Wizard
    Jul 25 '20 at 21:03
  • 4
    \$\begingroup\$ @Discretelizard I am not AdHocGarfHunter, but if your program does anything with the input (other than completely ignoring it), it is almost certainly invalid. \$\endgroup\$ Jul 26 '20 at 15:09
  • 2
    \$\begingroup\$ @EthanChapman Program flags are considered different languages. I had not thought if this initially so I will update the question but I will say that in order for command line flags to be used they should be explicitly allowed, either a specific flag or flags in general (as per the language vagueness rules). \$\endgroup\$
    – Wheat Wizard
    Jul 26 '20 at 15:23
  • 1
    \$\begingroup\$ @pppery Can the snippet deal with two submissions in a single post? Or should I make two answers and link them if I have a pair of highly related challenges? \$\endgroup\$ Jul 28 '20 at 12:50

152 Answers 152

1 2 3 4 5

QBasic 1.1, score: 3, Cracked


POKE should be impossible now.

You can run QBasic 1.1 at Archive.org.

My solution:

 DIM outstr AS STRING * 3
 outstr = MKS$(908.6916)
 PRINT outstr


Javastack, score 16, Cracked by exedraj


My my, you are going to enjoy this one...

Up-to-date copy of the interpreter

Mistakes were made, but this will now work (sorry)

  • \$\begingroup\$ @downvoter why? \$\endgroup\$
    – lyxal
    Aug 8 '21 at 1:09
  • \$\begingroup\$ diddly darn croaked \$\endgroup\$
    – lyxal
    Aug 8 '21 at 1:34
1 2 3 4 5

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.