35
\$\begingroup\$

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.

\$\endgroup\$
1
  • 3
    \$\begingroup\$ 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. \$\endgroup\$ – Dingus Aug 20 '20 at 3:22

98 Answers 98

1 2 3
4
1
\$\begingroup\$

Keg, cracks Lyxal's answer

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.

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

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
\$\endgroup\$
1
  • \$\begingroup\$ nEFrErEFrEFrEFrEFrEFrEynFrLErLErLErLErLErLErLErLErLErLErLErL is shorter, but this isn't code golf \$\endgroup\$ – PkmnQ Nov 6 '20 at 10:11
1
\$\begingroup\$

Lua, 2433 bytes, cracks @LuaNoob's second answer

io.write(_G[([[string]])][string.lower([[CHAR]])](string.len([[................................................]])).._G[([[string]])][string.lower([[CHAR]])](string.len([[.................................................]])).._G[([[string]])][string.lower([[CHAR]])](string.len([[..................................................]])).._G[([[string]])][string.lower([[CHAR]])](string.len([[...................................................]])).._G[([[string]])][string.lower([[CHAR]])](string.len([[....................................................]])).._G[([[string]])][string.lower([[CHAR]])](string.len([[.....................................................]])).._G[([[string]])][string.lower([[CHAR]])](string.len([[......................................................]])).._G[([[string]])][string.lower([[CHAR]])](string.len([[.......................................................]])).._G[([[string]])][string.lower([[CHAR]])](string.len([[........................................................]])).._G[([[string]])][string.lower([[CHAR]])](string.len([[.........................................................]])).._G[([[string]])][string.lower([[CHAR]])](string.len([[................................]])).._G[([[string]])][string.lower([[CHAR]])](string.len([[..................................]])).._G[([[string]])][string.lower([[CHAR]])](string.len([[...................................]])).._G[([[string]])][string.lower([[CHAR]])](string.len([[....................................]])).._G[([[string]])][string.lower([[CHAR]])](string.len([[......................................]])).._G[([[string]])][string.lower([[CHAR]])](string.len([[.......................................]])).._G[([[string]])][string.lower([[CHAR]])](string.len([[..........................................]])).._G[([[string]])][string.lower([[CHAR]])](string.len([[...........................................]])).._G[([[string]])][string.lower([[CHAR]])](string.len([[.............................................]])).._G[([[string]])][string.lower([[CHAR]])](string.len([[...............................................]])).._G[([[string]])][string.lower([[CHAR]])](string.len([[............................................................................................]])).._G[([[string]])][string.lower([[CHAR]])](string.len([[.................................................................................................]])))

Try it online! Untested in 5.1 (TIO has 5.3.5), but I don't believe there's any code here that depends on the minor version.

Pretty similar to the first crack. This time we don't have a or #, which we work around by calling string.char as _G[([[string]])][string.lower([[CHAR]])] and # as string.len. I used this Ruby code to generate the Lua:

X = %q(0123456789 "#$&'*+-/\\a)
luaify = ->(s) { s.bytes.map{|b|"_G[([[string]])][string.lower([[CHAR]])](string.len([[#{'.'*b}]]))"}*'..' }
print "io.write(#{luaify[X]})"

Try it online!

\$\endgroup\$
1
  • \$\begingroup\$ let me fix that ASAP :D \$\endgroup\$ – LuaNoob Feb 7 at 17:09
1
\$\begingroup\$

Forth (gforth), 13 bytes, cracks binarycat's challenge

.\"0x0B\x20\t\n"

Try it online!

This also happens to be my first Forth program. 😃

Explanation

It is really simple. I use .\" which allows me to use C-style escapes, and then I use a vertical tab (0x0B) to delimit the tokens, as Gforth uses the same whitespace rules as isspace(). The rest is just writing everything in C escapes.

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

Rattle, 48 bytes, cracks @DanielH.'s answer

+4*4*7,%=+4*7+7+7+++,+7+7,%=+7+7++b*7b**7b*b*7bB

Try it online!

Pretty straightforward: push a bunch of values to the stack, then either print them as characters (,) or concatenate them to the print buffer (b) as floats. I use %= (modulo with top of stack) to reset the stack.

\$\endgroup\$
2
  • \$\begingroup\$ This is awesome - this is the first answer (that I know of) by a user other than myself in Rattle! By the way, the default argument for the = command is 0, so you can actually remove the % \$\endgroup\$ – Daniel H. Feb 11 at 5:13
  • 1
    \$\begingroup\$ @DanielH. I found it pretty easy to get up and running (albeit only doing really basic stuff). Looks like an interesting language. \$\endgroup\$ – Dingus Feb 11 at 6:24
1
\$\begingroup\$

Dis, 47 bytes, cracks @tailsparkrabbitear's answer

*|||_________________________________________>!

Try it online! Link compiles and runs a copy of Ben Olmstead's interpreter in C.

Explanation

We make use of self-modifying code to execute the banned print instruction.

*|||                                         >  # set the accumulator to 123; also store 123 in cell 45
    _________________________________________   # no-ops
                                             >  # execute cell 45 (modified to codepoint 123), i.e. print accumulator as ASCII character
                                              ! # terminate
\$\endgroup\$
1
  • \$\begingroup\$ Great that it's shorter than my original answer! \$\endgroup\$ – tail spark rabbit ear Jul 23 at 3:45
0
\$\begingroup\$

><>, cracks HighlyRadioactive's seventh answer (yes, seventh)

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.

\$\endgroup\$
1
  • \$\begingroup\$ Yep. Let's move on. \$\endgroup\$ – null Aug 13 '20 at 3:52
0
\$\begingroup\$

APL (Dyalog Unicode), 81 bytes, cracks Ada's answer

∆←⍎'⎕A',22⊃⎕A
⎕←(25↑66↓∆),(26↑17↓∆),(97⊃∆),⍕2+1

Try it online!

This was pretty easy. ⎕A is our escape hatch - it's the list of all 26 capital letters in the English alplhabet. We want ⎕AV, a string containing all the letters Unicode APL uses. 22⊃⎕A gets the 22nd element of ⎕A ("V"), and we append that to the string '⎕A' and execute it to get the value of ⎕AV. That is assigned to a variable .

\$\endgroup\$
1 2 3
4

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.