Note: This challenge is finished. Submissions are still welcome but can not win.
This is the cops' thread. The robbers' thread goes here.
Write a code that outputs the integer 1
. If you add, remove or substitute a single character (of your choosing), the code should output the integer 2
. Change one more character (the same or another), and the code should output 3
. Continue like this as far as you can, but maximum up to 10. Default output formats such as ans = 1
are accepted. You can ignore output to STDERR (or equivalent).
You must reveal the language, byte count of your initial code, the number of integers it works for, as well as an optional number of characters of the initial code. Note: You don't have to reveal any characters, but remember that revealing characters might make it harder for the robbers as they must use the same character in the same position. You can choose which character you use to denote unrevealed characters (for instance underscore), but make sure to specify this.
Cops can provide the uncracked code after one week and call the submission "SAFE". The winning submission will be the shortest uncracked submission that produces the number 10. If no uncracked submissions are able to print 10, the shortest code that produces 9 will win, and so on. Note that the robbers don't have to make the same changes as you do, and they don't have to reproduce the exact code (unless you reveal all characters). They must only reproduce the output.
Submissions posted later than November 24th are welcome but not eligible for the win (because there will likely be fewer robbers around).
Example post:
The following post is a submission in the language MyLang
, it is 9 bytes long, and it works for numbers 1 - 8.
MyLang, 9 bytes, 8 numbers
This submission works for 1 - 8. Unrevealed characters are indicated with an underscore: _
.
abc____i
Leaderboard
Disclaimer: The leaderboard is not tested and uncracked submissions might not appear in the list.
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script><style>table th,table td{padding: 5px;}th{text-align: left;}.score{text-align: right;}table a{display: block;}.main{float: left;margin-right: 30px;}.main h3,.main div{margin: 5px;}.message{font-style: italic;}#api_error{color: red;font-weight: bold;margin: 5px;}</style> <script>QUESTION_ID=99546;var safe_list=[];var uncracked_list=[];var n=0;var bycreation=function(x,y){return (x[0][0]<y[0][0])-(x[0][0]>y[0][0]);};var byscore=function(x,y){return (x[0][1]>y[0][1])-(x[0][1]<y[0][1]);};function u(l,o){jQuery(l[1]).empty();l[0].sort(o);for(var i=0;i<l[0].length;i++) l[0][i][1].appendTo(l[1]);if(l[0].length==0) jQuery('<tr><td colspan="3" class="message">none yet.</td></tr>').appendTo(l[1]);}function m(s){if('error_message' in s) jQuery('#api_error').text('API Error: '+s.error_message);}function g(p){jQuery.getJSON('//api.stackexchange.com/2.2/questions/' + QUESTION_ID + '/answers?page=' + p + '&pagesize=100&order=desc&sort=creation&site=codegolf&filter=!.Fjs-H6J36w0DtV5A_ZMzR7bRqt1e', function(s){m(s);s.items.map(function(a){var he = jQuery('<div/>').html(a.body).children().first();he.find('strike').text('');var h = he.text();if (!/cracked/i.test(h) && (typeof a.comments == 'undefined' || a.comments.filter(function(b){var c = jQuery('<div/>').html(b.body);return /^cracked/i.test(c.text()) || c.find('a').filter(function(){return /cracked/i.test(jQuery(this).text())}).length > 0}).length == 0)){var m = /^\s*((?:[^,;(\s]|\s+[^-,;(\s])+).*(0.\d+)/.exec(h);var e = [[n++, m ? m[2]-0 : null], jQuery('<tr/>').append( jQuery('<td/>').append( jQuery('<a/>').text(m ? m[1] : h).attr('href', a.link)), jQuery('<td class="score"/>').text(m ? m[2] : '?'), jQuery('<td/>').append( jQuery('<a/>').text(a.owner.display_name).attr('href', a.owner.link)) )];if(/safe/i.test(h)) safe_list.push(e);else uncracked_list.push(e);}});if (s.items.length == 100) g(p + 1);else{var s=[[uncracked_list, '#uncracked'], [safe_list, '#safe']];for(var i=0;i<2;i++) u(s[i],byscore);jQuery('#uncracked_by_score').bind('click',function(){u(s[0],byscore);return false});jQuery('#uncracked_by_creation').bind('click',function(){u(s[0],bycreation);return false});}}).error(function(e){m(e.responseJSON);});}g(1);</script><link rel="stylesheet" type="text/css" href="//cdn.sstatic.net/Sites/codegolf/all.css?v=7509797c03ea"><div id="api_error"></div><div class="main"><h3>Uncracked submissions</h3><table> <tr> <th>Language</th> <th class="score">Score</th> <th>User</th> </tr> <tbody id="uncracked"></tbody></table><div>Sort by: <a href="#" id="uncracked_by_score">score</a> <a href="#" id="uncracked_by_creation">creation</a></div></div><div class="main"><h3>Safe submissions</h3><table> <tr> <th>Language</th> <th class="score">Score</th> <th>User</th> </tr> <tbody id="safe"></tbody></table></div>
88 Answers 88
Retina, 2 bytes, 10 numbers, Cracked
_1
Works for 1 to 10, _
is a hidden character. This shouldn't be too hard, but I hope it provides a somewhat interesting puzzle. :)
-
2\$\begingroup\$ Argh, can't figure out 10 :p \$\endgroup\$LegionMammal978– LegionMammal9782016年11月12日 13:49:38 +00:00Commented Nov 12, 2016 at 13:49
-
\$\begingroup\$ @LegionMammal978 :) \$\endgroup\$Martin Ender– Martin Ender2016年11月12日 14:06:19 +00:00Commented Nov 12, 2016 at 14:06
-
2\$\begingroup\$ Cracked by FryAmTheEggman: codegolf.stackexchange.com/a/99560/32700 \$\endgroup\$TheNumberOne– TheNumberOne2016年11月12日 14:51:29 +00:00Commented Nov 12, 2016 at 14:51
Octave, 55 bytes, 10 numbers, cracked
(o__(O_o_(@(__o)o__-O}_)_(0<O,{_(_o_O-1)+1_@(_1}_)(__o_
_
is the unknown character.
Solution
(o=@(O,o)(@(O,o)o{2-O}())(0<O,{@()o(O-1)+1,@()1}))(0,o)
%then changing the very last0
to1,2,3
e.t.c.
Givenx
, this does recursively calculatex+1
. It is mainly composed of two anonymous functions. One provides anif
statement to anchor the recursion:
if_ = @( boolean, outcomes) outcomes{ 2 - boolean}();
This is just abusing the fact that a boolean values evaluates to0
or1
. This function accepts a boolean value, and a cell array of two functions, and evaluates one or the other of these two functiosn depending on the boolean value. The second part is the actual recursion:
plus_one = @(n,f) if_(0<n ,{@()f(n-1)+1, @()1})
As an anyonmous function is anonymous, you cannot directly access it from itsefl. That why we need a second argumentf
first. Later we will provide a handle to the function instelf as a second argument, so a final function would looks like so:
plus_one_final = @(n)plus_one(n,plus_one);
So in this notation my submission becomes:
(plus_one=@(n,f)(@(boolean,outcomes)outcomes{2-boolean}())(0<n,{@()f(n-1)+1,@()1}))(n,f)
I asked about recursion anchors for anonymous functions in MATLAB a while ago on stackoverflow.
-
19\$\begingroup\$ o_O O____o O_O o_O \$\endgroup\$TuxCrafting– TuxCrafting2016年11月13日 18:51:22 +00:00Commented Nov 13, 2016 at 18:51
-
\$\begingroup\$ I'm not so sure whether this is really that difficult to crack=) \$\endgroup\$flawr– flawr2016年11月13日 21:49:09 +00:00Commented Nov 13, 2016 at 21:49
-
\$\begingroup\$ Well, it sure as hell isn't easy to crack! Could maybe do it with pen and paper(!) \$\endgroup\$Stewie Griffin– Stewie Griffin2016年11月14日 22:11:34 +00:00Commented Nov 14, 2016 at 22:11
-
\$\begingroup\$ I take that as a compliment :) I think you will like my solution, but I'm not gonna reveal anything until it is cracked / it is safe. \$\endgroup\$flawr– flawr2016年11月14日 22:51:27 +00:00Commented Nov 14, 2016 at 22:51
-
4
Python 2, 9 bytes, 10 numbers, cracked
print 8/8
No hidden chars. Can you crack it without brute forcing?
Perl, 12 bytes, 10 numbers, Cracked!
Underscores represent unknown characters.
____;say__-9
Probably fairly easy, and it wouldn't surprise me if there were multiple solutions. Still, it might be fun to crack.
(The intended solution was the same as the crack. This is fundamentally just a problem about assigning 10 to a variable in four characters, which is surprisingly difficult in Perl; unlike many golfing languages, it doesn't have a variable that helpfully starts at 10.)
-
1
Perl, 46 bytes, 10 numbers, safe
The problem
__b_b_\__}_b_b_b_0_;
$b[0]=10;$b{0}=1;say$b[0]
The shorter problems tend to get cracked quickly, so I thought I'd try a longer one. The longer ones also tend to get cracked if people leave enough of a gap to sneak something naughty like say
or exit
in, so all the gaps here are short. Hidden characters are represented using _
.
My solution
sub b{\@_}*b=b$b{0};
$b[0]=10;$b{0}=1;say$b[0]
To print 2, 3, etc., up to 9, keep changing the number assigned to $b{0}
in the second line (i.e. $b{0}=2
, $b{0}=3
, etc.). The program for 9 looks like this:
sub b{\@_}*b=b$b{0};
$b[0]=10;$b{0}=9;say$b[0]
Then to produce 10, comment out the first line by prepending a #
character to it.
Explanation
The first thing to note is that the solution isn't really golfed apart from removing whitespace: if we lay it out with more readable whitespace, we get this:
sub b { \@_ }
*b = b $b{0};
$b[0] = 10;
$b{0} = 1;
say $b[0];
Normally, when you access the arguments of a subroutine in Perl, you do so via copying them out of @_
. There's a good reason for this: @_
aliases the arguments the subroutine is given (so, for example, (sub { $_[0] = 3 })->($x)
will assign to $x
), something that isn't normally desirable.
Although @_
might seem magical, it's actually just using a standard feature of the Perl internals (which is readily available from XS but only comes up in a few weird cases in pure Perl, such as @_
itself): an array doesn't store its elements directly, but rather by reference. Thus, when we call b
in the second line below, Perl generates an array (calling it @_
) whose first element is a reference to the same storage that $b{0}
uses. (Hash values are also stored by reference; $_[0] and $b{0} are both referencing the same storage at this point.) Because @_
isn't doing anything special from an internals point of view, we can take a reference to it just like we could with any other array, causing it to outlive the subroutine it's defined in.
Perl variables also refer to data storage by reference. A long time ago, people used to use code like *x = *y;
to set $x
as an alias to $y
(via making them reference the same thing), likewise @x
as an alias to @y
, %x
as an alias to %y
, and so on. That rather breaks the invariant that variables with similar names don't have to act similarly, so modern Perl provides an alternative; assigning a reference to a typeglob overrides only the variable that matches the type of the reference (so *x = \%y
would alias %x
to point to the same storage as %y
but leave, say, $x
alone). This syntax notably doesn't care about whether the storage you're aliasing to has a name, so when we assign the return value of b
(which is an array reference that's keeping the array formerly called @_
alive) to *b
, what happens is that @b
is changed to alias the argument list to the call to b
(while leaving %b
unchanged). This means, notably, that $b[0]
and $b{0}
now point to the same storage, and assigning to one will therefore change the other. Everything from then on is completely straightforward.
The Perl documentation doesn't really talk about this sort of detail, so I'm not surprised anyone got the crack; the nature of @_
as not quite being like other arrays isn't something that's really emphasised, and most coding styles aim to minimize the effects that this has rather than amplifying them.
-
1\$\begingroup\$ I'm so intrigued by this. I've learnt about pseudo-hashes and refreshed my memory on referencing and de-referencing but I can't seem to figure it out! \$\endgroup\$Dom Hastings– Dom Hastings2016年11月17日 21:42:48 +00:00Commented Nov 17, 2016 at 21:42
-
1\$\begingroup\$ @DomHastings, ... and I've been fooling around with various demarcation characters for
q
ands
andy
andm
(mostly trying to get them to end after the$b[0]
assignment), but nothing's working for me (yet). \$\endgroup\$msh210– msh2102016年11月22日 22:15:28 +00:00Commented Nov 22, 2016 at 22:15 -
\$\begingroup\$ You were both on the wrong track, but admittedly, there's not much help given by the language or by my submission as to what the right track is (I had to leave one clue to avoid leaving too large a gap, but there are plenty of reasons that a program might contain a backslash, it's not always related to references). \$\endgroup\$user62131– user621312016年11月23日 05:38:47 +00:00Commented Nov 23, 2016 at 5:38
-
\$\begingroup\$ I feel like I was frustratingly close. I had
sub b{\@_}
cemented in my mind, and, although I experimented with*b
I couldn't get it! Thanks for the explanation. I might have glossed over it in your explanation, but why doessub b{\@_}*b=b$b[0]
not do the same? \$\endgroup\$Dom Hastings– Dom Hastings2016年11月23日 07:21:18 +00:00Commented Nov 23, 2016 at 7:21 -
\$\begingroup\$ You're trying to make the array element and the hash element share memory, so you need to mention both. The array element's implicitly mentioned when you assign an array reference (
\@_
) to*b
, but you have to mention the hash element explicitly yourself. With*b=b$b[0]
, you're basically just aliasing the new$b[0]
(after changing where@b
points) to the$b[0]
that existed at the start of the program, which is useless. \$\endgroup\$user62131– user621312016年11月23日 07:29:07 +00:00Commented Nov 23, 2016 at 7:29
JavaScript, 30 bytes, 10 numbers, cracked
alert(Array(_)________.length)
Shouldn't be too hard, but hopefully it's just hard enough to provide a challenge. :) Unrevealed characters are marked with _
.
-
\$\begingroup\$ Nice one! I had a swell time solving this one, it was easy, yet challenging at the same time. \$\endgroup\$user41805– user418052016年11月12日 16:41:01 +00:00Commented Nov 12, 2016 at 16:41
Perl, 14 bytes, 10 numbers, Cracked
say_!"___"%""_
Works for 1 to 10. _
are hidden characters.
I think this shouldn't be too hard to crack. I have an harder one, for 22 bytes, I'll post it if this one is cracked.
Original code :
say"!"=~y"%""c
And replace the "!"
by a string of the length of the number you wish to print, for instance !
, !!
, !!!
, etc.
However, ais523 found another way :
say"!"+1#"%""r
-
2\$\begingroup\$ Cracked. I suspect this isn't what you were going for at all. (I was trying to do something using regex, but this was much simpler.) \$\endgroup\$user62131– user621312016年11月12日 23:06:58 +00:00Commented Nov 12, 2016 at 23:06
JavaScript, 22 bytes, 10 numbers, cracked
Probably rather easy to crack.
alert(__14_337__xc_de)
_
being a hidden character
-
1\$\begingroup\$ I'd be shocked if
xc_de
was anything but a red herring \$\endgroup\$ETHproductions– ETHproductions2016年11月13日 21:02:04 +00:00Commented Nov 13, 2016 at 21:02 -
\$\begingroup\$ Cracked! \$\endgroup\$Dom Hastings– Dom Hastings2016年11月14日 15:39:42 +00:00Commented Nov 14, 2016 at 15:39
Octave, 17 bytes, 10 numbers, Cracked
_od(3_13_13_7_1_)
Original solution
mod(3*1361357,10)
...
mod(3*1361357,17)
mod(3*1361397,17)
mod(9*1361397,17)
_
is the hidden character.
Jelly, 7 bytes, 10 numbers, cracked
"1‘ỌȮḊ‘
No wildcards.
The crack achieved (to use an eval with an argument) was, as many seem to be in this thread, not the intended one.
The intended crack was:
"1‘ỌȮḊ‘ - (prints 1)
"1‘ - code page index list of characters "1": [49]
Ọ - cast to ordinals: ['1']
Ȯ - print (with no line feed) and return input: effectively prints "1"
- (but if left at this would then implicitly print another "1")
Ḋ - dequeue: []
‘ - increment (vectorises): []
- implicit print: prints ""
"1‘ỌŒḊ‘ - (prints 2)
"1‘Ọ - as above: ['1']
ŒḊ - depth: 1
‘ - increment: 2
- implicit print: prints "2"
"1‘ỌŒḊ‘‘ - (prints 3)
"1‘ỌŒḊ‘ - as above: 2
‘ - increment: 3
- implicit print: prints "3"
... keep adding an increment operator to print 4 - 10.
-
\$\begingroup\$ I would be able to crack it if the '‘' was on the next line. So close... :) \$\endgroup\$user41805– user418052016年11月13日 08:57:02 +00:00Commented Nov 13, 2016 at 8:57
-
-
\$\begingroup\$ @Hedi Ninja'd me too quickly, I was working on it. \$\endgroup\$Erik the Outgolfer– Erik the Outgolfer2016年11月13日 18:24:00 +00:00Commented Nov 13, 2016 at 18:24
-
\$\begingroup\$ @Hedi - yours was an unintended crack. The way
10
is working for you is, I believe, by evaluating the jelly code in the string9
with an argument of0
(the default value of the input), which you then dequeue (no effect) and then increment. \$\endgroup\$Jonathan Allan– Jonathan Allan2016年11月13日 18:33:33 +00:00Commented Nov 13, 2016 at 18:33 -
\$\begingroup\$ ...actually I think the way
10
is working for you is by evaluating the jelly code in the string9
with an argument of[]
- the default value of the input,0
, dequeued - which you then increment., Like"1‘‘‘‘‘‘‘‘‘Ọv0Ḋ¤‘
\$\endgroup\$Jonathan Allan– Jonathan Allan2016年11月13日 18:41:42 +00:00Commented Nov 13, 2016 at 18:41
Befunge-93, 11 bytes, 10+ numbers, Cracked
This submission works for at least 1 - 10. Unrevealed characters are indicated with □しろいしかく
.
□しろいしかく□しろいしかく5:**-□しろいしかく-.@
I must say I was impressed that two people could come up with independent solutions for this, neither of which were what I was expecting. While Martin got there first, I'm giving the "win" to Sp3000 as their solution is more portable.
This was my intended solution though:
g45:**-2-.@
g45:**-1-.@
g45:**-1\.@
g45:**-1\+.@
g45:**-2\+.@
...
g45:**-7\+.@
Because a stack underflow in Befunge is interpreted as 0, theg
just reads from 0,0 returning the ASCII value of 'g', namely 103.45:**-
subtracts 100, giving you 3. Then2-
gives you 1.
For the third iteration, the-
(subtract) is changed to a\
(swap) instruction, so the 3 becomes the topmost stack entry. And in iteration four, a+
(add) instruction is inserted, thus adding the 3 to the 1 giving 4.
-
\$\begingroup\$ Cracked. I'm curious to see what solution you had in mind. :) \$\endgroup\$Martin Ender– Martin Ender2016年11月13日 15:29:59 +00:00Commented Nov 13, 2016 at 15:29
-
\$\begingroup\$ @MartinEnder As I commented on your answer, I'd like to leave my intended solution hidden for a while in case someone else wants to attempt a more portable solution. Is that OK? \$\endgroup\$James Holderness– James Holderness2016年11月13日 16:19:34 +00:00Commented Nov 13, 2016 at 16:19
-
\$\begingroup\$ Of course, that's fine. :) \$\endgroup\$Martin Ender– Martin Ender2016年11月13日 16:22:27 +00:00Commented Nov 13, 2016 at 16:22
-
\$\begingroup\$
"15:**-6-.@
gives 1, but I'm not sure whether the fact that"
pushes 32 on top (due to implicit spaces) is an artefact of the TIO interpreter or part of Befunge's spec, because trying a few interpreters it seems not all interpreters do that. Does your intended solution depend on this behaviour? \$\endgroup\$Sp3000– Sp30002016年11月15日 08:15:59 +00:00Commented Nov 15, 2016 at 8:15 -
\$\begingroup\$ @Sp3000 That wasn't my intended solution, but that's perfectly valid Befunge - the interpreters that don't support that are incorrect. If you post an answer with the rest of the sequence I'd definitely consider that a complete crack. \$\endgroup\$James Holderness– James Holderness2016年11月15日 11:48:02 +00:00Commented Nov 15, 2016 at 11:48
R, 21 bytes, 10 numbers Cracked
__i___________i______
Works for 10 numbers. _
is hidden character.
Original solution:
which(letters%in%"a")
which(letters%in%"b")
etc.
-
\$\begingroup\$ @StewieGriffin This is my first post on this site and I don't know the norms. I have one more R challenge - a bit trickier, I think. Can I add another answer? Or append it to this one? \$\endgroup\$Gregor Thomas– Gregor Thomas2016年11月14日 22:51:22 +00:00Commented Nov 14, 2016 at 22:51
-
\$\begingroup\$ Adding a new one it's perfectly fine (as a separate one) 😊 welcome to the site 😊 \$\endgroup\$Stewie Griffin– Stewie Griffin2016年11月14日 23:04:43 +00:00Commented Nov 14, 2016 at 23:04
-
-
\$\begingroup\$ @Tensibai Cracked :) \$\endgroup\$Gregor Thomas– Gregor Thomas2016年11月15日 18:07:17 +00:00Commented Nov 15, 2016 at 18:07
Octave, 32 bytes, 10 numbers. Cracked
_n_(isprime(floor(s____i__ i____
_
is a hidden character.
You can try Octave online here.
Original solution:
1: nnz(isprime(floor(sqrt(i):pi')))
2: nnz(isprime(floor('sqrt(i):pi')))
3: nnz(isprime(floor('sqrt(i):pia')))
4: nnz(isprime(floor('sqrt(i):piaa')))
...
-
\$\begingroup\$ Very nice! Cracked. Not sure if I reproduced your code though? \$\endgroup\$Stewie Griffin– Stewie Griffin2016年11月12日 16:50:08 +00:00Commented Nov 12, 2016 at 16:50
-
\$\begingroup\$ @StewieGriffin Well done! I should have revealed more characters... :-D \$\endgroup\$Luis Mendo– Luis Mendo2016年11月12日 16:55:35 +00:00Commented Nov 12, 2016 at 16:55
-
1\$\begingroup\$ Damn that was clever :) Too bad you couldn't say it was MATLAB... One more character would probably have made it much harder... I enjoyed it though... I used a full 25 minutes :) \$\endgroup\$Stewie Griffin– Stewie Griffin2016年11月12日 16:59:25 +00:00Commented Nov 12, 2016 at 16:59
-
\$\begingroup\$ @Stewie Yes, you made good use of non-Matlab features! :-) \$\endgroup\$Luis Mendo– Luis Mendo2016年11月12日 17:08:15 +00:00Commented Nov 12, 2016 at 17:08
Octave, 17 bytes, 10 numbers, Cracked
_i_(__i__(2_5_))
Unrevealed characters are marked with _
.
Intended solution:
fix(asind(2/59)) fix(asind(3/59)) fix(asind(4/59)) fix(asind(5/59)) fix(asind(6/59)) fix(asind(7/59)) fix(asind(8/59)) fix(asind(9/59)) fix(asind(9/55)) fix(asind(9/50))
-
-
\$\begingroup\$ Nice, added my approach in a spoiler tag :) \$\endgroup\$Stewie Griffin– Stewie Griffin2016年11月12日 23:05:13 +00:00Commented Nov 12, 2016 at 23:05
-
2\$\begingroup\$ Oh your solution is really clever!!! \$\endgroup\$flawr– flawr2016年11月12日 23:08:46 +00:00Commented Nov 12, 2016 at 23:08
Octave, 19 bytes, 10 numbers, cracked
__sca__1_)___'-_6_'
_
is the hidden character.
Intended solution:
pascal(10)('a'-96)'
-
1\$\begingroup\$ Cracked \$\endgroup\$Luis Mendo– Luis Mendo2016年11月13日 03:49:53 +00:00Commented Nov 13, 2016 at 3:49
-
\$\begingroup\$ I couldn't remember any function with
sca
. Coming from you, I should have thought of matrix functions :-) \$\endgroup\$Luis Mendo– Luis Mendo2016年11月13日 14:51:52 +00:00Commented Nov 13, 2016 at 14:51 -
\$\begingroup\$ There is a reason why I made a complete list of Octave function names =) \$\endgroup\$flawr– flawr2016年11月13日 19:38:11 +00:00Commented Nov 13, 2016 at 19:38
05AB1E, 5 bytes, 10 numbers, cracked!
Not very hard, but a fun one :)
_[==_
_
is a random character. Uses the CP-1252 encoding. Try it online!
-
\$\begingroup\$ I could almost get it to work, but then it enters an infinite loop... \$\endgroup\$user41805– user418052016年11月13日 16:32:54 +00:00Commented Nov 13, 2016 at 16:32
-
-
\$\begingroup\$ @daHugLenny Hahaha, that's neat! I didn't think of that :). \$\endgroup\$Adnan– Adnan2016年11月13日 17:11:54 +00:00Commented Nov 13, 2016 at 17:11
05AB1E, 6 bytes, 10 numbers, cracked
Attempt 2, this time without the three-char string :p.
_ [==_
_
is a random character. Uses the CP-1252 encoding. Try it online!
-
1
-
\$\begingroup\$ @milk Nice, that was the intended solution :) \$\endgroup\$Adnan– Adnan2016年11月13日 18:56:29 +00:00Commented Nov 13, 2016 at 18:56
JavaScript, 22 bytes, 10 numbers, cracked
alert(0_6_4_>_0_2_0_7)
_
is the hidden character.
Hint about the intended solution
The character that needs to be changed to generate all numbers is always the same.
JavaScript 21 Bytes, 10 Numbers Cracked
alert(b_oa_"3____1"))
Unrevealed characters are marked with _
My Version:
alert(btoa|"3"&("1"))
alert(btoa|"3"^("1"))
alert(btoa|"3"^("0"))
alert(btoa|"3"^("7"))
alert(btoa|"2"^("7"))
alert(btoa|"1"^("7"))
alert(btoa|"0"^("7"))
alert(btoa|"0"^("8"))
alert(btoa|"0"^("8"))
alert(btoa|"2"^("8"))
Python 3, 19 bytes, 10 numbers, cracked
print(??bin()?????)
Unrevealed characters are marked with ?
. Tested in Python 3.5.2.
Python 3, 16 bytes, 10 numbers, cracked
print(?%??f?r?t)
Unrevealed characters are marked with ?
. This is probably a bit easy since there's only five question marks, but I'm hoping it'll be a fun one.
C#, 90 bytes, 10 numbers, cracked
using ______________________________________________;class C{static void Main(){_______;}}
I honestly have no idea how hard this is to crack.
Edit: Oops, transcription error. One _
too few after using
.
Now cracked by Hedi, who found the intended (barring the class name) solution.
-
\$\begingroup\$ d'oh... one too short for write() \$\endgroup\$masterX244– masterX2442016年11月14日 13:19:56 +00:00Commented Nov 14, 2016 at 13:19
-
\$\begingroup\$ Didnt help... wrong gap. And that semicolon after first gap thwarted amother idea \$\endgroup\$masterX244– masterX2442016年11月14日 19:19:12 +00:00Commented Nov 14, 2016 at 19:19
-
JavaScript 33 Bytes, 10 Numbers Cracked x2
Oops I post posted my line for generating 10 Which Hedi cracked as though it was for 1
alert(_to__"_Xc0__0_B6____Zp=="))
Version intended to post for generating 1
alert(_to__"_Xc0__0_Bf____Zp=="))
Unrevealed characters are marked with _
alert(btoa|"0Xc0"-0xBf|!("Zp=="))
alert(btoa|"0Xc0"-0xBe|!("Zp=="))
alert(btoa|"0Xc0"-0xBd|!("Zp=="))
alert(btoa|"0Xc0"-0xBc|!("Zp=="))
alert(btoa|"0Xc0"-0xBb|!("Zp=="))
alert(btoa|"0Xc0"-0xBa|!("Zp=="))
alert(btoa|"0Xc0"-0xB9|!("Zp=="))
alert(btoa|"0Xc0"-0xB8|!("Zp=="))
alert(btoa|"0Xc0"-0xB7|!("Zp=="))
alert(btoa|"0Xc0"-0xB6|!("Zp=="))
-
1
-
\$\begingroup\$ I added a crack for the intended version. I'll try to find a way to get to your solution for 10:
console.log(atob|"0Xc0"-0xB6|("Zp=="))
I think \$\endgroup\$Hedi– Hedi2016年11月16日 22:18:37 +00:00Commented Nov 16, 2016 at 22:18 -
Python, 10+ numbers, 61 bytes, Cracked!
Here was the code I posted:
try:x
except:print(__import__('sys').??c??n??()[????b????e???
The original code was:
try:x
except:print(__import__('sys').exc_info()[2].tb_lineno)
Basically, it throws an error ('x' is not defined
) and then prints the line the error was found on. So, just keep adding newlines at the beginning to increment the number.
I knew it wouldn't be hard to crack - I just wanted a funny way to print numbers - but I wasn't expecting Sp3000 to get it so fast, that's some pro skills!
-
-
\$\begingroup\$ @Sp3000 yeah, I wanted to make sure nobody could squeeze in deleting what's on
STDOUT
and printing a number, but I guess I narrowed it down too much. Ah well. \$\endgroup\$FlipTack– FlipTack2016年11月20日 10:35:22 +00:00Commented Nov 20, 2016 at 10:35 -
\$\begingroup\$ Revealing
sys
definitely made it a lot simpler, since it gave a nice starting point for searching :P \$\endgroup\$Sp3000– Sp30002016年11月20日 10:37:01 +00:00Commented Nov 20, 2016 at 10:37
Hexagony, 18 Bytes, 10 numbers, SAFE
This submission works for 1 - 10. Unrevealed characters are indicated with an underscore: _
.
.__{_]5[$@.;=@$!!1
You can try Hexagony online over here.
My solution:
1: .<[{8]5[$@.;=@$!!10
2: .<[{8]5[$@);=@$!!10
3: 2<[{8]5[$@);=@$!!10
4: 3<[{8]5[$@);=@$!!10
5: 4<[{8]5[$@);=@$!!10
6: 5<[{8]5[$@);=@$!!10
6: 7<[{8]5[$@);=@$!!10
8: 7<[{8]5[$@);=@$!!10
9: 8<[{8]5[$@);=@$!!10
10: 9<[{8]5[$@);=@$!!10
Hex for output 1:
Full Hex:
. < [
{ 8 ] 5
[ $ @ . ;
= @ $ !
! 1 0
Important parts:
. < .
. 8 . 5
. $ @ . ;
. . $ .
. 1 .
- At the
<
the memory edge is0
, so it turns up. - Hits
1
- Jumps to
5
- Jumps over
8
, but is reversed at<
and gets the8
on the way back. - Hits
5
again - Jumps over
1
- Hits the
<
at this point, the memory value is 1585 which, mod 256, happens to be ASCII1
- Finally prints and exits with
;@
.
Hex for output 2:
Important parts:
. < .
. 8 . 5
. $ @ ) ;
. . $ .
. 1 .
This follows the same path, but on the way back it hits a )
which increments the memory edge to 1586, or 2
.
Hex for output 3-9:
Important parts:
2 < [
. . ] .
. $ . ) .
. @ . !
. 1 .
- Hits the
2
- Now the memory edge is positive when it gets to
<
, so it turn down. - The
]
changes the instruction pointer, but is immediately comes back with[
)
increments to3
!
Prints3
$
is left over from the first two numbers so we jump over the end (@
)1
changes the memory edge, but that doesn't matter now.<
reflects the pointer back.- Again
1
doesn't matter because we hit@
to end the program.
05AB1E, 11 bytes, Cracked!
3628801__0_
Works from 1-10. _
is a hidden character.
Intended Solution:
3628801R¬0+ # 1
3628801R¬1+ # 2
3628801R¬2+ # 3
3628801R¬3+ # 4
3628801R¬4+ # 5
3628801R¬5+ # 6
3628801R¬6+ # 7
3628801R¬7+ # 8
3628801R¬8+ # 9
3628801R¬9+ # 10
Octave, 24 bytes, 9 numbers, cracked
_a__repmat(__one___,__)_
_
is a hidden character.
(Inspired by @LuisMendo's challenge.)
-
\$\begingroup\$ Oh you're way too quick!!! \$\endgroup\$flawr– flawr2016年11月12日 22:13:41 +00:00Commented Nov 12, 2016 at 22:13
-
\$\begingroup\$ Cracked \$\endgroup\$ETHproductions– ETHproductions2016年11月12日 22:26:11 +00:00Commented Nov 12, 2016 at 22:26
-
\$\begingroup\$ @StewieGriffin Sorry!! Only 9. My mistake. I'm really sorry. Edited \$\endgroup\$Luis Mendo– Luis Mendo2016年11月12日 21:29:35 +00:00Commented Nov 12, 2016 at 21:29
-
-
1\$\begingroup\$ Sorry =P I'm gonna post a replacement=) \$\endgroup\$flawr– flawr2016年11月12日 21:45:28 +00:00Commented Nov 12, 2016 at 21:45
-
\$\begingroup\$ @Stewie It's been my fault, sorry! I'll post a modified version later, since my original solution is different \$\endgroup\$Luis Mendo– Luis Mendo2016年11月12日 21:46:16 +00:00Commented Nov 12, 2016 at 21:46
-
\$\begingroup\$ For the record, my crack was identical to flawr's. I've posted another Octave one here. \$\endgroup\$Stewie Griffin– Stewie Griffin2016年11月12日 21:58:23 +00:00Commented Nov 12, 2016 at 21:58
1
, how can I prevent the robbers from adding)
repeatedly to generate the rest of the numbers? The same would be valid for quite a few languages \$\endgroup\$1
then it appears CJam is a bad choice of language for this challenge. There's no way to prevent robbers from doing that. \$\endgroup\$10
. That rule is in place because many submissions can probably be extended to infinity (in theory), so scoring based on the highest achieved number wouldn't make sense. \$\endgroup\$cracked
in some form. This is what the redesign userscript currently does. \$\endgroup\$