# Print X without X (cop's thread)

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>

• @user I believe errors are considered output, by our standard rules. I defer to those, so I believe the answer is yes. – Wheat Wizard Jul 25 at 15:53
• @SomoKRoceS You can use any characters. – Wheat Wizard Jul 25 at 21:03
• @Discretelizard I am not AdHocGarfHunter, but if your program does anything with the input (other than completely ignoring it), it is almost certainly invalid. – the default. Jul 26 at 15:09
• @Discretelizard they have the requirement by default at Loopholes that are forbidden by default – the default. Jul 26 at 15:43
• 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) – pppery Jul 27 at 23:14

# ><>, score: 20

0123456789abcdef&loi


loi for loss of input

• round 6 when? cracked, lol – Lyxal Aug 12 at 8:33
• also, i'm out of upvotes for the next 15 hours. – Lyxal Aug 12 at 8:34

# ><>, score: 22

0123456789abcdef&loi'"


No literals now.

• I'll do it tomorrow as i gtg – Lyxal Aug 12 at 8:40
• I"m just watching as your answers get progressively bigger and Lyxal still manages to crack them each time :) – user Aug 12 at 17:31
• 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 – Lyxal Aug 12 at 21:25
• @user I've struck again with my longest one yet. – Lyxal Aug 12 at 21:26
• @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. – user Aug 12 at 23:19

# ><>, score: 21

123456789abcdef&loi'"


Two ways.

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

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

• Is the Try it online! link intended? :) – the default. Jul 26 at 11:25
• @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. – Lyxal Jul 26 at 11:26
• – the default. Jul 26 at 13:02
• Is the official implementation linked required, or can the extended variants used in TIO allowed? – Ethan Chapman Aug 14 at 18:37
• Nevermind, I don't need it anymore. – Ethan Chapman Aug 14 at 19:18

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

Php7, score: 14 (cracked)

funtim(){}_=/\


# 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).

• Ha! I figured out! Robber coming soon... – null Aug 19 at 4:45
• Cracked – Dingus Aug 19 at 12:06
• @Dingus Well done! That is very close to the solution I had in mind (modulo the choice of epithets, naturally!) – Robin Ryder Aug 19 at 12:33
• 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: – null Aug 20 at 7:21
• Why not a new mMbBlL challenge? That will almost certainly be more interesting... (Mwahahaha) – null Aug 20 at 7:24

# 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 @

• Cracked – pppery Jul 25 at 18:50

# 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/γ¦ć

# 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|~


# 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!

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

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

• Welcome to the site! Cracked, although it probably wasn't what you were intending. – nthistle Jul 27 at 1:31
• 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. – nthistle Jul 27 at 1:34
• 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? – MCross Jul 27 at 1:40
• I think you can repost a modified version – user Jul 27 at 1:58
• 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! – Wheat Wizard Jul 27 at 2:02

# Perl 5, Score: 35, Cracked

"'/0123456789<CMPQSTVY\^cmpqstvy|~


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

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

# Javascript (Browser), Score: 34. cracked

ABDEFGHIJKLMNOPQRTUVWXYZ1234567890

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

• 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! – caird coinheringaahing Jul 27 at 21:20
• Cracked – nthistle Jul 27 at 23:38

# Javascript (Browser), Score: 27 Cracked

ABDEFGINOPQTUVYZ234567890tf[

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

# 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}

# 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).

• Answer is safe. – PkmnQ Aug 18 at 15:44

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

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

• Cracked although I imagine this wasn't your intention... – Dom Hastings Jul 30 at 17:09
• @DomHastings Most definitely not! But isn't that Ruby + Bash? – Dingus Jul 30 at 19:48
• Hmmm, yeah, I guess. Thought I was pushing it a little... – Dom Hastings Jul 30 at 19:59
• 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. – Gilles 'SO- stop being evil' Jul 30 at 22:51
• If you push an updated challenge that forbids backquote, be sure to also arrange to forbid putc which prints character by their numerical value. – Gilles 'SO- stop being evil' Jul 30 at 23:00

# Part 2: PicoLisp, score: 18 cracked

Segmentation fault


or (similar):

Segmentation fault (core dumped)


(output to STDERR)

A bit harder than my previous answer. . .

• 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. – Dingus Jul 30 at 11:30
• @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. – Wezl Jul 30 at 13:13
• Ah yeah right... I completely overlooked the spaces! Segfaults without them too, though. – Dingus Jul 30 at 13:25
• 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 )... – Dingus Jul 30 at 13:36
• 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. – Gilles 'SO- stop being evil' Jul 30 at 22:46

# ><>, score: 17 - Cracked

0123456789abcdefo


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

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

# ><>, score: 19

0123456789abcdeflol


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

# ><>, score: 24

123456789abcdef&io'"()=



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

• golfing is overrated. cracked lol – Lyxal Aug 13 at 4:38

# PHP, Score: 1 Cracked

?


No command line flags were used.

# PHP7, score: 15 (Cracked)

funtim(){}_=/\~


# 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)

• Cracked – Dingus Aug 31 at 5:08

# AlphaBeta, score: 12, Cracked

abcdefghijkl


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

• Cracked – Dingus Nov 6 at 9:53

# Dyalog APL, score: 53

BCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz⍙3


I don't know how long this will last

# Wolfram Language (Mathematica), Score: 47, cracked

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



Fixed.

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

• – water_ghosts Jul 29 at 3:34