74
\$\begingroup\$

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>

\$\endgroup\$
28
  • 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
    Commented Jul 25, 2020 at 15:53
  • 1
    \$\begingroup\$ @SomoKRoceS You can use any characters. \$\endgroup\$
    – Wheat Wizard
    Commented Jul 25, 2020 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\$ Commented Jul 26, 2020 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
    Commented Jul 26, 2020 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\$ Commented Jul 28, 2020 at 12:50

155 Answers 155

1 2 3 4 5
6
0
\$\begingroup\$

Dyalog APL, score: 53

BCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz⍙3

I don't know how long this will last

\$\endgroup\$
1
  • \$\begingroup\$ Cracked. \$\endgroup\$
    – user
    Commented Jan 29, 2021 at 0:57
0
\$\begingroup\$

Wolfram Language (Mathematica), Score: 47, cracked

abdfghijklmnopqrstuvwxyz
{ <-> , ~, &}[(*@)[]]

Fixed.

\$\endgroup\$
1
0
\$\begingroup\$

QBasic 1.1, score: 2, Cracked

Cc

I'm specifying QBasic 1.1 in order to exclude QB64 with its extra features. You can run it at Archive.org.

\$\endgroup\$
1
0
\$\begingroup\$

QBasic 1.1, score: 3, Cracked

C,c

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
 

\$\endgroup\$
1
0
\$\begingroup\$

Javastack, score 16, Cracked by exedraj

1234567890"crsyo

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)

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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