Edit 2020年11月06日: This challenge has been edited with new provisions to encourage participation. The edits have been bolded for emphasis.
Welcome to a cops and robbers version of Find an Illegal String.
An illegal string is "a string of characters that cannot appear in any legal program in your programming language of choice" (from the linked post).
For this challenge, we will define an almost illegal string, which is a string of characters that is very hard, but not impossible, to include in a valid program.
The Cops' Challenge
- Choose a programming language, and choose an 'almost illegal string' - this is a sequence of characters that is very hard to include in a valid program without causing it to error.
- Write a program that contains the 'almost illegal string' as a contiguous substring that does not error.
- Optionally, you may also specify a set of banned characters. These are characters that do not appear in your program, except in the 'almost illegal string'. (Therefore: banned characters can still appear inside the almost illegal string)
That's it! You will reveal the programming language, the almost illegal string, and the set of banned characters, and challenge robbers to write a program that contains the illegal string but does not error.
For the purposes of this challenge, we define 'does not error' as:
- Your program exits with exit code 0.
- Your program does not print any output to standard error.
- Your program may print anything to standard output, if you wish, but it does not have to.
- If (and only if) your language always prints output to standard error regardless of the program, such as debugging or timing information, you may instead design a program that only outputs this to standard error. If you are making use of this clause, mention it in your cop post.
The Robbers' Challenge
Find an uncracked answer. Write a program in the language specified that contains as a contiguous substring the almost illegal string specified and does not error. Your program may not use any character in the set of banned characters, unless it is part of the almost illegal string. Your program does not need to be exactly what the cop had in mind. Post an answer to the robber's thread and leave a comment on the cops' answer to crack it.
Clarifications
- If your cop answer requires a specific operating environment or version, you must specify this in your answer.
- The cop's almost illegal string that they reveal is to be interpreted with respect to the standard encoding for the language's interpreter. For most programs, this will be UTF8.
- Solutions should not take any input (via standard input, argv, or any other source) and may assume no such input is given.
- Solutions must terminate in a finite amount of time. This means entering an infinite loop and getting killed by TIO's 60 second timeout is not a valid solution.
- Cops should make sure if their almost illegal string contains leading or trailing newlines that it is very clear it does so. Robbers should carefully note any leading or trailing newlines in a cop's post.
Formatting hint
The clearest way to include leading or trailing newlines is to use the backtick syntax for your post:
```
foo
```
Renders as:
foo
To remove any ambiguity, explicitly mention the leading/trailing newlines in your post.
Scoring
After 10 days without a crack, a cop can mark their answer as safe and reveal their solution. Once the cop has revealed their solution, it is no longer able to be cracked.
Cops are scored based on the length (in bytes) of their almost illegal string in their safe answer(s), with lower being better.
Robbers are scored by the number of answers they crack, with higher being better.
Example
Python 3, 5 bytes
Illegal string:
"'1/0
Banned characters:
#'
Python 3, cracks example's answer
Program:
""" "'1/0 """
The idea is that we can just comment out the string, since "
is not banned.
-
3\$\begingroup\$ It looks too hard to find a suitable language for this. Can I impose some extra restricted-source on the robber's code, e.g. banning certain chars, or allowing to add code only after the string, etc? \$\endgroup\$Bubbler– Bubbler2020年11月05日 07:25:16 +00:00Commented Nov 5, 2020 at 7:25
-
\$\begingroup\$ @Bubbler I'm not super happy about the idea of editing in extra rules after the challenge, but so be it. If there are no answers in the next 12 hours, I will allow cops to ban the use of a set of characters. \$\endgroup\$Sisyphus– Sisyphus2020年11月05日 09:34:08 +00:00Commented Nov 5, 2020 at 9:34
-
1\$\begingroup\$ The number of answers to the original "Find an illegal string" challenge that I flagged for deletion as invalid suggests that this challenge can't possibly be too hard. \$\endgroup\$The Fifth Marshal– The Fifth Marshal2020年11月05日 14:41:50 +00:00Commented Nov 5, 2020 at 14:41
-
\$\begingroup\$ You should probably add the code-golf tag to this question because "Cops are scored based on the length (in bytes) of their almost illegal string". \$\endgroup\$SunnyMoon– SunnyMoon2020年11月05日 17:01:04 +00:00Commented Nov 5, 2020 at 17:01
-
3\$\begingroup\$ I don’t really like the fact that the number of banned characters has no impact on the score, as it makes it more open to abuse. However, I do see the problems with trying to incorporate it into the scoring system. Therefore, I’d recommend something like using the number of banned characters as a tie breaker for safe answers of the same length, so it has some impact, but not enough to significantly affect the challenge \$\endgroup\$caird coinheringaahing– caird coinheringaahing ♦2020年11月07日 01:21:02 +00:00Commented Nov 7, 2020 at 1:21
29 Answers 29
Python 2, 5 bytes (cracked by tsh)
bin()
Banned: all characters except alphanumeric characters
abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
So, you're allowed the above characters and nothing else (in addition to bin()
itself).
(This idea isn't mine, I remember it from an earlier challenge, but I don't remember who deserves credit for it.)
-
-
\$\begingroup\$ @tsh Yup, you got it! \$\endgroup\$xnor– xnor2020年11月06日 02:22:38 +00:00Commented Nov 6, 2020 at 2:22
-
\$\begingroup\$ @PkmnQ Yes, but why wouldn’t it? "Banned: all characters except alphanumeric characters" \$\endgroup\$2020年11月10日 02:21:11 +00:00Commented Nov 10, 2020 at 2:21
-
\$\begingroup\$ @cairdcoinheringaahing Oh, I just saw the code block and thought that those were the disallowed characters. \$\endgroup\$PkmnQ– PkmnQ2020年11月10日 11:05:39 +00:00Commented Nov 10, 2020 at 11:05
Haskell, 3 bytes
#"
(begins with a newline)
Disallowed charachters: -
-
\$\begingroup\$ There are no extra compiler flags, and the file doesn't have to be given a special name right? I can see ways to solve it with either of these concessions, but it looks very tough otherwise. \$\endgroup\$2020年11月06日 22:51:47 +00:00Commented Nov 6, 2020 at 22:51
-
\$\begingroup\$ @WheatWizard there is a solution with neither of those, but I'd be intrested in how you'd use those (I made it so it should be fairly difficult even with that). Unless of course you use QuasiQuotes, but what's the fun in that? \$\endgroup\$binarycat– binarycat2020年11月06日 23:04:55 +00:00Commented Nov 6, 2020 at 23:04
-
\$\begingroup\$ I was thinking of either QuasiQuotes or cpp neither of which is super fun. Even less fun is to use literate Haskell by naming the file
something.lhs
in which case noncommented lines need to be escaped with>
, so you can just insert>main=print 3
and the rest will be a comment. \$\endgroup\$2020年11月06日 23:10:52 +00:00Commented Nov 6, 2020 at 23:10 -
2\$\begingroup\$ Ok and I cracked it normally. Really nice answer. I didn't even know I could do that! \$\endgroup\$2020年11月06日 23:15:18 +00:00Commented Nov 6, 2020 at 23:15
-
1\$\begingroup\$ @WheatWizard Haskell is one of the hardest ones to do this with honestly, due to how regular the grammar is. \$\endgroup\$binarycat– binarycat2020年11月06日 23:49:20 +00:00Commented Nov 6, 2020 at 23:49
Jelly, 4 bytes, cracked by HyperNeutrino
«{
You may not use newlines. Any other character/byte is fair game
My intended solution was any of the banned characters here aside from "
. Each of these characters cause the parsing of the link to break, meaning everything before them gets ignored:
-
\$\begingroup\$ @HyperNeutrino Sorry about that, I realised that it could be easily cracked (in a different way to that) and deleted it just as you commented. I've updated my answer so that neither that nor my old crack would work \$\endgroup\$2020年11月06日 01:43:54 +00:00Commented Nov 6, 2020 at 1:43
-
\$\begingroup\$ Ah, okay no worries. This would still be valid then right? \$\endgroup\$2020年11月06日 01:44:53 +00:00Commented Nov 6, 2020 at 1:44
-
\$\begingroup\$ @HyperNeutrino It would, although I'm not quite sure why. If you post that as a crack, I'll happily give it to you \$\endgroup\$2020年11月06日 01:45:44 +00:00Commented Nov 6, 2020 at 1:45
-
\$\begingroup\$ newline and
¶
are the same character and while it's conventional to use¶
in strings with multiple lines, the Jelly interpreter literally cannot tell the difference because they get mapped to the same codepoint in the SBCS \$\endgroup\$2020年11月06日 01:46:33 +00:00Commented Nov 6, 2020 at 1:46 -
1\$\begingroup\$ @HyperNeutrino Yeah, but
«
is a string terminator, so should close the leading"
.{
on a string errors, but for some reason,"
gets rid of that \$\endgroup\$2020年11月06日 01:47:43 +00:00Commented Nov 6, 2020 at 1:47
Python 3, 7 bytes, cracked by @EasyasPi
Still not the intended answer, so I'm just revealing it. Scroll to the bottom to see it.
raise
Banned characters
TAB "'(),.=[\]_{|}
Non-ASCII characters are all banned as well. Try it online or validate it online!
Some cracks that work without the banned chars
'''
raise'''
"""
raise"""
raise SystemExit
raiseTABSystemExit # originally posted by EasyasPi here, he found yet another loophole
raise\
SystemExit
raiser=3 # originally posted by EasyasPi on v1 of this challenge
Intended Answer
#coding:U7 quit+ACgAKQ- raise
This works because
the magic comment at the top sets the file encoding to UTF-7
and
in UTF-7, characters can be encoded by first converting them to their UTF-16 binary representations, and concatenating them if there are multiple characters to be encoded. Here, we want to call
quit
, so we need to convert()
. This becomes0000 0000 0010 1000 0000 0000 0010 1001
. Next, we regroup them into groups of 6, to get000000 000010 100000 000000 001010 01
, and pad the last group with trailing zeros (if necessary). In this case, we get000000 000010 100000 000000 001010 010000
. Finally, we convert these to the corresponding Base64 characters (table here), gettingACgAKQ
, prepend a+
, and append a-
.
So,
()
in UTF-7 is+ACgAKQ-
. We use this fact to bypass the banned()
and callquit
anyways, by replacing()
with+ACgAKQ-
. This exits the program before it can throw any errors.
-
-
\$\begingroup\$ i don't feel like posting another answer so i'm just going to edit this one if that's fine with you \$\endgroup\$Makonede– Makonede2021年02月18日 18:48:50 +00:00Commented Feb 18, 2021 at 18:48
-
\$\begingroup\$ @EasyasPi alright i'm about 99% certain i've fixed all loopholes but I'm sure you'll find another one in like 10 seconds xD \$\endgroup\$Makonede– Makonede2021年02月18日 19:00:11 +00:00Commented Feb 18, 2021 at 19:00
-
\$\begingroup\$ as in I can't see any other loopholes but i'm pretty sure you'll find one anyway \$\endgroup\$Makonede– Makonede2021年02月18日 19:00:41 +00:00Commented Feb 18, 2021 at 19:00
-
Jelly, 4 bytes, cracked by Unrelated String
«{
I'm giving Jelly another go, but with slightly more restrictions. You may not use quƁƘȤ(ƈɦƙɱɲƥʠʂȥ
(the unimplemented commands in Jelly), "
or newlines, as these make it far too trivial to crack (thanks to HyperNeutrino for showing that)
Neither HyperNeutrino's crack in the comments, nor Unrelated String's crack was my intended solution. Putting a Œ
(or any of ÐÆØœæ
) with nothing after it at the end causes the same behaviour as any of quƁƘȤ(ƈɦƙɱɲƥʠʂȥ
, as they always expect to have a character after them. Without any character, they cause a break in the program chain, meaning that everything before them is ignored:
-
1\$\begingroup\$ I'm really sorry but........ this. Somehow. Works. (help, jelly is confusing again aah) \$\endgroup\$2020年11月06日 02:45:10 +00:00Commented Nov 6, 2020 at 2:45
-
1\$\begingroup\$ @HyperNeutrino Well, at this point Jelly may not be the best language to go for :/ If you post another crack, I‘ll edit it in in the morning \$\endgroup\$2020年11月06日 03:12:18 +00:00Commented Nov 6, 2020 at 3:12
-
1\$\begingroup\$ Yeah... I find that Jelly's quite forgiving on not erroring when you input random things that one wouldn't expect to work. rip :/ \$\endgroup\$2020年11月06日 03:13:55 +00:00Commented Nov 6, 2020 at 3:13
-
1\$\begingroup\$ Cracked 😔 \$\endgroup\$Unrelated String– Unrelated String2020年11月06日 12:32:05 +00:00Commented Nov 6, 2020 at 12:32
-
1\$\begingroup\$ @UnrelatedString Not my intended solution, but very nice! \$\endgroup\$2020年11月06日 12:33:54 +00:00Commented Nov 6, 2020 at 12:33
R, 2 bytes, cracked by Dominic van Essen
'"
Banned characters (newlines are banned):
'"`#\qel
This bans the obvious cracks I can think of, but I wouldn't be surprised if you come up with a crack very different to what I intend.
Dominic van Essen cracked a first version of this challenge, and then a second; then Giuseppe cracked a third version. I have added qel
and newlines to the list of banned character to sidestep their cracks.
The solution I had in mind was
assign(intToUtf8(c(37,39,34,37)), c); 1 %'"% 2
The assign call creates a new binary operator, %'"%
; it is equivalent to "%'"%" <- c
. In R, you can create new operators of the form %x%
where x
is any string: %}%
, %$@%
and %μ£$%
are all valid operator names. Here, the new operator is equal to the concatenation function c
and so the output is the vector 1 2
.
Dominic's crack doesn't define the operator; he simply buried it in a try
call, which is also valid R code.
The trick used here means that any future attempt at an almost illegal string will probably have to ban the %
character.
-
\$\begingroup\$ does this count as a crack? \$\endgroup\$Dominic van Essen– Dominic van Essen2020年11月11日 21:46:04 +00:00Commented Nov 11, 2020 at 21:46
-
\$\begingroup\$ @DominicvanEssen Nice find! That surely counts, and isn't what I had intended. Since the challenge is very new, I'll edit it to add
q
to the banned characters (rather than posting a new challenge), but feel free to post your crack to the robbers' thread. \$\endgroup\$Robin Ryder– Robin Ryder2020年11月11日 22:06:37 +00:00Commented Nov 11, 2020 at 22:06 -
\$\begingroup\$ what about this then? \$\endgroup\$Dominic van Essen– Dominic van Essen2020年11月11日 22:19:58 +00:00Commented Nov 11, 2020 at 22:19
-
2\$\begingroup\$ Nah, this is fine by me. We'll just start the safety period from the latest version :-) \$\endgroup\$Giuseppe– Giuseppe2020年11月13日 17:56:26 +00:00Commented Nov 13, 2020 at 17:56
-
2\$\begingroup\$ cracked - and I suspect that this was finally what you had in mind...? \$\endgroup\$Dominic van Essen– Dominic van Essen2020年11月14日 00:37:11 +00:00Commented Nov 14, 2020 at 0:37
Desmos, 9 bytes,
sort(3,2
Banned characters: New Lines
I'm hoping that most people are not familiar with Desmos here, so people wouldn't know what to try.
Note:
An expression in Desmos would be considered an error if it shows a "danger sign" next to the expression, like this:
-
1
-
\$\begingroup\$ Cracked with a different solution? \$\endgroup\$Cloudy7– Cloudy72021年03月11日 15:51:38 +00:00Commented Mar 11, 2021 at 15:51
-
\$\begingroup\$ I think this is a good crack, using standard Desmos rules \$\endgroup\$Ethan Chapman– Ethan Chapman2021年03月17日 23:00:07 +00:00Commented Mar 17, 2021 at 23:00
Python 3, 13 bytes, Cracked by EasyasPi
int(А,В,С)
Banned Characters: All ascii characters except 2()~+
and newlines. '"#=
are banned.
!"#$%&'*,-./013456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}
The solution makes use of an odd python 3 feature.
-
-
1\$\begingroup\$ Yeah, it was pretty easy. lol. \$\endgroup\$qwatry– qwatry2021年02月06日 14:16:17 +00:00Commented Feb 6, 2021 at 14:16
Rust, 5 Bytes (Safe)
:! =1
Banned Characters:
|!/"'
A nightly compiler is used, you may pass any flags to rustc if you like.
A crack by @EasyasPi does work (and is brilliant), but I think because the question says "you must write a program that contains ...", if your code is not designed to run, it isn't a program :)
The intended solution
The idea is to create a local variable that has the never type, call some functions on the integer 1 such that it becomes the never type.
However, with !
as a banned character, we can't simply put the #![feature(never_type)]
attribute on the top of the program. We must use an unstable rustc flag that allows us to inject crate-level attributes. The command to compile would be:
cargo rustc -- -Z crate-attr='feature(never_type, core_panic)'
Because closures (|| something
) and the use of the !
type outside are restricted, we must operate on the integer literal with provided functions. This is where the core_panic
feature comes in and gives us a nice way to transform a &str
into !
. We know the start and the end, we can just put them together:
use std::io::stdout;
use core::panicking::panic_str;
use std::borrow::Borrow;
fn main() {
let a:! =1i8.checked_neg().as_ref().map(ToString::to_string).as_ref().map(Borrow::borrow).map(panic_str).unwrap();
}
Vim, 4 bytes, cracked by tail spark rabbit ear
<Esc><Esc>ZQ
This one is a bit more difficult than my other Vim one.
Intended Solution:
i<C-o>:<C-r><Esc><Esc>ZQ
-
\$\begingroup\$ cracked \$\endgroup\$user100411– user1004112021年07月12日 09:42:44 +00:00Commented Jul 12, 2021 at 9:42
-
\$\begingroup\$ @tailsparkrabbitear Nice, I forgot that windows were a thing. The intended solution was very different, but I like yours, too. \$\endgroup\$Aaroneous Miller– Aaroneous Miller2021年07月12日 12:23:19 +00:00Commented Jul 12, 2021 at 12:23
Python 3, 10 bytes, cracked by The Fifth Marshal
?"""?'''?
Banned characters
Alphanumeric, whitespace, and non-ASCII.
The intended solution makes use of an interesting quirk in the Python parser.
Here's a hint if you want one:
The hint is that there is no hint. (This isn't a joke. This is actually the hint.)
Intended Answer
Hexdump:
00000000: 2300 0a3f 2222 223f 2727 273f #..?"""?'''?
For some reason,
the Python parser seems to ignore characters following null characters.
So,
it ignores the newline after the
#␀
, therefore treating the?"""?'''?
as part of the comment.
Fun fact: This was actually posted on the original Find an Illegal String challenge, but when I found a way to get around it, I decided to post it here.
-
\$\begingroup\$ Oops lol... shouldn't have let that happen. Try with question marks there instead this time. Lol \$\endgroup\$Makonede– Makonede2021年03月11日 01:37:37 +00:00Commented Mar 11, 2021 at 1:37
-
\$\begingroup\$ Dw, I'll try to look for your intended solution :) \$\endgroup\$dingledooper– dingledooper2021年03月11日 02:22:28 +00:00Commented Mar 11, 2021 at 2:22
-
\$\begingroup\$ Are you referring to type hints here? \$\endgroup\$user– user2021年03月11日 19:09:31 +00:00Commented Mar 11, 2021 at 19:09
-
\$\begingroup\$ Possibly. For now though, all that's written in the answer is all you'll get. \$\endgroup\$Makonede– Makonede2021年03月11日 19:51:47 +00:00Commented Mar 11, 2021 at 19:51
-
1\$\begingroup\$ cracked \$\endgroup\$The Fifth Marshal– The Fifth Marshal2021年03月19日 21:00:04 +00:00Commented Mar 19, 2021 at 21:00
-
1
-
-
\$\begingroup\$ @Dingus That's a pretty simple solution, don't know how I missed it. I made a more difficult version that should require the intended solution. \$\endgroup\$binarycat– binarycat2020年11月08日 20:19:27 +00:00Commented Nov 8, 2020 at 20:19
Julia, 6 bytes
?""":
There is a zero width space before the :
Disallowed characters: #
nasm, 4 bytes, safe
[al]
Banned characters:
;"`'%#
Solution:
section
is, as far as I know, the only thing in NASM which accepts an arbitrary string without quotes.Try it online!section [al] section .text global _start _start: mov eax, 60 syscall
Stop giving me these assembly ones for free. 😔
Python 3, 3 bytes, Cracked by user
I can't believe I missed that obvious loophole! I am adding a slightly revised version of my code that should avoid this.
New Answer, 4 bytes, Cracked by Unrelated String
1=2
Note: There is a space
at the beginning of the code.
Banned characters: All non-ascii characters, quotes, and #.
"'#
Old Answer, 3 bytes, Cracked by user:
1=2
Banned characters: All non-ascii characters, quotes, and #.
"'#
My intended solution for both posts:
foo : 1=2
-
1
-
1\$\begingroup\$ LOL! That was fast. :) \$\endgroup\$qwatry– qwatry2021年02月22日 15:12:09 +00:00Commented Feb 22, 2021 at 15:12
-
\$\begingroup\$ The new link and byte count don't match the text ` 1+1=2`. \$\endgroup\$Unrelated String– Unrelated String2021年02月22日 16:29:54 +00:00Commented Feb 22, 2021 at 16:29
-
\$\begingroup\$ ...cracked \$\endgroup\$Unrelated String– Unrelated String2021年02月22日 16:43:22 +00:00Commented Feb 22, 2021 at 16:43
-
\$\begingroup\$ I'll fix the link. Thx. Sorry about that. \$\endgroup\$qwatry– qwatry2021年02月22日 17:07:42 +00:00Commented Feb 22, 2021 at 17:07
Javascript, 7 bytes, cracked by Makonede
...void
Javascript, 8 bytes, cracked by Makonede
Note one trailing space
...void
Banned characters:
- all comments:
//
,/**/
- all strings:
""
,``
,''
- curlies:
{}
- brackets:
[]
- asterisk:
*
- the letter
w
Clarifications: My cop answer works in a browser environment, but there are probably solutions in Node too.
-
-
\$\begingroup\$ @Makonede Thanks for the effort, looks like I overlooked the easiest approach of all. If you're interested, I added an updated version of the challenge that should be a bit more interesting. \$\endgroup\$Etheryte– Etheryte2021年03月11日 17:54:49 +00:00Commented Mar 11, 2021 at 17:54
-
\$\begingroup\$ still too simple... \$\endgroup\$Makonede– Makonede2021年03月11日 18:08:03 +00:00Commented Mar 11, 2021 at 18:08
Ruby, 17 bytes
=end
#{"""'}
=end
Disallowed characters: N
,%
This time I made it a bit harder.
Ruby, 18 bytes
=end
#{/"""'}
=end
Disallowed characters: N
,%
,/
my final variation, hopefully the next solution is the intended one.
-
\$\begingroup\$ The approach used in my second crack also works for this version. Is there supposed to be another disallowed character? \$\endgroup\$Dingus– Dingus2020年11月07日 00:54:31 +00:00Commented Nov 7, 2020 at 0:54
-
1\$\begingroup\$ @Dingus I guess there is now. I thought the
/
would stop the regex approach, but I should have checked. \$\endgroup\$binarycat– binarycat2020年11月07日 01:00:26 +00:00Commented Nov 7, 2020 at 1:00 -
\$\begingroup\$ And just to clarify, the almost illegal string is the same as before -
/
is not part of it any more? (Asking because the header still says 18 bytes.) \$\endgroup\$Dingus– Dingus2020年11月07日 01:05:21 +00:00Commented Nov 7, 2020 at 1:05 -
\$\begingroup\$ @Dingus It's supposed to be there, not sure what happened to it. I probably don't need it but I'd hate for not including it to be the reason another solution slips past. \$\endgroup\$binarycat– binarycat2020年11月07日 01:08:26 +00:00Commented Nov 7, 2020 at 1:08
-
1\$\begingroup\$ @Dingus almost. My version used unintrpolated docstrings, but that works too. If only I put the
/
on the other side... \$\endgroup\$binarycat– binarycat2020年11月07日 01:22:11 +00:00Commented Nov 7, 2020 at 1:22
Zsh
#include <cstdlib>
#include <iostream>
int main() {
srand(time(NULL));
hello();
return rand() % 2;
}
/*
main
a=0
\
print "$((1/$a))"
*/
void hello() std::cout << "Hello, World!" << std::endl;
- Allowed characters: all printable ASCII except
blxy<'`$
(lowercase B, L, X, and Y, single-quote, grave, dollar sign) - Please note all the leading and trailing whitespace.
Probably not too hard but you may learn a lot about the many - shall we say "quirks" - of zsh.
-
1
-
\$\begingroup\$ @xigoi no, I forgot to disallow
<
oops \$\endgroup\$pxeger– pxeger2020年11月07日 18:04:57 +00:00Commented Nov 7, 2020 at 18:04 -
1\$\begingroup\$ Even simpler exploit, which probably can't be avoided unfortunately. \$\endgroup\$Adamátor– Adamátor2020年11月07日 19:28:59 +00:00Commented Nov 7, 2020 at 19:28
-
\$\begingroup\$ @xigoi Clearly I didn't think carefully enough about this \$\endgroup\$pxeger– pxeger2020年11月07日 19:32:40 +00:00Commented Nov 7, 2020 at 19:32
-
1\$\begingroup\$ still too simple, do you need to ban another character? :P \$\endgroup\$Cinaski– Cinaski2021年02月17日 17:36:17 +00:00Commented Feb 17, 2021 at 17:36
Desmos, 2 bytes, cracked by PkmnQ
Substring:
\
(Note the newline in the beginning)
Banned characters: All alphanumeric characters
abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
I'm hoping that most people are not familiar with Desmos here, so people wouldn't know what to try.
Note:
An expression in Desmos would be considered an error if it shows a "danger sign" next to the expression, like this:
-
1
-
\$\begingroup\$ @PkmnQ You got it! \$\endgroup\$Aiden Chow– Aiden Chow2020年11月10日 01:53:35 +00:00Commented Nov 10, 2020 at 1:53
Python 3, 6 bytes, cracked by EasyasPi
@EasyasPi's crack does work (and I'm dumb for letting it work), but I'm not revealing the original solution yet; I've posted a v2 hopefully preventing any loopholes.
raise
Banned characters
"'(),.:[\]_{|}
Non-ASCII characters are all banned as well. Try it online or validate it online!
Some cracks that work without the banned chars
'''
raise'''
"""
raise"""
raise SystemExit
raise\
SystemExit
-
-
1\$\begingroup\$ Oof ok. Posting a v2. lol \$\endgroup\$Makonede– Makonede2021年02月18日 18:25:30 +00:00Commented Feb 18, 2021 at 18:25
-
\$\begingroup\$ @EasyasPi try now, hopefully i've fixed that loophole \$\endgroup\$Makonede– Makonede2021年02月18日 18:36:35 +00:00Commented Feb 18, 2021 at 18:36
-
Vim, 3 bytes, cracked by tail spark rabbit ear
<Esc>ZQ
A Vim program doesn't really "error out" per se, but ZQ
will exit the current file without saving, so it can't be executed in a valid program, thereby making it "illegal".
This is a bit of an easier one, if you know Vim.
Intended Solution:
i<C-v><Esc>ZQ
-
\$\begingroup\$ cracked \$\endgroup\$user100411– user1004112021年07月12日 09:42:59 +00:00Commented Jul 12, 2021 at 9:42
Vyxal, 15 bytes, Cracked by lyxal
«Wi«»Wi»`Wi`Wi
No bans, do what you want. Note that silently erroring at compile-time (Nothing appears in the 'output' box) counts as an error - even the empty program outputs 0...
My intended solution was prepending a [
to just make sure the code isn't run.
Rust, 4 bytes, cracked by Themoonisacheese
"'"'
Expecting this to be an easy crack, probably. No compiler flags allowed.
Disallowed characters:
"'/
Themoonisacheese's crack using a shebang, revised disallowed characters:
#"'/
-
\$\begingroup\$ cracked was fun \$\endgroup\$Themoonisacheese– Themoonisacheese2025年05月07日 13:51:05 +00:00Commented May 7 at 13:51
-
\$\begingroup\$ cracked again i am learning rust in the worst possible way \$\endgroup\$Themoonisacheese– Themoonisacheese2025年05月08日 21:14:00 +00:00Commented May 8 at 21:14
-
\$\begingroup\$ @Themoonisacheese nice job! \$\endgroup\$Deadbeef– Deadbeef2025年05月11日 12:47:30 +00:00Commented May 11 at 12:47
JavaScript (THREE.js 105) (Must include canvas element) ~48 bytes
const scene = new THREE.Scene();
scene.add(cube);
Note empty lines Try it!
Banned Characters: All quote characters
/
-
\$\begingroup\$ @Davide, look at the banned characters \$\endgroup\$HitchHacker– HitchHacker2021年02月04日 15:20:24 +00:00Commented Feb 4, 2021 at 15:20
-
\$\begingroup\$ Omg I am sorry, I've misunderstood the role of banned characters. \$\endgroup\$anotherOne– anotherOne2021年02月04日 15:40:11 +00:00Commented Feb 4, 2021 at 15:40
-
\$\begingroup\$ why not just prepend
cube = new THREE.Object3D();
? (I've never used three.js before, I took the class name from the error message) \$\endgroup\$the default.– the default.2021年02月04日 15:42:53 +00:00Commented Feb 4, 2021 at 15:42 -
\$\begingroup\$ The way to create a new cube is much more complex due to the fact that it uses webgl to display 3d graphics @thedefault. \$\endgroup\$HitchHacker– HitchHacker2021年02月05日 18:01:32 +00:00Commented Feb 5, 2021 at 18:01
-
1\$\begingroup\$ @HitchHacker I don't have to create a cube. When I prepend
cube = new THREE.Object3D();
, the program runs without errors. \$\endgroup\$the default.– the default.2021年02月06日 00:49:19 +00:00Commented Feb 6, 2021 at 0:49
Python 3, 7 bytes
"""'''$
(Note no starting or trailing newline.)
Disallowed characters:
#
-
1\$\begingroup\$ Maybe I'm missing something here, but if there's no leading newline, couldn't you just comment this out? \$\endgroup\$Aaroneous Miller– Aaroneous Miller2021年11月10日 13:44:43 +00:00Commented Nov 10, 2021 at 13:44
-
1\$\begingroup\$ Try it online! \$\endgroup\$Aaroneous Miller– Aaroneous Miller2021年11月10日 15:50:22 +00:00Commented Nov 10, 2021 at 15:50
Plain TeX
\def\bye
The document must compile without error (you can't simply comment the whole line: Fatal error occurred, no output PDF file produced!
).
Banned character
\
Intended solution
^^\def\bye
using that the sequence^^
will read the next char as an ASCII number.
Explore related questions
See similar questions with these tags.