# Print X without X (robber's thread)

This is the robber's thread of a challenge. You can view the cop'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 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 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 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 this 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

Robbers will be scored by the total number of successful cracks with more cracks being better.

• Congrats on an excellent challenge with high 'replay value'. I've had a lot of fun participating on both sides, digging into a couple of languages for the first time along the way. – Dingus Aug 20 '20 at 3:22

# PHP 7, 46 bytes, cracks thelmuxkriovar's second answer

<?php echo"      crACked??"^"FUNTIMK[:>4XKcA";


Try it online!

• you're too fast lol, good job, this was similar to the solution I initially came up with – thelmuxkriovar Aug 19 '20 at 9:12
• @thelmuxkriovar Yeah, apologies! I think I was there at the right time and had alraedy prepared the other answer when I looked at your first :) – Dom Hastings Aug 19 '20 at 9:18
• 25 seconds from cop to crack - must be a record! – Dingus Aug 21 '20 at 5:06

scríobh(go_téacs(go_uimh("a"))[0]+go_téacs(scríobh)[1]+go_téacs(cmhcht@mata(10,1000))[0])


Try it

This was harder than I expected. After reading the docs and poking around in the source I couldn’t find an obvious way to do any of the following: (i) convert ASCII codes to characters, (ii) create character ranges, (iii) convert text to uppercase, (iv) use octal/hex escapes, (v) get uppercase characters from names of built-ins/predefined variables, (vi) increment/decrement a string, or (vii) call an equivalent of eval.

Things were looking pretty hopeless until I somewhat accidentally discovered that calling go_uimh (convert numeric string to number) on an alphabetic string yields NaN. Could I grab the N from NaN? Yes, by first converting NaN to text with go_téacs, then indexing into the string.

The space was comparatively straightforward. There's an example in the tutorial that shows what happens when go_téacs is called on a gníomh (literally, action; equivalent to a method/function in other languages): go_téacs(scríobh) == "< gníomh scríobh >". The space is extracted by indexing into this string.

Now for the I. Following my experience with NaN I had a hunch that I was looking for a way to generate Infinity. Sure enough, cmhcht@mata(10,1000) (which attempts to calculate $$\10^{1000}\$$) does just that.

println{"" + {40 toChar} + {46 toChar}}


Try it online!

• Cool! Never thought about braces. I defined a function taking a single argument and used infix notation – user Jul 25 '20 at 17:38
• Yeah, my immediate thought when I saw (. was postfix notation -- spent a while trying to figure out why println 3 wasn't working when I stumbled upon the braces trick. – nthistle Jul 25 '20 at 17:44
• By the way, you needn't mark it as (repl). Just wrap an object Main extends App {} around it (it's what I did). – user Jul 25 '20 at 17:56
• Ah, thanks, I'll update the TIO link. – nthistle Jul 25 '20 at 17:58

46ç


Try it online!

Pushes 46, then converts to a character, with implicit output.

f;;p;f;r⑨m⑨ 7+u;Z⑨⑨:a;


Try it online!

# Befunge-98 (PyFunge), 37 bytes, cracks pppery's answer

This code is terrible.

"NRTS"4(0"<"1+D0"r"1+D0"o"1+D0"+"1+D@


Try it online!

# Keg, 264 bytes, cracks Lyxal's answer

Uses the -oc flag.

‡32‡32‡10‡32‡45‡32‡43‡32‡46‡32‡56‡32‡7‡32‡33‡32‡95‡32‡126‡32‡9320‡32‡92‡32‡59‡10‡32‡32‡10‡32‡45‡32‡43‡32‡46‡32‡56‡32‡7‡32‡33‡32‡95‡32‡126‡32‡9320‡32‡92‡32‡59‡10


Try it online!

• Doesn't seem to replicate the 0x07s and trailing newline in the original question (see the TIO link there), but I would imagine that's easily fixable. If it's not, I have a different solution I can post. – Ethan Chapman Jul 26 '20 at 14:00
• Indeed, it doesn't; I'm not sure how that happened (probably an issue when copying a nonprintable); fixed. – the default. Jul 26 '20 at 14:18
• I never used flags in the original, hence this is an invalid crack. – Lyxal Aug 13 '20 at 4:58
• @Lyxal it doesn't matter if it's not intended – the default. Aug 13 '20 at 6:11
• It does. I just got told a crack was invalid for using flags when the original program didn't use them. – Lyxal Aug 13 '20 at 6:23

import java.io.*;

public class Main {
public static void main(String[] args) {
PrintStream out =  new PrintStream(new FileOutputStream(FileDescriptor.out));
out.println(""+(char)121+(char)67+(char)92);
}
}


Try it online!

There's more than one way to get standard out (although the FileDescriptor reference needs to be converted to a PrintStream first).

• 👍 This is exactly how I did it – user Jul 28 '20 at 0:43

Target: (\SuC)

In browser (tested on Chrome):

atob['constr'+${!0}[2]+'ctor']$${'console.log'+atobKA==+atobIihcXFN1QykiKQ==} In Node: U={!0}[2];global['F'+U+'nction']$${global['B'+U+'ffer'].from99${''}111${''}110${''}115${''}111${''}108${''}101${''}46${''}108${''}111${''}103${''}40${''}39${''}40${''}92${''}92${''}83${''}117${''}67${''}41${''}39${''}41}$  Try it online! OP already revealed an important trick (running arbitrary code in JSF$ck), so it was just a matter of creating the required chars from something else. Browser version uses base64 decoding function atob, and Node version uses Buffer.from, which luckily takes an array of numeric strings as an array of bytes.

• Honestly, I didn't think of using atob. I used (again) unescape. – PkmnQ Jul 28 '20 at 10:33

T-SQL

DECLARE @String VARCHAR
SELECT @String = 0x28
SELECT @String


Outputs ( but doesn't contain ( by using implicit type coercion.

• Nice. I did the same but just in a more complex way – George Menoutis Jul 28 '20 at 20:31

# Ruby, cracks @Dingus' answer, 77 bytes

I imagine this is almost certainly not the crack in mind, but this was the other solution I found before posting the crack for @Histocrat's second cop.

printecho -n \x27\x2e\x27\\\x27\x27\x22\x3f\x25\x28\x29\x5b\x5d\x3a\x3c\x27


Try it online!

• This requires Ruby+bash, not just Ruby-on-Unix. But the same principle works with Ruby-on-Unix: use printf \\047... instead of echo \x27…. – Gilles 'SO- stop being evil' Jul 30 '20 at 22:57
• I've posted a fortified version so will hold off on revealing my solution. – Dingus Jul 31 '20 at 4:47

# PicoLisp, cracks @Wezl's answer 5 bytes

Marking this community wiki as @Dingus Googled the error and found a solution and I applied the previous crack's style and removed bits.

[[0]]


Try it online!

• Unless there's a version of PicoLisp that does something bizarre, this doesn't work. [[0]] causes picolisp to segfault, and it does not print anything to stdout and stderr. If you see a message like segmentation fault when you run it, that message comes from your shell. – Gilles 'SO- stop being evil' Jul 30 '20 at 22:45

0Ḃ


Try it online!

Seems to work with any digit(s) preceding Ḃ, which is described in the docs as the 'bytes to UTF8' operator.

• The intended solution is: 1 (Yay!) – null Aug 1 '20 at 6:04

## Ruby, cracks Dingus's fourth answer

RUBY_VERSION =~ /\D/
DOT = $& RUBY_VERSION =~ // EMPTY_STRING =$&

$_ =$LOADED_FEATURES * EMPTY_STRING
$_ =~ /C/i; LC_C =$&
$_ =~ /H/i; LC_H =$&
$_ =~ /R/i; LC_R =$&
H_DOT_CHR = LC_H + DOT + LC_C + LC_H + LC_R

emit = EMPTY_STRING
h = 112; emit += eval H_DOT_CHR
h = 117; emit += eval H_DOT_CHR
h = 116; emit += eval H_DOT_CHR
h = 99; emit += eval H_DOT_CHR
h = 32; emit += eval H_DOT_CHR
h = 104; emit += eval H_DOT_CHR

h = 99; eval emit
h = 100; eval emit
h = 111; eval emit
h = 112; eval emit
h = 114; eval emit
h = 46; eval emit
h = 96; eval emit
h = 39; eval emit
h = 34; eval emit
h = 63; eval emit
h = 37; eval emit
h = 40; eval emit
h = 91; eval emit
h = 123; eval emit
h = 58; eval emit
h = 60; eval emit


Try it online!

Since we can use eval, the problem is to bootstrap a string that contains some interesting Ruby code. Since we have concatenation, this reduces to looking for individual characters. I went for h.chr, which will then let us construct arbitrary characters with h = NNN; s = eval "h.chr". (h could be any character that is permitted and that we manage to stuff into the string.) Once we have that, we build the string "putc h", and use that to print any character given by its numeric code.

Like before, I tried to extract characters from strings with regular expression matching. And like before, this divides into two subproblems: how to match an individual character, and finding or constructing a string that contains the desired character. Once that's done, we can copy the character from $&. Reviewing regexp features, Some backslash escapes that match a character in a class are permitted. For example /\D/ matches the first character in a string that isn't a digit. Conveniently, in RUBY_VERSION, that's a .. Since i is permitted, we can do case-insensitive matching. Since all uppercase letters are permitted, we can obtain a one-character string containing a lowercase letter by matching the corresponding uppercase letter against a string that contains the desired lowercase letter. We do this for c, h and r, all of which are present in $LOADED_FEATURES. That's an array of strings, which we convert to a string by using the join method which is conveniently available as the * operator. This part has me slightly uneasy because it verges on the specifics of an installation rather than on a language feature. However, the necessary characters are found in complex and thread and as far as I understand, these module names have to be present in $LOADED_FEATURES regardless of installation details. • Hats off to you for thwarting me at every attempt. This has been fun. I've posted my code in the cops thread. – Dingus Aug 1 '20 at 14:12 # Dotty, cracks @user's answer This was kinda hard, but kinda easy and really fun! object Main; def main(using Array[String]) = print("" + 58.toChar + 92.toChar + 123.toChar);  You can try this on: https://scastie.scala-lang.org/Sthw2Vr7QG26mbMHQuirkg As of today, it produces the expected output: ## DISCLAIMER!!!! This answer is HEAVILY based on https://codegolf.stackexchange.com/a/207833/! As based on this comment - Print X without X (cop's thread) @LuisMendo To start as of now full programs are required so return is not possible regardless. I will say that you must indicate if your intended output is to STDERR, although for most languages errors should be somewhat distinct from legitimate output. – Ad Hoc Garf Hunter The answer was required to be a full program, but the presented answer isn't. Also, the answer I've taken inspiration from has a mistake on it. The O.P. of the answer hasn't said their personal opinion since 31st, regarding the validity of the answer. I believe this answer is different enough to be posted by itself. • Nice job with “using”! Didn’t think of it (I used @main). Also, you don’t need object Main – user Aug 4 '20 at 0:19 • @user Thank you! I believe that that information should be also part of the cop's answer, where you post your intended solution. This way, more people can learn more and, in case comments are deleted, the information isn't lost. And everybody else is doing the same (I did it too). The using was totally found by chance when reading this: github.com/lampepfl/dotty/commit/… – Ismael Miguel Aug 4 '20 at 0:20 • Yep, I’ll do that tomorrow when I’m on my PC. Again, nice job. Still, did you have to crack it today, when I was almost safe? :/ – user Aug 4 '20 at 0:50 • @user I mean, it sounded like an interesting challenge. I didn't wanted to pass on it. Specially since part of the answer was already made. (Admitedly, the hardest part for me, honestly.) – Ismael Miguel Aug 4 '20 at 1:01 • @user I know you meat it as a joke, don't worry. Dotty seems to be interesting and has some cool concepts. Sorry for stealing your almost-safe submission :( – Ismael Miguel Aug 4 '20 at 7:56 # ><>, cracks HighlyRadioactive's answer aa*b+01pv +b*aa<;  Try it online! How can you output a character without using the o command? With the letter p is how! • See new challenge! – null Aug 12 '20 at 6:41 # ><>, cracks HighlyRadioactive's second answer llllllllllrnnnnnnnnnn'':::,+:::,+:::,+:::,+:::,+:::,+::l+:::,:pv > < ~r~$<


Exits with an error, but when using the right interpreter (e.g. this), it's not actually output.

• OK, you win. The new challenge is even more inconvenient... – null Aug 12 '20 at 7:51

'.':,:&:-&:&&:&:+:&:&+:&:&+:&:&+:&:&+:&:&+:&:&+:&:&+rnnnnnnnnnn''&:&+:&:&+:&:&+:&:&+:&:&+:&:&+'k'&:&+'n'&:&+'k'&:&+'n'&:&+&:pv
> <                                                                                                                          r<


Exits with an error, but when using the right interpreter (e.g. this), it's not actually output.

I knew the register because I stole the feature for Keg.

• Not the intended solution... a fourth one – null Aug 12 '20 at 8:07
• @HighlyRadioactive okay then. – Lyxal Aug 12 '20 at 8:08
• My intended solutions are much terser than yours... That is, no whitespaces, no repeating code, well golfed. – null Aug 12 '20 at 8:10
• We're not here for golf though. We're here to crack answers. – Lyxal Aug 12 '20 at 8:18
• Just sayin'. (f chars) – null Aug 12 '20 at 8:19

# PHP <7.0, 34 bytes

I think that <% also works, but I couldn't get that working on an online interpreter, so this is fine. Also, g^X works, but STDERR and STDOUT are mixed on that site. Should also technically be possible with something like <%=~\xc0 for 5 bytes.

<script language="php">echo"\x3f";


Try it online!

aA%,aA%,KA%,aA%,nA%,aA%,lA%,aA%,oA%,aA%,yA%,aA%,7,aA%,bA%,aA%,Àa%,aA%,673**,aA%,é85**,aA%,¾b%,aA%,fA%,KA%,aA%,aA%,KA%,aA%,nA%,aA%,lA%,aA%,oA%,aA%,yA%,aA%,7,aA%,bA%,aA%,Àa%,aA%,673**,aA%,é85**,aA%,¾b%,aA%,fA%,KA%,


Ungolfed to avoid what appears to be a bug in Keg. I can't remember if this is exactly what I had in mind a month ago as I can't find the file and never bothered to generate a TIO link in my history, but I reckon it's pretty close.

Try it online

Explanation:

While taking away + and - will make it a little harder to generate numbers, % is still a powerful tool. Unsurprisingly, it's a modulo operator, and by moduloing, say, 65 and 97 (characters A and a, respectively), we can get 32, corresponding to space. It's just subtraction with more steps! We mostly just abuse this to get the characters we need, occasionally switching our base to something like a. This won't work for characters greater than 125 (I mean, it could, but I don't want to look up UTF-8 codes), however, and we need two of these: ~ and ⑨. For ~ we just multiply 6, 7, and 3 to get 126. ⑨ has a prime factorization of 2^3 * 5 * 233, so we use é (char code 233), 8, and 5 and multiply through.

# PHP 7, 26 bytes, cracks thelmuxkriovar's answer

<?php echo~..............;


Try it online!

This solution contains unprintables so the link is to xxd output which is reversed. Actual bytes are:

<?php echo~\x99\x8a\x91\x8b\x96\x92\xd7\xd6\x84\x82\xa0\xc2\xd0\xa3;


As noted by @thelmuxkriovar this would not work on PHP 8 without quotes.

• I love this solution, this is brilliant! you should edit your answer to show the hex code for the characters, however as I couldn't tell what you were trying to do until I clicked the link (fun fact, this won't work in php 8 because they changed undefined constant to an error rather than a warning) – thelmuxkriovar Aug 19 '20 at 8:41
• @thelmuxkriovar Glad you liked it! I'll add the xxd data into the post too, good shout. If this isn't the intended crack, please feel free to add another banning ~ too! – Dom Hastings Aug 19 '20 at 8:44
• done :) added ~ to the banning, good luck :) – thelmuxkriovar Aug 19 '20 at 8:52

# AlphaBeta, 228 bytes, cracks @PkmnQ's answer

wEFrErErErErErErErErErErErErErErErErErErErErErErErErErErErErErErErErErErErErErErErErErErErErErErErErErErErErErErErErErErErErErErErErErErErErErErErErErErErErErErErErErErErErErErErErErErErErErErErLErLErLErLErLErLErLErLErLErLErLErL


Try it online!

w        # set Register 3 value to 1 (Register 1 to the power of Register 2; both initially 0)
EF       # copy Register 3 value to Registers 1 and 2
r        # set Register 3 value to 2 (sum of values of Registers 1 and 2)
Er × 94  # 94 times, increment Registers 1 and 3
ErL × 12 # 12 times, increment Registers 1 and 3 and print Register 3 as char

• nEFrErEFrEFrEFrEFrEFrEynFrLErLErLErLErLErLErLErLErLErLErLErL is shorter, but this isn't code golf – PkmnQ Nov 6 '20 at 10:11

'u':-'u':,:'u':,+:'u':,+:'u':,+:'u':,+:'u':,+:'u':,+:'u':,+:'u':,+rnnnnnnnnnn'''u':,+:'u':,+:'u':,+:'u':,+:'u':,+:'u':,+'%''u':,+'k''u':,+'n''u':,+'h''u':,+'n''u':,+'u':,:pv
> <                                                                                                                                                                         r<


Exits with an error, but when using the right interpreter (e.g. this), it's not actually output.

• Right, that's the intended answer. Round 6. (It lasted a whole 7 minutes!) – null Aug 12 '20 at 8:34
• @HighlyRadioactive round 6 will be my last for today. I'll do more tomorrow after that. – Lyxal Aug 12 '20 at 8:35
• I will probably be out of solutions after round 6... This one was the intended solution for round 2 by the way. I was going to use l for round 3... – null Aug 12 '20 at 8:36

00=n00=00=+n00=00=00=++n00=00=00=00=+++n00=00=00=00=00=++++n00=00=00=00=00=00=+++++n00=00=00=00=00=00=00=++++++n00=00=00=00=00=00=00=00=+++++++n00=00=00=00=00=00=00=00=00=++++++++n00=:+:+:+:+:+::++::,+:00=+:00=+:00=+:00=+:00=+00=:+:+:+:+:+00=:+:++00=:++00=00=00=00=00=++++00=00=+*:*00=:+:+:++:00=00=00=+++:00=00=00=++00=00=+*-00=:+:+:+:+:+00=+00=+00=+00=+00=+00=+00=+00=:+:+:+:+:+00=00=++00=:+:+:+:+:+::++00=00=+::**+00=00=00=00=00=00=00=+++++++00=00=pv
> <                                                                                                                                                                                                                                                                                                                                                                                                                                                                r<


Try it online!

Way easier than last time.

• Yep. Let's move on. – null Aug 13 '20 at 3:52

:n::+n:::++n::::+++n:::::++++n::::::+++++n:::::::++++++n::::::::+++++++n:::::::::++++++++n:+:+:+:+:+::++::,+:::,+:::,+:::,+:::,+:::,+:::,+::,:+:+:+:+:+::,:::::++++++::,::::++++::,:+*:*::,:::::::++++++++:::,::+++:::,:::::+++++-::,:+:+:+:+:+::,::,::,::,::,::,::,+++++++::,:+:+:+:+:+::,::,++::,:+:+:+:+:+::,:+:+:++:::,+:::,:+:+:+:+::,:+:+++::,:+:+:+::,+::,+::,:+:+:+::,:++:::,:::::+++++*::,:++::-:p::,:+:+::,+::,:+*::*+::,+::,::-p::,::,::,::,::,++++:+::,::,::,::,::,::,+++++*::,:+::-pr>
`