52
\$\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 the have written.

Robbers will be select cop 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 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, or Python 3.9 (pre-release) or even point to a specific implementation. Robbers 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 count as different languages you should indicate specific command line flags or the possibility of command line flag as part of your 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\$
  • 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 at 15:53
  • 1
    \$\begingroup\$ @SomoKRoceS You can use any characters. \$\endgroup\$ – Wheat Wizard Jul 25 at 21:03
  • 3
    \$\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\$ – the default. Jul 26 at 15:09
  • 3
    \$\begingroup\$ @Discretelizard they have the requirement by default at Loopholes that are forbidden by default \$\endgroup\$ – the default. Jul 26 at 15:43
  • 3
    \$\begingroup\$ Given the large number of answers to this challenge, I suggest adding the uncracked answers stack snippet to the question body, so it's easier to find uncracked cops. (I'm posting a comment rather than adding it myself due to the rule against adding leaderboards) \$\endgroup\$ – pppery Jul 27 at 23:14

91 Answers 91

2
\$\begingroup\$

><>, score: 20

0123456789abcdef&loi

loi for loss of input

| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ round 6 when? cracked, lol \$\endgroup\$ – Lyxal Aug 12 at 8:33
  • \$\begingroup\$ also, i'm out of upvotes for the next 15 hours. \$\endgroup\$ – Lyxal Aug 12 at 8:34
2
\$\begingroup\$

><>, score: 22

0123456789abcdef&loi'"

No literals now.

| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ I'll do it tomorrow as i gtg \$\endgroup\$ – Lyxal Aug 12 at 8:40
  • \$\begingroup\$ I"m just watching as your answers get progressively bigger and Lyxal still manages to crack them each time :) \$\endgroup\$ – user Aug 12 at 17:31
  • 1
    \$\begingroup\$ Well, you've won. I give up. It's just too hard for me to crack this answer................................is what I'd be saying if it wasn't cracked lol \$\endgroup\$ – Lyxal Aug 12 at 21:25
  • 1
    \$\begingroup\$ @user I've struck again with my longest one yet. \$\endgroup\$ – Lyxal Aug 12 at 21:26
  • 1
    \$\begingroup\$ @Lyxal For a moment there I felt a little sad, thinking this chain was going to stop. Good to see you haven't broken it yet. HighlyRadioactive, keep the challenges coming! I wish both of you luck. \$\endgroup\$ – user Aug 12 at 23:19
2
\$\begingroup\$

><>, score: 21

123456789abcdef&loi'"

Two ways.

| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ roses are red, my name is not paul. where's round 8? cause this is cracked, lol \$\endgroup\$ – Lyxal Aug 13 at 3:52
  • \$\begingroup\$ @Lyxal Herrings are red, my name is not Lyxal. I don't know ><> at all. Also, you are lazy. \$\endgroup\$ – null Aug 13 at 4:11
2
\$\begingroup\$

Keg, Score: 55, cracked

  
 - + . 8  ! _ ~ ⑨ \ ;
  
 - + . 8  ! _ ~ ⑨ \ ;

View it online!

Good luck with this one. Most commands used to generate values are gone. Edit: I just realised the output was invalid. It's fixed now. Sorry about that.

| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ Is the Try it online! link intended? :) \$\endgroup\$ – the default. Jul 26 at 11:25
  • \$\begingroup\$ @mypronoun yes, it is. I copied the out in a new tio page to utilise its formatting. Also, it retains all characters SE might botch. \$\endgroup\$ – Lyxal Jul 26 at 11:26
  • \$\begingroup\$ Cracked? \$\endgroup\$ – the default. Jul 26 at 13:02
  • \$\begingroup\$ Is the official implementation linked required, or can the extended variants used in TIO allowed? \$\endgroup\$ – Ethan Chapman Aug 14 at 18:37
  • \$\begingroup\$ Nevermind, I don't need it anymore. \$\endgroup\$ – Ethan Chapman Aug 14 at 19:18
2
\$\begingroup\$

Javascript, score 80, Cracked

Last one for javascript. You have to do jsfuck, but I've disallowed 4 of the important characters. I left you some extra, but you'll have to figure out which ones to use and how to use them.

<("MrJock,TVQuizPHDBagsFewLynx.mRjOCKtvqUIZ=phd#bAGSfEWlYNX? 12+34-56*78^90%!')>

Yes, this is possible, by the way. The problems you will encounter, in order:

  • Making numbers (Notice in the number spot, I left out one operation, use that and one other symbol

  • Making booleans (The answer to this was posted years ago in a chatroom about JSFuck)

  • Executing functions (If you saw my previous two cop answers, you know how to do this)

My solution was exactly the same as the cracked one above.

| improve this answer | |
\$\endgroup\$
2
\$\begingroup\$

Php7, score: 14 (cracked)

funtim(){}_=/\
| improve this answer | |
\$\endgroup\$
2
\$\begingroup\$

Shakespeare Programming Language, score: 4, cracked by Dingus

mMbB

You cannot use the sum of or the difference between, so constructing integers is tricky.


Dingus' crack is very similar to what I had in mind. The solution relies on the product, square, square root and factorial operators (which are not well known, since they are not or barely mentioned in the official documentation), and on the fact that SPL only uses integers, so that e.g. 5 can be represented as \$\sqrt{32}\$ (the square root of a cunning cute peaceful trustworthy healthy squirrel).

| improve this answer | |
\$\endgroup\$
  • 1
    \$\begingroup\$ Ha! I figured out! Robber coming soon... \$\endgroup\$ – null Aug 19 at 4:45
  • \$\begingroup\$ Cracked \$\endgroup\$ – Dingus Aug 19 at 12:06
  • \$\begingroup\$ @Dingus Well done! That is very close to the solution I had in mind (modulo the choice of epithets, naturally!) \$\endgroup\$ – Robin Ryder Aug 19 at 12:33
  • \$\begingroup\$ Factorial... Nope. I did find the solution with a search script, however. The b is: the square root of the square of twice the square of the square root of twice the square of the square root of a little little little little little cat. Try b online. imagine I optimizing a program for two days only to find out it was cracked. EDIT: \$\endgroup\$ – null Aug 20 at 7:21
  • \$\begingroup\$ Why not a new mMbBlL challenge? That will almost certainly be more interesting... (Mwahahaha) \$\endgroup\$ – null Aug 20 at 7:24
1
\$\begingroup\$

Befunge-98 (FBBI), Score: 2, Cracked

Not too difficult, but I don't think this can be made harder in Befunge.

=,

My solution:

4b*:d0p'<1+1k @

| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ Cracked \$\endgroup\$ – pppery Jul 25 at 18:50
1
\$\begingroup\$

05AB1E, Score: 1, Cracked

X = .

I think it is an easy one :)

edit

Cracked by @nthistle

My approach (without using ASCII code to char conversion):

98/γ¦ć

| improve this answer | |
\$\endgroup\$
1
\$\begingroup\$

Perl 5 + -p, Score: 30, Cracked

Outputs to STDOUT. Perl has so many ways to generate chars so I've probably missed a few alternative cracks, but here goes...

"'/0123456789<CMFQSV\^cmpqsv|~
| improve this answer | |
\$\endgroup\$
1
\$\begingroup\$

Python 2, score 26 Cracked

[2517630984, '\\`"a_put']

The same as the output of this program.


This may well get cracked fairly quickly so apologies in advance if I am not around promptly to acknowledge it!

| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ This can probably be cracked via the unicode tricks used in the most-upvoted robbers answer. \$\endgroup\$ – the default. Jul 27 at 3:23
  • 1
    \$\begingroup\$ @mypronounismonicareinstate In Python 2? \$\endgroup\$ – Jonathan Allan Jul 27 at 3:24
  • \$\begingroup\$ I haven't tried and do not know when that "feature" was introduced, so I may be wrong. \$\endgroup\$ – the default. Jul 27 at 3:25
  • 3
    \$\begingroup\$ @mypronounismonicareinstate python.org/dev/peps/pep-3131 - introduced in 3.0 \$\endgroup\$ – Jonathan Allan Jul 27 at 3:26
  • 1
    \$\begingroup\$ Cracked \$\endgroup\$ – Sisyphus Jul 27 at 4:17
1
\$\begingroup\$

Java, Score: 2 (Cracked)

Output (X):

.

(a dot and a newline)

Never golfed before, but saw this and couldn't resist trying; probably will be cracked within the hour, considering it's not really that complicated. My intended solution output to standard error.

| improve this answer | |
\$\endgroup\$
  • 1
    \$\begingroup\$ Welcome to the site! Cracked, although it probably wasn't what you were intending. \$\endgroup\$ – nthistle Jul 27 at 1:31
  • 1
    \$\begingroup\$ For reference, there was a previous Java answer (now removed) by @user that used the Unicode character escaping trick -- you're probably going to have to include numbers, backslash, or 'u' in the answer in order to prevent this. Also, the newline doesn't make it any harder, since in Java you can just remove all newlines without affecting anything. \$\endgroup\$ – nthistle Jul 27 at 1:34
  • 2
    \$\begingroup\$ Never knew about that Unicode trick, should've looked up whether something like that was possible before posting. The newline was more a side-effect of the way I did it than actually intended to make it difficult. You're correct, that's pretty different from my solution. Am I allowed to repost/edit with a modified version that patches previous cracks? \$\endgroup\$ – MCross Jul 27 at 1:40
  • 1
    \$\begingroup\$ I think you can repost a modified version \$\endgroup\$ – user Jul 27 at 1:58
  • 2
    \$\begingroup\$ As the OP for the question I back up user's claim. You are free to post a modified version. Other's (including me) have already done that. Good luck! \$\endgroup\$ – Wheat Wizard Jul 27 at 2:02
1
\$\begingroup\$

Perl 5, Score: 35, Cracked

"'/0123456789<CMPQSTVY\^`cmpqstvy|~

Foiled in my last attempt I'll try another more restrictive set...

| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ Cracked \$\endgroup\$ – Gilles 'SO- stop being evil' Jul 27 at 14:04
  • \$\begingroup\$ @Gilles'SO-stopbeingevil' Nice work! I've got one last attempt to share but will have to be a much higher score! \$\endgroup\$ – Dom Hastings Jul 27 at 16:45
1
\$\begingroup\$

Javascript (Browser), Score: 34. cracked

ABDEFGHIJKLMNOPQRTUVWXYZ1234567890

Shouldn't be too hard compared to the other ones.

| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ Welcome to the site! I've slightly edited your answer to fit the standard format used around here. Good luck, and hope you don't get cracked! \$\endgroup\$ – caird coinheringaahing Jul 27 at 21:20
  • \$\begingroup\$ Cracked \$\endgroup\$ – nthistle Jul 27 at 23:38
1
\$\begingroup\$

Javascript (Browser), Score: 27 Cracked

ABDEFGINOPQTUVYZ234567890tf[

| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ Cracked \$\endgroup\$ – Bubbler Jul 28 at 0:34
  • \$\begingroup\$ If you're intending to submit a third cop answer with "ABDEFGINOPGTUVYZ234567890tf[evalsic", please do so as a separate answer. \$\endgroup\$ – pppery Jul 28 at 3:27
  • \$\begingroup\$ ok. sure (stuff to fill the required characters) \$\endgroup\$ – Sparkles the Unicorn Jul 28 at 5:02
  • \$\begingroup\$ Brony? Greetings (My username is formerly TwilightSparkle) \$\endgroup\$ – null Jul 28 at 13:26
1
\$\begingroup\$

Javascript, score 6, Cracked

(\SuC)

Alright, added 3 more characters. Same concept as before, but harder this time.

My solution:

[]["fill"]["constr"+[[][0]+[]][0][0]+"ctor"]`a${[]["fill"]["constr"+[[][0]+[]][0][0]+"ctor"]`a${"ret"+[[][0]+[]][0][0]+"rn "+[[][0]+[]][0][0]+"nescape"}````console.log%28"%28%5c%5c%53%75%43%29"%29`}```

| improve this answer | |
\$\endgroup\$
1
\$\begingroup\$

Javascript (browser), score: 34

ABDEFGINOPGTUVZ234567890tf[evalsic

I am not going throw away my chance! Yes, I like Hamilton. (You may input code in the console).

| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ Answer is safe. \$\endgroup\$ – PkmnQ Aug 18 at 15:44
1
\$\begingroup\$

Java, score 2 Cracked

yC\

This is supposed to be printed to stdout. The y doesn't let you use System.out.println, the \ is so you don't use Unicode escapes, and the C is so you don't use reflection. This isn't super hard - I found it with my first Google search to make an answer to this question.

| improve this answer | |
\$\endgroup\$
1
\$\begingroup\$

Ruby, Score: 9, Cracked

.'"?%([:<

My code outputs with no trailing newline and works for Ruby 1.8.7 onwards. By design, string creation is difficult.

Edit: I've posted a new version hardened against the weaknesses found by @DomHastings and @Gilles'SO-stopbeingevil'. Because my code is almost unchanged I'll hold off on revealing it.

| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ Cracked although I imagine this wasn't your intention... \$\endgroup\$ – Dom Hastings Jul 30 at 17:09
  • \$\begingroup\$ @DomHastings Most definitely not! But isn't that Ruby + Bash? \$\endgroup\$ – Dingus Jul 30 at 19:48
  • \$\begingroup\$ Hmmm, yeah, I guess. Thought I was pushing it a little... \$\endgroup\$ – Dom Hastings Jul 30 at 19:59
  • 1
    \$\begingroup\$ Using a shell escape works on Ruby on any POSIX platform, and the challenge allows cracks that only work on a specific implementation. So it's legit. Cc @DomHastings Dom's solution is a bit iffy because it requires bash, not just any POSIX platform, so it's a constraint on the presence of an external tool and not just a choice of implementation. \$\endgroup\$ – Gilles 'SO- stop being evil' Jul 30 at 22:51
  • 1
    \$\begingroup\$ If you push an updated challenge that forbids backquote, be sure to also arrange to forbid putc which prints character by their numerical value. \$\endgroup\$ – Gilles 'SO- stop being evil' Jul 30 at 23:00
1
\$\begingroup\$

Part 2: PicoLisp, score: 18 cracked

Segmentation fault

or (similar):

Segmentation fault (core dumped)

(output to STDERR)

A bit harder than my previous answer. . .

| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ Would this be considered a crack? The output shown there is correct (assuming it's been reproduced accurately), but running on TIO produces leading and trailing garbage. \$\endgroup\$ – Dingus Jul 30 at 11:30
  • 1
    \$\begingroup\$ @Dingus Almost, but that has spaces (it seems to work ). If it produces a Segmentation fault it's fine (with or without garbage) because if you run it as pil file.l it won't create garbage. If in doubt, see if you can install picolisp. \$\endgroup\$ – Wezl Jul 30 at 13:13
  • \$\begingroup\$ Ah yeah right... I completely overlooked the spaces! Segfaults without them too, though. \$\endgroup\$ – Dingus Jul 30 at 13:25
  • \$\begingroup\$ The output I get from pil for a space-free version of the code is Segmentation fault (core dumped). Not sure this is valid. Even if you allow the (core dumped) bit, my code contains both ( and )... \$\endgroup\$ – Dingus Jul 30 at 13:36
  • 2
    \$\begingroup\$ I can't reproduce this. When picolisp segfaults on my machine, it doesn't print anything, it just segfaults. If you're running it from a shell, the shell may print a message (depending on how it's configured, the locale, etc.), but this message does not come from the program. If the intended solution was to make it segfault, this is invalid for the challenge. \$\endgroup\$ – Gilles 'SO- stop being evil' Jul 30 at 22:46
1
\$\begingroup\$

><>, score: 17 - Cracked

0123456789abcdefo

I'm going to ban you from using numbers, too! What can you do now?!

| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ That's just rude and mildly inconvenient. :P \$\endgroup\$ – Lyxal Aug 12 at 6:44
  • \$\begingroup\$ @Lyxal So can you crack it? (It's not hard to anyone familiar with ><>.) \$\endgroup\$ – null Aug 12 at 6:45
  • \$\begingroup\$ I'll be out for a bit, but yes. As in afk \$\endgroup\$ – Lyxal Aug 12 at 6:46
  • \$\begingroup\$ It was extremely inconvenient, but cracked lol \$\endgroup\$ – Lyxal Aug 12 at 7:28
1
\$\begingroup\$

><>, score: 19

0123456789abcdeflol

I could've made it 18 but just for the lols

| improve this answer | |
\$\endgroup\$
1
\$\begingroup\$

><>, score: 24

123456789abcdef&io'"()=

The second approach. Also no newlines. Also be a little bit golfier please.

| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ golfing is overrated. cracked lol \$\endgroup\$ – Lyxal Aug 13 at 4:38
1
\$\begingroup\$

PHP, Score: 1 Cracked

?

No command line flags were used.

| improve this answer | |
\$\endgroup\$
1
\$\begingroup\$

PHP7, score: 15 (Cracked)

funtim(){}_=/\~
| improve this answer | |
\$\endgroup\$
1
\$\begingroup\$

Setanta, score 3, cracked by Dingus

Probably an easy one.

N I

Here's my solution:

n:=go_téacs(go_uimh("!"))[0]sp:=go_téacs(gníomh(a){})[1]i:=go_teacs(eas@mata(1000))[0]scríobh(n+sp+i)
| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ Cracked \$\endgroup\$ – Dingus Aug 31 at 5:08
1
\$\begingroup\$

AlphaBeta, score: 12, Cracked

abcdefghijkl

I think this will get cracked quick, but I can't come up with anything else for AlphaBeta.

| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ Cracked \$\endgroup\$ – Dingus Nov 6 at 9:53
0
\$\begingroup\$

Dyalog APL, score: 53

BCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz⍙3

I don't know how long this will last

| improve this answer | |
\$\endgroup\$
0
\$\begingroup\$

Wolfram Language (Mathematica), Score: 47, cracked

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

Fixed.

| improve this answer | |
\$\endgroup\$
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.

| improve this answer | |
\$\endgroup\$

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.