Code ladder, Robbers

24

2

This is the robbers' thread. The cops' thread goes here.

Write a code that has the same number of bytes as the cop post and where the revealed characters are identical. The code must produce 1 in its initial state, and produce the numbers 2, 3 .. when single alterations are made.

The winner will be the robber that cracked the most posts.

Example post:

MyLang, 9 bytes, 8 numbers (including link to answer), Cop's username.

Original code:

abc1efghi

Code that produces 1 - 8:

1: abc1efghi
2: abc2efghi
3: abc2efghij
4: kbc2efghij
5: kbc23fghij
6: kbc23fghi
7: kbc63fghi
8: kbc63fhi

Explanations are encouraged. The exact format of the robber post is optional.

Stewie Griffin

Posted 2016-11-12T12:45:00.623

Reputation: 43 471

Answers

13

Retina, 2 bytes, 10 numbers, by Martin Ender.

Original code:

1

This replaces the empty input by the number 1.

Code that produces 1 - 10 (showing newlines as \n for convenience):

1 : \n1
2 : \n1\n
3 : \n11\n
4 : \n111\n
5 : \n1111\n
6 : \n11111\n
7 : \n111111\n
8 : \n1111111\n
9 : \n11111111\n
10: \n111111111\n

For 2 and onwards, we count the number of empty strings in the previous stage. For 2, there is an empty string before and after the 1. For 3 there is an empty string before the ones, in between the ones and after the ones. This works all the way up to 10.

Try it online

FryAmTheEggman

Posted 2016-11-12T12:45:00.623

Reputation: 16 206

8

Perl, 12 bytes, 10 numbers, by ais523

Original code:

____;say__-9

Code that produces 1 - 10:

wait;say$!-9
wait;say$!-8
wait;say$!-7
wait;say$!-6
wait;say$!-5
wait;say$!-4
wait;say$!-3
wait;say$!-2
wait;say$!-1
wait;say$!-0

Explanation:

wait;         # waits for a child process to end (there is no child so it just returns)
     say      # put the following on the screen:
        $!    # current value of the C errno. In this case, ECHILD (No child processes)
              # which has a value of 10
          -9  # minus 9

Riley

Posted 2016-11-12T12:45:00.623

Reputation: 11 345

7

Python 2, 9 bytes, 10 numbers, xnor

print 8/8
print 18/8
print 28/8
print 38/8
print 38/7
print 38&7
print 31&7
print 31&72
print 31&73
print 31&74

Sp3000

Posted 2016-11-12T12:45:00.623

Reputation: 58 729

1Congrats! That's the one I thought of too. I was curious and ran a search. It turns out there are many solutions, including ones that don't use bitwise operations. – xnor – 2016-11-16T11:27:48.683

print 10/10 is quite an interesting one if you ban &, according to the tree search. Or, if you require going to 11. – xnor – 2016-11-16T11:39:26.967

7

JavaScript, 30 bytes, 10 numbers, by ETHproductions.

Original code:

1: alert(Array(2).join(3).length)

Other numbers

 2: alert(Array(2).join(31).length)
 3: alert(Array(2).join(314).length)
 4: alert(Array(2).join(3141).length)
 5: alert(Array(2).join(31415).length)
 6: alert(Array(2).join(314159).length)
 7: alert(Array(2).join(3141592).length)
 8: alert(Array(2).join(31415926).length)
 9: alert(Array(2).join(314159265).length)
10: alert(Array(2).join(3141592653).length)

Explanation

Array(2) creates an Array with two empty cells. The .join method joins all the elements in an Array using a delimiter, which converts it into a String. In the Original Code, the delimiter was 3. This meant that the two empty cells in the Array are joined together used 3 as their delimiter. This evaluates "3", without anything on either side of the 3 because the Array is empty. And since the length of "3" is 1, this value is outputted to the console.

For the other numbers, I add 1 more digit to the delimiter that is joining the elements of the Array. Hence, this increases its length, thus alerting with increasing values. Note that the numerical value of the delimiter is not important, only its length is.

Snack Snippet!

Note: I used console.log instead of alert in my Snack Snippet for obvious reasons. Also, output from the console is display in the snippet.

console.log(Array(2).join(3).length)
console.log(Array(2).join(31).length)
console.log(Array(2).join(314).length)
console.log(Array(2).join(3141).length)
console.log(Array(2).join(31415).length)
console.log(Array(2).join(314159).length)
console.log(Array(2).join(3141592).length)
console.log(Array(2).join(31415926).length)
console.log(Array(2).join(314159265).length)
console.log(Array(2).join(3141592653).length)

user41805

Posted 2016-11-12T12:45:00.623

Reputation: 16 320

1Nice! That was the intended solution (although I wasn't as imaginative with the joining number ;) ) – ETHproductions – 2016-11-12T16:27:58.263

7

Octave, 17 bytes, 10 numbers, by Stewie Griffin

original:
_i_(__i__(2_5_))

solution:
fix( 'i'-(2*52))
fix( 'j'-(2*52))
fix( 'k'-(2*52))
fix( 'l'-(2*52))
fix( 'm'-(2*52))
fix( 'n'-(2*52))
fix( 'o'-(2*52))
fix( 'p'-(2*52))
fix( 'q'-(2*52))
fix( 'r'-(2*52))

flawr

Posted 2016-11-12T12:45:00.623

Reputation: 40 560

Hah, far from my solution! Well done! :) I'll post the intended one in my post :) – Stewie Griffin – 2016-11-12T23:03:41.067

7

Python 2, 17 bytes, 10 numbers, by xnor

print len(['  '])
print len(*['  '])
print len(*['   '])
print len(*['    '])
print len(*['     '])
print len(*['      '])
print len(*['       '])
print len(*['        '])
print len(*['         '])
print len(*['          '])

repl.it

Jonathan Allan

Posted 2016-11-12T12:45:00.623

Reputation: 67 804

6

Perl, 14 bytes, 10 numbers, by Dada

Original code:

say_!"___"%""_

Code that produces 1 - 10:

  1. say"!"+1#"%""r
  2. say"!"+2#"%""r
  3. say"!"+3#"%""r
  4. say"!"+4#"%""r
  5. say"!"+5#"%""r
  6. say"!"+6#"%""r
  7. say"!"+7#"%""r
  8. say"!"+8#"%""r
  9. say"!"+9#"%""r
  10. say"1"+9#"%""r

I have a feeling this isn't what you were going for.

user62131

Posted 2016-11-12T12:45:00.623

Reputation:

1I should have more letters... The original code was say"!"=~y"%""c (so say"!!"=~y"%""c, etc, with one more ! each time). But well played! :) – Dada – 2016-11-12T23:09:57.957

Right, there was enough of a gap to sneak an integer constant into the middle and comment out the rest of the line. That seems dangerous in a challenge like this one. – None – 2016-11-12T23:12:48.017

1I didn't want to give to much information : = or ~ would have been a huge hint, and the structure of the " as I showed them was misleading (I hope)... But I should have consider that commenting half of it was doable! – Dada – 2016-11-12T23:16:32.470

I'd actually guessed that there was an =~ in the intended solution. However, I was busy trying s, m and / and didn't think of y. – None – 2016-11-12T23:19:08.190

1Welcome on PPCG btw! Nice to see new perl golfers! – Dada – 2016-11-12T23:31:54.997

6

JavaScript, 22 bytes, 10 numbers, by Arnauld

Original program:

alert(0_6_4_>_0_2_0_7)

Cracked:

  1. alert(0+6^42>101210^7)
  2. alert(0+5^42>101210^7)
  3. alert(0+4^42>101210^7)
  4. alert(0+3^42>101210^7)
  5. alert(0+2^42>101210^7)
  6. alert(0+1^42>101210^7)
  7. alert(0+0^42>101210^7)
  8. alert(0+0^42>101210^8)
  9. alert(0+0^42>101210^9)
  10. alert(0+3^42>101210^9)

The hard part is to deal with the >, which has a very low precedence. I tried changing it to an >>, but it's easiest to just absorb it by making it uselessly calculate a boolean false (the 42>101210 section) which is numerically 0, and just generate the numbers from 1 to 10 with operators with an even lower precedence than >. I used ^, bitwise xor, because it can generate the numbers from 1 to 10 fairly easily (conveniently, the 6 and 7 in the original input let me simplify the expression down to 6^7 which is 1).

user62131

Posted 2016-11-12T12:45:00.623

Reputation:

5

JavaScript, 9 bytes, Hedi

Original code:

alert(+1)

Modifications:

alert(1+1)   // 2
alert(2+1)   // 3
alert(3+1)   // 4
alert(4+1)   // 5
alert(5+1)   // 6
alert(6+1)   // 7
alert(7+1)   // 8
alert(8+1)   // 9
alert(9+1)   // 10

ETHproductions

Posted 2016-11-12T12:45:00.623

Reputation: 47 880

5

JavaScript, 22 bytes, 10 numbers by Arnauld

Original code:

alert(__14_337__xc_de)

Modified:

alert(00140337-0xc0de) // 1
alert(00140337-0xc0dd) // 2
alert(00140337-0xc0dc) // 3
alert(00140337-0xc0db) // 4
alert(00140337-0xc0da) // 5
alert(00140337-0xc0d9) // 6
alert(00140337-0xc0d8) // 7
alert(00140337-0xc0d7) // 8
alert(00140337-0xc0d6) // 9
alert(00140337-0xc0d5) // 10

I'm guessing this isn't the intended solution, but I'm hoping it's not too far off...

Dom Hastings

Posted 2016-11-12T12:45:00.623

Reputation: 16 415

That's the intended solution indeed. Well done! – Arnauld – 2016-11-14T15:45:28.463

2It really should have been alert(0140337-0xc0de) (one byte shorter) but I mistakenly used the ES6 octal notation 0o140337 and decided to let it that way. – Arnauld – 2016-11-14T15:52:19.197

@Arnauld I'm glad I was able to get the 'right' solution! Thanks for the challenge! – Dom Hastings – 2016-11-14T18:01:57.360

5

Octave, 55 bytes, 10 numbers, flawr

(o=@(O,o)(@(O,o)o{2-O} ) (0<O,{ (yo=O-1)+1,@()1}))(1,o)

The final 1 can be cycled up to 9, and then change the +1 to +2.

feersum

Posted 2016-11-12T12:45:00.623

Reputation: 29 566

Good job, did you perhaps find my post about this on SO? :) – flawr – 2016-11-15T09:42:30.010

@flawr Hmm? About what? – feersum – 2016-11-15T16:59:29.590

Oh, I see you've written something about recursive functions in the original post. My crack doesn't use any recursion. – feersum – 2016-11-15T19:16:27.567

Oh now I see, I wasn't even able to tell the difference at first glance ^^ – flawr – 2016-11-15T19:21:36.067

5

Python 3, 16 bytes, 10 numbers, by Sp3000

This was fun.

print(?%??f?r?t)

print(1%0xfor t)
print(2%0xfor t)
...
print(8%0xfor t)
print(84%0xfor t)
print(85%0xfor t)

Exploits the fact (which I didn't know till now) that a hex literal ends as soon as a character that isn't 0-9a-fA-F is encountered--thus 0xfor is a very sneaky way to write 15 or. After that, it was a matter of finding the right value congruent to 10 modulo 15.

DLosc

Posted 2016-11-12T12:45:00.623

Reputation: 21 213

Fast :P But at least it should be obvious now how the bin() one was intended to be solved too.

– Sp3000 – 2016-11-15T06:32:34.230

4

Ruby, 81 bytes, 10 numbers, histocrat

Original code:

x=##/=#%#
)
###x

Cracked:

x=/$/=~%q
)

p x

This was a tricky one. Many characters that were revealed turned out to be red herrings! / isn't division but part of a regex literal. % isn't mod but part of an uncommon string literal syntax. This program simply prints the length of a string delimited by newlines. The subsequent programs can be obtained by inserting additional characters in the second line.

xsot

Posted 2016-11-12T12:45:00.623

Reputation: 5 069

This is very similar to my intended solution, but mine doesn't use p-~x. Can you point to a Ruby version where that's interpreted correctly? In the two I have locally, p~-x works, but p-~x is interpreted as p()-~x causing an undefined method '-' for nil error. – histocrat – 2016-11-17T16:34:16.227

@histocrat Thanks for pointing that out. I assumed it would work and did not test it. Hopefully this edit is what you had in mind. – xsot – 2016-11-17T23:44:14.717

Even closer, but that prints 0 unmodified. There's one last trick left to find. – histocrat – 2016-11-18T02:10:19.777

@histocrat I think I finally figured it out. – xsot – 2016-11-18T04:28:49.103

Ding! Well done :) – histocrat – 2016-11-18T04:45:34.110

4

Octave, 32 bytes, 10 numbers, by Luis Mendo

Original code:

nnz(isprime(floor(s=3):i*-2i))+1

Modified codes:

2:  nnz(isprime(floor(s=3):i*-3i))+1
3:  nnz(isprime(floor(s=3):i*-5i))+1
4:  nnz(isprime(floor(s=3):i*-9i))+1
5:  nnz(isprime(floor(s=3):i*-9i))+2
6:  nnz(isprime(floor(s=3):i*-9i))+3
7:  nnz(isprime(floor(s=3):i*-9i))+4
8:  nnz(isprime(floor(s=3):i*-9i))+5
9:  nnz(isprime(floor(s=3):i*-9i))+6
10: nnz(isprime(floor(s=3):i*-9i))+7

There are many ways to make modifications here (for instance s=2 and +0 in the beginning).

Edit: A more probable alternative:

nnz(isprime(floor(s=2):i*-2i))+0
nnz(isprime(floor(s=2):i*-2i))+1
nnz(isprime(floor(s=2):i*-2i))+2
nnz(isprime(floor(s=2):i*-2i))+3
nnz(isprime(floor(s=2):i*-2i))+4
nnz(isprime(floor(s=2):i*-2i))+5
nnz(isprime(floor(s=2):i*-2i))+6
nnz(isprime(floor(s=2):i*-2i))+7
nnz(isprime(floor(s=2):i*-2i))+8
nnz(isprime(floor(s=2):i*-2i))+9

Stewie Griffin

Posted 2016-11-12T12:45:00.623

Reputation: 43 471

4

05AB1E, 11 bytes, 10 numbers, by Oliver

Original code:

 1: 3628801zï0>

Other numbers

 2: 3628801zï0>>
 3: 3628801zï0>>>
 4: 3628801zï0>>>>
 5: 3628801zï0>>>>>
 6: 3628801zï0>>>>>>
 7: 3628801zï0>>>>>>>
 8: 3628801zï0>>>>>>>>
 9: 3628801zï0>>>>>>>>>
10: 3628801zï0>>>>>>>>>>

Explanation

3628801                        # push this number
       z                       # find its reciprocal
        ï                      # round it to the nearest integer (becomes 0)
         0                     # push 0
          >>>>                 # increment by 1 for each `>` present (this is for 4)
                               # implicit output

To summarise it, push 3628801, take its reciprocal and round that to the nearest integer (evaluates to 0). Then increment the stack. TADA!

Try it online! For output = 1 Then add as many >s as you want depending on what number you want to output.

user41805

Posted 2016-11-12T12:45:00.623

Reputation: 16 320

4

JavaScript, 12 bytes, 10 numbers, Hedi

Original code:

alert(+[+1])

2 through 10:

alert(+[1+1])
alert(+[2+1])
alert(+[3+1])
alert(+[4+1])
alert(+[5+1])
alert(+[6+1])
alert(+[7+1])
alert(+[8+1])
alert(+[9+1])

There's only so much you can do with this much code...

ETHproductions

Posted 2016-11-12T12:45:00.623

Reputation: 47 880

1'There's only so much you can do with this much code...' yet you found a solution I didn't think of ^^' The solution I had don't need +. – Hedi – 2016-11-13T10:12:11.243

4

Jelly, 7 bytes, 10 numbers, Jonathan Allan

Original code:

“1‘ỌȮḊ‘

Then:

“1‘‘ỌȮḊ‘
“1‘‘‘ỌȮḊ‘
“1‘‘‘‘ỌȮḊ‘
“1‘‘‘‘‘ỌȮḊ‘
“1‘‘‘‘‘‘ỌȮḊ‘
“1‘‘‘‘‘‘‘ỌȮḊ‘
“1‘‘‘‘‘‘‘‘ỌȮḊ‘
“1‘‘‘‘‘‘‘‘‘ỌȮḊ‘
“1‘‘‘‘‘‘‘‘‘ỌvḊ‘

You can check the last one on TryItOnline!


Another way would be
“2‘ỌȮḊ‘
“3‘ỌȮḊ‘
...
“9‘ỌȮḊ‘
“9‘ỌvḊ‘

Hedi

Posted 2016-11-12T12:45:00.623

Reputation: 1 857

4

Octave, 21 bytes, 10 numbers, by Stewie Griffin

The fpr was a nice misguidance=) But I love the (1') -> 2(1') -> 2+(1') sequence!

original:
disp(fpr___f__e_(_'_)     % original
disp(fprintf= e=(1'))     % my solution
disp(fprintf= e=2(1'))
disp(fprintf= e=2+(1'))
disp(fprintf= e=3+(1'))
disp(fprintf= e=4+(1'))
disp(fprintf= e=5+(1'))
disp(fprintf= e=6+(1'))
disp(fprintf= e=7+(1'))
disp(fprintf= e=8+(1'))
disp(fprintf= e=9+(1'))

flawr

Posted 2016-11-12T12:45:00.623

Reputation: 40 560

That sequence is a nice trick indeed! – Luis Mendo – 2016-11-14T15:57:42.303

4

Hexagony, 7 bytes, 10 numbers, by Martin Ender

Original:

1<@|!__

Code that produces 1 - 10:

1<@|!).
2<@|!).
3<@|!).
4<@|!).
5<@|!).
6<@|!).
7<@|!).
8<@|!).
9<@|!).
9<@|!).!

1: Try it Online!
9: Try it Online!
10: Try it Online!

Here is the hex for the first 9 programs (where # is the number that you want to print):

 # <
@ | !
 ) .

The memory edge is just set to the value you want to print, deflected to the SE and printed.

And the hex for 10:

  9 < @
 | ! ) .
! . . . .
 . . . .
  . . . 

Here, I added a character to the end which increased the hex size. First, the memory edge is set to 9, the pointer is deflected to the SE, memory is incremented, wraps around, the pointer is deflected to the SW, the value is printed and the program ends.


Here is a second solution:

1<@|!$)
2<@|!$)
3<@|!$)
...
8<@|!$)
9<@|!$)
9#@|!$)

1: Try it Online!
9: Try it Online!
10: Try it Online!

The hex for 1 - 9 (this time * is the number to print):

 * <
@ | !
 $ )

This works the same as 1 - 9 above.

The hex for 10:

 9 #
@ | !
 $ )

This hits 9 then # switched the instruction pointer to the lower right one, memory is incremented to 10, $ jumps over the !, the pointer is reversed back east where it jumps over ) and ends.

Riley

Posted 2016-11-12T12:45:00.623

Reputation: 11 345

1That's amazing. :D I was trying to design a cop where those two solutions (going to side-length 3 and using # on 9) were possible but always ended up with cops that also had boring shortcuts. I was looking for ages whether there was a way to make the # solution work with the | in the centre but didn't find one. Nice work on sorting that out anyway! :) – Martin Ender – 2016-11-14T19:22:52.890

4

C#, 90 bytes, 10 numbers, Scepheo

Original:

using ______________________________________________;class C{static void Main(){_______;}}

First:

using System;class D{public D(){Console.Write(+1);}};class C{static void Main(){new D();}}

Then:

using System;class D{public D(){Console.Write(1+1);}};class C{static void Main(){new D();}}
using System;class D{public D(){Console.Write(2+1);}};class C{static void Main(){new D();}}
using System;class D{public D(){Console.Write(3+1);}};class C{static void Main(){new D();}}
using System;class D{public D(){Console.Write(4+1);}};class C{static void Main(){new D();}}
using System;class D{public D(){Console.Write(5+1);}};class C{static void Main(){new D();}}
using System;class D{public D(){Console.Write(6+1);}};class C{static void Main(){new D();}}
using System;class D{public D(){Console.Write(7+1);}};class C{static void Main(){new D();}}
using System;class D{public D(){Console.Write(8+1);}};class C{static void Main(){new D();}}
using System;class D{public D(){Console.Write(9+1);}};class C{static void Main(){new D();}}

Hedi

Posted 2016-11-12T12:45:00.623

Reputation: 1 857

That's exactly the intended solution. Nice work. – Scepheo – 2016-11-15T22:44:08.763

... tried the same but had a weird compiler error on ideone... knew it was something obvious... – masterX244 – 2016-11-16T07:25:27.573

3

Python 2, 111 bytes, 10 numbers, feersum

Original, then the program for 1:

print +int('''3EE5EE6EE0EE2EE5EE6EE4EE9EE1EE5EE9EE4EE6EE7EE5EE7E''')%int('''2EE0EE9EE8EE9EE2EE3EE5EE0EE3EE6''')
print +int('''39951562603020050069949998519154798549467371659275''')%int('''2000009008009002\x3005000\x3006''')

The other programs are just appending 1-9 before the +. With numbers of this size the problem is fairly simple, since we have a lot of freedom in the lower digits of the larger number. To make things a bit easier, a few of the 3s in the modulus have been turned into \x30, which is the code point for 0.

Sp3000

Posted 2016-11-12T12:45:00.623

Reputation: 58 729

3

Perl, 31 bytes, 10 numbers, by Gabriel Benamy

I'm pretty sure this is the intended answer this time (up to trivial variations, such as using '<' rather than "<").

Original code (must be saved to a file and run via giving the file at the command line, it doesn't matter what the name is):

__e_$a,_<__$_;1 while_$a_;say$_

Crack for 1:

open$a,"<",$0;1 while<$a>;say$.

To crack for the other values, append a newline to the file each time (e.g. the above prints 2 with one newline appended, 3 with two newlines appended, and so on). The program works by reading its own source code from disk (this isn't a quine competition, so you're allowed to do that!) and printing the line number of the line just beyond the end.

I found this via deducing that it probably started with a keyword or built-in function with a four letter name, and searching the list of keywords and builtin functions for functions matching ..e.. As soon as you realise that open is a possibility, everything is straightforward from there (the unknown character before the final semicolon is in retrospect very suspicious).

user62131

Posted 2016-11-12T12:45:00.623

Reputation:

1Yes! This was it all along! – Gabriel Benamy – 2016-11-17T15:45:39.330

3

Octave, 25 bytes, 10 numbers, by Luis Mendo

mean(repmat(1,ones(1,1)))
mean(repmat(2,ones(1,1)))
mean(repmat(3,ones(1,1)))
mean(repmat(4,ones(1,1)))
mean(repmat(5,ones(1,1)))
mean(repmat(6,ones(1,1)))
mean(repmat(7,ones(1,1)))
mean(repmat(8,ones(1,1)))
mean(repmat(9,ones(1,1)))

flawr

Posted 2016-11-12T12:45:00.623

Reputation: 40 560

New iteration here

– Luis Mendo – 2016-11-13T03:40:32.087

3

아희(Aheui), 19 bytes, 10 numbers, by JHM

Original code:

봃法희
반자뭉

Modified:

2
봃法희
반반뭉
3
봃法희
반밬뭉
4
봃法희
반밭뭉
5
봃法희
반발뭉
6
봃法희
반타뭉
7
봃法희
반밝뭉
8
봃法희
반밣뭉
9
봃法희
반밢뭉
10
봃法희
반다뭉

jimmy23013

Posted 2016-11-12T12:45:00.623

Reputation: 34 042

3

Acc!!, 10 bytes, 9 numbers, by DLosc

Original code :

Write 49+_

To produce the numbers 1 to 9 :

Write 49+_
Write 49+1
Write 49+2
Write 49+3
Write 49+4
Write 49+5
Write 49+6
Write 49+7
Write 49+8

49 is the ascii code of 1. _ contains 0 by default (so 49+_ = 1). And Write prints the character corresponding to the ascii code of its argument. Pretty straight forward.

Dada

Posted 2016-11-12T12:45:00.623

Reputation: 8 279

3

Octave, 24 bytes, 9 numbers, by flawr

max(repmat(1,ones(),1))%
max(repmat(2,ones(),1))%
max(repmat(3,ones(),1))%
max(repmat(4,ones(),1))%
max(repmat(5,ones(),1))%
max(repmat(6,ones(),1))%
max(repmat(7,ones(),1))%
max(repmat(8,ones(),1))%
max(repmat(9,ones(),1))%

Octave, 24 bytes 9 10 numbers

Note: This crack is for the first version of the cop post (posted the wrong snippet), with the revealed code looking like this: ___a__repmat(__one__),__). The correct version is above.

Original code:

+mean(repmat(1,ones(),1))

Modified versions that print 2-10

1+mean(repmat(1,ones(),1))
2+mean(repmat(1,ones(),1))
3+mean(repmat(1,ones(),1))
4+mean(repmat(1,ones(),1))
5+mean(repmat(1,ones(),1))
6+mean(repmat(1,ones(),1))
7+mean(repmat(1,ones(),1))
8+mean(repmat(1,ones(),1))
9+mean(repmat(1,ones(),1))

Stewie Griffin

Posted 2016-11-12T12:45:00.623

Reputation: 43 471

3

Octave, 21 bytes, 9 numbers, by flawr

I really enjoyed this one... Clever :)

a='repmat(1one'(1,8)
a='repmat(2one'(1,8)
a='repmat(3one'(1,8)
a='repmat(4one'(1,8)
a='repmat(5one'(1,8)
a='repmat(6one'(1,8)
a='repmat(7one'(1,8)
a='repmat(8one'(1,8)
a='repmat(9one'(1,8)

Stewie Griffin

Posted 2016-11-12T12:45:00.623

Reputation: 43 471

1What the heck, no that was still not my solution =) – flawr – 2016-11-12T23:04:05.980

WHAT? Are you kidding me? My oh my... – Stewie Griffin – 2016-11-12T23:06:22.607

Well I'll post my solution now=) – flawr – 2016-11-12T23:08:59.757

3

JavaScript, 15 bytes, 10 numbers, ETHProductions

Original code:

alert( +"+1"+0)  // Prints 1

Programs:

alert( +"+1"+1)  // Prints 2
alert( +"+1"+2)  // Prints 3
alert( +"+1"+3)  // Prints 4
alert( +"+1"+4)  // Prints 5
alert( +"+1"+5)  // Prints 6
alert( +"+1"+6)  // Prints 7
alert( +"+1"+7)  // Prints 8
alert( +"+1"+8)  // Prints 9
alert( +"+1"+9)  // Prints 10

Adnan

Posted 2016-11-12T12:45:00.623

Reputation: 41 965

3

Python 2, 49 bytes, 10 numbers, AlexRacer

Maybe (just maybe) the intended solution, but if so, plenty of bytes could have been golfed off:

y=10-6;s='0901100000';print int(s[8-8+y-2+0+0:y])
y=10-6;s='0902100000';print int(s[8-8+y-2+0+0:y])
y=10-6;s='0903100000';print int(s[8-8+y-2+0+0:y])
y=10-6;s='0904100000';print int(s[8-8+y-2+0+0:y])
y=10-6;s='0905100000';print int(s[8-8+y-2+0+0:y])
y=10-6;s='0906100000';print int(s[8-8+y-2+0+0:y])
y=10-6;s='0907100000';print int(s[8-8+y-2+0+0:y])
y=10-6;s='0908100000';print int(s[8-8+y-2+0+0:y])
y=10-6;s='0909100000';print int(s[8-8+y-2+0+0:y])
y=10-4;s='0909100000';print int(s[8-8+y-2+0+0:y])

boboquack

Posted 2016-11-12T12:45:00.623

Reputation: 2 017

Blast I didn't notice you already cracked it until I was about to submit mine. I did: y=10*6;s='0910_____1';print int(s[8+(y>4or-6):y]) changing that final 1 to a 2, ... , 9 and then the * to -: https://repl.it/EW5q :(

– Jonathan Allan – 2016-11-13T06:39:58.740

Wow, nice one, I knew I hid too many characters :) – AlexRacer – 2016-11-13T12:41:44.983

3

Befunge-93, 11 bytes, 10 numbers, James Holderness

905:**-8-.@
905:**-7-.@
905:**-6-.@
905:**-5-.@
905:**-4-.@
905:**-3-.@
905:**-2-.@
905:**-1-.@
905:**-0-.@
905:**-~-.@

Try it online!

Probably not the intended solution.

What I did was get rid of the pesky 25 (5:*) by multiplying it by 0. If we then put a 9 at the beginning then the outputs will be 9 - N where need to generate N from a single command. The only issue is -1 to get 10, but trying to read an integer if there's no input conveniently pushes a -1.

Martin Ender

Posted 2016-11-12T12:45:00.623

Reputation: 184 808

3

05AB1E, 5 bytes, 10 numbers, by Adnan.

Original code:

…[==1

1-10:

…[==1
…[==2
…[==3
…[==4
…[==5
…[==6
…[==7
…[==8
…[==9
…[==T

Explanation:

…[==   3 char string
    1  Push number

acrolith

Posted 2016-11-12T12:45:00.623

Reputation: 3 728

3

05AB1E, 6 bytes, 10 numbers, Adnan

Original code:

¼ [==q

Keep adding ¼'s to output up to 10:

¼¼ [==q
¼¼¼ [==q
¼¼¼¼ [==q
¼¼¼¼¼ [==q
¼¼¼¼¼¼ [==q
¼¼¼¼¼¼¼ [==q
¼¼¼¼¼¼¼¼ [==q
¼¼¼¼¼¼¼¼¼ [==q
¼¼¼¼¼¼¼¼¼¼ [==q

Try it online

How it works:

¼        # Increment counter_variable to count_of(¼), it's printed at some point...
  [      # Infinite loop start
   ==    # Print nothing because stack is empty
     q   # Quit

milk

Posted 2016-11-12T12:45:00.623

Reputation: 3 043

3

Python 3, 19 bytes, 10 numbers, Sp3000

Newlines are a real bummer.

print(##bin()

0+1)

0+1 ... 9+1.

feersum

Posted 2016-11-12T12:45:00.623

Reputation: 29 566

Yeah... I forget about newlines every CnR... :/ – Sp3000 – 2016-11-15T03:22:16.093

3

JavaScript, 21 Bytes, 10 Numbers, Shaun H

Original:

alert(b_oa_"3____1"))

First:

alert(btoa|"3"&("1")) 

Then:

alert(btoa|"3"-("1")) 
alert(btoa|"3"-("0")) 
alert(btoa|"4"-("0")) 
alert(btoa|"5"-("0")) 
alert(btoa|"6"-("0")) 
alert(btoa|"7"-("0")) 
alert(btoa|"8"-("0")) 
alert(btoa|"9"-("0")) 
alert(btoa|"9"-(~"0"))

//Using console.log instead of alert

console.log(btoa|"3"&("1"))
console.log(btoa|"3"-("1"))
console.log(btoa|"3"-("0"))
console.log(btoa|"4"-("0"))
console.log(btoa|"5"-("0"))
console.log(btoa|"6"-("0"))
console.log(btoa|"7"-("0"))
console.log(btoa|"8"-("0"))
console.log(btoa|"9"-("0"))
console.log(btoa|"9"-(~"0"))

Hedi

Posted 2016-11-12T12:45:00.623

Reputation: 1 857

3

Python 2, 26 bytes, 10 numbers, DLosc

Original:

print r___e(3______+_[___]

Solve:

print range(3,)[1]#+_[___]
print range(3,)[-1]#+_[___]
print range(3,4)[-1]#+_[___]
print range(3,5)[-1]#+_[___]
print range(3,6)[-1]#+_[___]
print range(3,7)[-1]#+_[___]
print range(3,8)[-1]#+_[___]
print range(3,9)[-1]#+_[___]
print range(3^9)[-1]#+_[___]
print range(2^9)[-1]#+_[___]

Yeah, I'm fairly sure this still isn't the intended solve.

Sp3000

Posted 2016-11-12T12:45:00.623

Reputation: 58 729

I am learning things about Python that I never knew. Never expected range(3,) to be valid syntax. – DLosc – 2016-11-15T06:34:02.887

3

Befunge-93, 11 bytes, 10 numbers, James Holderness

"15:**-6-.@
"15:**-6-2.@
"15:**-6-2+.@
"15:**-6-3+.@
...
"15:**-6-9+.@

A more complete crack of James' Befunge cop, after Martin's here. Because Befunge-93 has a limited board, the IP actually waits until it gets to the end of the board before wrapping around, unlike other 2D languages such as ><>. This means that a wraparound char push with " ends up pushing the values of the empty cells too, which by default is 32 for space.

Hence here at the start we push a bunch of chars, with 32 on top, then 1:5**- on that gives 32 - (1*(5*5)) = 32 - 25 = 7. Subtract another 6, and we have 1 to start off the ladder.

Sp3000

Posted 2016-11-12T12:45:00.623

Reputation: 58 729

Not only was your quote trick unexpected, but I never realised you could so easily get the rest of the sequence once you had the 1. In retrospect, Martin's solution could have been made to work in the same way without having to resort to the -1 hack. – James Holderness – 2016-11-15T15:00:48.963

@JamesHolderness Come to think about it... yeah, that would have been much simpler (and nicer) – Sp3000 – 2016-11-16T06:00:56.303

2

JavaScript, 33 Bytes, 10 Numbers, Shaun H

Original:

alert(_to__"_Xc0__0_B6____Zp=="))

First:

alert(atob|"0Xc0"/0xB6||("Zp=="))

Then:

alert(atob|"0X1c0"/0xB6||("Zp=="))
alert(atob|"0X2c0"/0xB6||("Zp=="))
alert(atob|"0X2F0"/0xB6||("Zp=="))
alert(atob|"0X3F0"/0xB6||("Zp=="))
alert(atob|"0X4F0"/0xB6||("Zp=="))
alert(atob|"0X4F0"/0xB0||("Zp=="))
alert(atob|"0X5F0"/0xB0||("Zp=="))
alert(atob|"0X5F0"/0xA0||("Zp=="))
alert(atob|"0X5F0"/0x90||("Zp=="))

// Using console.log instead of alert

console.log(atob|"0Xc0"/0xB6||("Zp=="))
console.log(atob|"0X1c0"/0xB6||("Zp=="))
console.log(atob|"0X2c0"/0xB6||("Zp=="))
console.log(atob|"0X2F0"/0xB6||("Zp=="))
console.log(atob|"0X3F0"/0xB6||("Zp=="))
console.log(atob|"0X4F0"/0xB6||("Zp=="))
console.log(atob|"0X4F0"/0xB0||("Zp=="))
console.log(atob|"0X5F0"/0xB0||("Zp=="))
console.log(atob|"0X5F0"/0xA0||("Zp=="))
console.log(atob|"0X5F0"/0x90||("Zp=="))


The intended version:
alert(_to__"_Xc0__0_Bf____Zp=="))

First:

alert(atob|"0Xc0"/0xBf||("Zp=="))

Then:

alert(atob|"0X1c0"/0xBf||("Zp=="))
alert(atob|"0X2c0"/0xBf||("Zp=="))
alert(atob|"0X2c0"/0xB0||("Zp=="))
alert(atob|"0X3c0"/0xB0||("Zp=="))
alert(atob|"0X4c0"/0xB0||("Zp=="))
alert(atob|"0X4F0"/0xB0||("Zp=="))
alert(atob|"0X5F0"/0xB0||("Zp=="))
alert(atob|"0X5F0"/0xA0||("Zp=="))
alert(atob|"0X5F0"/0x90||("Zp=="))

// Using console.log instead of alert

console.log(atob|"0Xc0"/0xBf||("Zp=="))
console.log(atob|"0X1c0"/0xBf||("Zp=="))
console.log(atob|"0X2c0"/0xBf||("Zp=="))
console.log(atob|"0X2c0"/0xB0||("Zp=="))
console.log(atob|"0X3c0"/0xB0||("Zp=="))
console.log(atob|"0X4c0"/0xB0||("Zp=="))
console.log(atob|"0X4F0"/0xB0||("Zp=="))
console.log(atob|"0X5F0"/0xB0||("Zp=="))
console.log(atob|"0X5F0"/0xA0||("Zp=="))
console.log(atob|"0X5F0"/0x90||("Zp=="))

Intended crack?

alert(atob|"0Xc0"-0xBf||("Zp=="))
alert(atob|"0Xc0"-0xBe||("Zp=="))
alert(atob|"0Xc0"-0xBd||("Zp=="))
alert(atob|"0Xc0"-0xBc||("Zp=="))
alert(atob|"0Xc0"-0xBb||("Zp=="))
alert(atob|"0Xc0"-0xBa||("Zp=="))
alert(atob|"0Xc0"-0xB9||("Zp=="))
alert(atob|"0Xc0"-0xB7||("Zp=="))
alert(atob|"0Xc0"-0xB6||("Zp=="))

// Using console.log instead of alert

console.log(atob|"0Xc0"-0xBf||("Zp=="))
console.log(atob|"0Xc0"-0xBe||("Zp=="))
console.log(atob|"0Xc0"-0xBd||("Zp=="))
console.log(atob|"0Xc0"-0xBc||("Zp=="))
console.log(atob|"0Xc0"-0xBb||("Zp=="))
console.log(atob|"0Xc0"-0xBa||("Zp=="))
console.log(atob|"0Xc0"-0xB9||("Zp=="))
console.log(atob|"0Xc0"-0xB7||("Zp=="))
console.log(atob|"0Xc0"-0xB6||("Zp=="))

Hedi

Posted 2016-11-12T12:45:00.623

Reputation: 1 857

I accidentally posted my version for 10 and you still cracked it, nice – Shaun H – 2016-11-16T21:34:00.580

Posted my intended puzzle in the Cops answer, still gave you crack credit but if you want another puzzle feel free to try it. – Shaun H – 2016-11-16T21:43:39.773

2

Python 3, 56 bytes, 6 numbers, by Flp.Tkc

Cop's post:

print(_______(str(ord(x))for x in ________).___________)

Crack:

print(0+1)#__(str(ord(x))for x in ________).___________)
print(1+1)#__(str(ord(x))for x in ________).___________)
print(2+1)#__(str(ord(x))for x in ________).___________)
...

Stewie Griffin

Posted 2016-11-12T12:45:00.623

Reputation: 43 471

2

Ocaml, 51 bytes, 10 numbers, by feersum

Original code:

^^t^r^^^^-^^^^-^^r^^^^=^^^^^^^r^^^^r^^^^^^^(^^^^/0)

Cracks for 1-10:

  1. let(r, (-/)(*- r*)) =0,(+);;r;; print_int(1 -/0)
  2. let(r, (-/)(*- r*)) =0,(+);;r;; print_int(1 -/1)
  3. let(r, (-/)(*- r*)) =0,(+);;r;; print_int(1 -/2)
  4. let(r, (-/)(*- r*)) =0,(+);;r;; print_int(1 -/3)
  5. let(r, (-/)(*- r*)) =0,(+);;r;; print_int(1 -/4)
  6. let(r, (-/)(*- r*)) =0,(+);;r;; print_int(1 -/5)
  7. let(r, (-/)(*- r*)) =0,(+);;r;; print_int(1 -/6)
  8. let(r, (-/)(*- r*)) =0,(+);;r;; print_int(1 -/7)
  9. let(r, (-/)(*- r*)) =0,(+);;r;; print_int(1 -/8)
  10. let(r, (-/)(*- r*)) =0,(+);;r;; print_int(1 -/9)

The hard part is to get rid of the /0, which would normally cause an error. There's just enough room to define a new operator (-/), which I defined to be an alias for addition (+). Then I could construct the answer with 1-/0, 1-/1, 1-/2, and so on. The rest of the solution fits the other required characters into place with comment marks (* *) and statement marks ;;, and mostly just cancels itself out (although I had to define r in order to handle the first r in the program and in order for ;;r;; to correctly be a no-op).

user62131

Posted 2016-11-12T12:45:00.623

Reputation:

I failed to consider the let statement with tuple assignment. Trying again with one more revealed.

– feersum – 2016-11-17T23:54:03.277

2

OCaml, 51 bytes, 10 numbers, by feersum

Original code:

^^t^r^^^^-^^^^-^^r^^^^=^^^^^^^r^^^^r^^^^^^^(^^^0/0)

Code that produces 1-10:

  1. let r,((*-^^^^-^^r*)/)=0,(+);;r;; print_int( 1/0/0)
  2. let r,((*-^^^^-^^r*)/)=0,(+);;r;; print_int( 1/1/0)
  3. let r,((*-^^^^-^^r*)/)=0,(+);;r;; print_int( 1/2/0)
  4. let r,((*-^^^^-^^r*)/)=0,(+);;r;; print_int( 1/3/0)
  5. let r,((*-^^^^-^^r*)/)=0,(+);;r;; print_int( 1/4/0)
  6. let r,((*-^^^^-^^r*)/)=0,(+);;r;; print_int( 1/5/0)
  7. let r,((*-^^^^-^^r*)/)=0,(+);;r;; print_int( 1/6/0)
  8. let r,((*-^^^^-^^r*)/)=0,(+);;r;; print_int( 1/7/0)
  9. let r,((*-^^^^-^^r*)/)=0,(+);;r;; print_int( 1/8/0)
  10. let r,((*-^^^^-^^r*)/)=0,(+);;r;; print_int( 1/9/0)

The same trick still works; there's rather less room, because now I have to redefine division to mean addition rather than using a new operator, but there's still enough.

user62131

Posted 2016-11-12T12:45:00.623

Reputation:

2

R, 22 bytes, 10 numbers by Gregor

Original code:

_et_______)____is_____

Cracked:

For 1

#et
cat(+1)#___is_____

For 2

#et
cat(1+1)#___is_____

For the rest just increment the 1's

found a short enough print to sneak it in a gap with newline and comment.

masterX244

Posted 2016-11-12T12:45:00.623

Reputation: 3 942

1the cat is after a newline which is placed behind the _et :P @Gregor And newlines are exactly one character – masterX244 – 2016-11-18T17:30:03.097

Hmmm, I guess it's legit. – Gregor Thomas – 2016-11-18T17:35:03.903

yeah, some other submissions got broken in a similar way, always check that gaps don't allow to sneak something in to avoid surprise cracks like this one. @Gregor – masterX244 – 2016-11-18T17:36:03.677

2

Octave, 16 bytes, 10 numbers by Stewe Griffin

Original code:

ev_l('P_NIS'-2_)

Cracked:

eval('PFNIS'-28)
eval('PFNIR'-28)
eval('PFNIQ'-28)
eval('PFNIP'-28)
eval('PFNIO'-28)
eval('PFNIN'-28)
eval('PFNIM'-28)
eval('PFNzM'-28)
eval('PFNGM'-28)
eval('PFNGN'-28)

After finding a way around the 8 without a zero it was easy. Trick was to use the 1 as a exponent which is a no-op and then contineru with +
relevant part unobfuscated here:

4*2-1
eval('PFNIM'-28)
4*2^1
eval('PFNzM'-28)
4*2+1
eval('PFNGM'-28)

masterX244

Posted 2016-11-12T12:45:00.623

Reputation: 3 942

2

Python, 10+ numbers, 61 bytes, Flp.Tkc

try:x
except:print(__import__('sys').exc_info()[2].tb_lineno)

For subsequent numbers, add a newline to the start of the program.

Sp3000

Posted 2016-11-12T12:45:00.623

Reputation: 58 729

Good job! I knew it wasn't hard to crack, I just wanted a funny way to print numbers: "hey, let's throw an error and print the line it's on " – FlipTack – 2016-11-20T10:29:34.000

2

Pyth, 3 bytes, 10 numbers, by Yotam Salmon

Original code was __Q, with_ unknown.

1.Q: Implicit print 1, throw error when trying to evaluate empty input. Same answer for 2-9 (with the number 1 replaced by 2-9), and the code T.Q for 10 (since T is initialized to 10).

penalosa

Posted 2016-11-12T12:45:00.623

Reputation: 505

Cool solution! Not what I thought of ;-) But my solution worked for any number, and yours works up to 10. Is that accepted? – Yotam Salmon – 2016-11-13T15:39:00.320

2

Octave, 19 bytes, 10 numbers, by flawr

Probably not the intended solution, but hey.

'psca'(1 )+'1'-160'
'qsca'(1 )+'1'-160'
...
'ysca'(1 )+'1'-160'

Luis Mendo

Posted 2016-11-12T12:45:00.623

Reputation: 87 464

Wasn't even close to my solution=) – flawr – 2016-11-13T10:48:09.893

2

Octave, 26 bytes, 10 numbers, by LuisMendo

original
__a__repmat(_+one___1+__))

solution:
mean(repmat(0+ones, 1+0 ))
mean(repmat(1+ones, 1+0 ))
mean(repmat(2+ones, 1+0 ))
...

flawr

Posted 2016-11-12T12:45:00.623

Reputation: 40 560

2

Octave, 17 bytes, 10 numbers, by flawr

From

_od(3_13_13_7_1_)

To the original code:

mod(3113+1387,11) #1

The rest of the numbers:

mod(3113+1388,11) #2
mod(3113+1389,11) #3
mod(3114+1389,11) #4
mod(3115+1389,11) #5
mod(3116+1389,11) #6
mod(3117+1389,11) #7
mod(3118+1389,11) #8
mod(3119+1389,11) #9
mod(3119+1379,11) #10

Try it online! for the first case

Explanation

mod(x, y) computes the modulo of x and y. Here is the docs for mod.

Process

I don't know Octave, I've never used it, but I was interested in this particular sumbission. So I decided to try to crack it. First, I used this website to help me find an Octave command that is three characters long and has an od in the end. I found it to be mod. Then I began experimenting with the numbers in its online interpreter. After some time, I ended up with

mod(3_13+13_7,1_)

after which time I decided to create a python script (on TIOv2!) to brute-force the solution. The script printed the values for the _ whenever first_param%second_param==1. I first ran the python script for 10 (the second paramter to the mod function). I got tons of hits. Then I ran it again for 11. I got only a few hits this time, after which I decided to use 11 as the second parameter and the following values for the first parameter 3113+1387 just out of randomness. Now I got the original code. From there, I began incrementing the last digit of the numbers, so that I did 1387->1388->1389 and then 3113->3114->3115->3116->3117->3118->3119. Now I got the first 9 numbers.

mod(3119+1389,11) #evaluates to 9

Now 10 was the only one remaining. I tried changing the 1389 to 1399 to see if it becomes 10, but instead it resulted to 8. So I changed it to 1379, and it resulted in 10!

user41805

Posted 2016-11-12T12:45:00.623

Reputation: 16 320

1That almost feels like cheating, but good job! =) – flawr – 2016-11-13T15:34:26.170

1@flawr Well, you know how the saying goes, "Fight code with code," or in this case, "Crack code using code." :) – user41805 – 2016-11-13T15:43:21.810

Good luck with this one =)

– flawr – 2016-11-13T18:48:33.897

2

C, 216 bytes, 10 numbers, by Joshua

Original code :

#include <stdio.h>

FILE *a, *b;

void x() { ___________ int x; x = __; ________a____d____x_;}
void y() { ___________ int x; fprintf(b,"%d\n",x);}
int main() { a=fopen("/dev/null", "w");b=stdout;x();y();return 0;}

Cracked code :

#include <stdio.h>

FILE *a, *b;

void x() { volatile    int x; x =  0; fprintf(a," %d",++x);}
void y() { volatile    int x; fprintf(b,"%d\n",x);}
int main() { a=fopen("/dev/null", "w");b=stdout;x();y();return 0;}

Change the x = 0 to the number you want to print minus 1 : x=0 for 1, x=1 for 2, x=2 for 3 etc, until x=9 for 10.

Dada

Posted 2016-11-12T12:45:00.623

Reputation: 8 279

This is indeed the form of the solution. I have a few characters different but this does work. – Joshua – 2016-11-13T22:01:10.630

@Joshua I think you didn't used volatile since at first you said there were no spaces in the eleven _ before int x, so what did you use instead? (I'm intrigued because I don't think there is any C keyword that is 11 characters long...) – Dada – 2016-11-13T22:06:57.663

I used volatile/**/ to throw people off the scent. ;;;;volatile also works the same way. – Joshua – 2016-11-13T22:07:35.047

@Joshua volatile/**/ is 12 characters long and there were only 11 underscores... – Dada – 2016-11-13T22:09:31.423

my bad. It's a transcription error on masking it. Did you notice also your file was 214 bytes? – Joshua – 2016-11-13T22:11:21.533

@Joshua Indeed I noticed the original code was 214 instead of 216 but I just thought it was some spaces at the end of a line of something alike that resulted in a wrong byte count. But it was the two underscores missing! – Dada – 2016-11-13T22:14:56.567

2

PowerShell, 7 bytes, 10 numbers, by TimmyD

Original code :

___(__0

Cracked code :

+1#(__0
+2#(__0
+3#(__0
...
+9#(__0
1+9#(__0

Dada

Posted 2016-11-12T12:45:00.623

Reputation: 8 279

2

Java, 70 bytes, 10(+) numbers, by masterX244

//Submission v
__________________________ ____(_____________________________)________
//Original code v
class A{public static void main(String[]a){System.out.print(')'-40);}}//1

This makes use of the character codes for numbers. The char ) is 41. So when you subtract 40 from it, it evaluates to 1. By incrementing the char by 1, we effectively increase the output by 1 too.

Try it online in Ideone!. Note: in Ideone, you need to have public before class and the name of the class should be HelloWorld

Other numbers:

class A{public static void main(String[]a){System.out.print('*'-40);}}//2
class A{public static void main(String[]a){System.out.print('+'-40);}}//3
class A{public static void main(String[]a){System.out.print(','-40);}}//4
class A{public static void main(String[]a){System.out.print('-'-40);}}//5
class A{public static void main(String[]a){System.out.print('.'-40);}}//6
class A{public static void main(String[]a){System.out.print('/'-40);}}//7
class A{public static void main(String[]a){System.out.print('0'-40);}}//8
class A{public static void main(String[]a){System.out.print('1'-40);}}//9
class A{public static void main(String[]a){System.out.print('2'-40);}}//10
...
class A{public static void main(String[]a){System.out.print('~'-40);}}//86

Edit: fixed mistake

Edit 2: Yes, this can go upto 86 and maybe even more!

user41805

Posted 2016-11-12T12:45:00.623

Reputation: 16 320

Grrr. Back to square one... need some dirtier code... – masterX244 – 2016-11-14T11:52:08.587

2

Java, 126 bytes, 10 numbers, masterX244

Yes we have seen Unicode escapes many times here at PPCG.

cl\u0061ss Z\u007bpublic st\u0061tic void main(String[]a){System. out.print(/*_"___42*/0+1/*_00____00____".*/)/*______0)_*/;}}

s/0+1/1+1/ ... 9+1.

feersum

Posted 2016-11-12T12:45:00.623

Reputation: 29 566

Damn again... btw my intended solution only has one commented out character – masterX244 – 2016-11-14T21:05:01.520

got more unicode for you to crack this time.... – masterX244 – 2016-11-15T09:25:20.007

2

QBasic, 13 bytes by DLosc

?+INT(LOG(3))  'Fixed thanks to feersome
?1+INT(LOG(3))
?2+INT(LOG(3))
?3+INT(LOG(3))
?4+INT(LOG(3))
?5+INT(LOG(3))
?6+INT(LOG(3))
?7+INT(LOG(3))
?8+INT(LOG(3))
?9+INT(LOG(3))

Try QBasic at archive.org.

Seems like the intended solution is:

? INT(LOG(3))    '1
? INT(LOG(13))   '2
? CINT(LOG(13))   '3

but that can't possibly work because the natural log function grows too quickly. There are no sequences of this form that get past 4.

Joshua

Posted 2016-11-12T12:45:00.623

Reputation: 3 043

I don't think this works. You have to change from 9 to 10 via one edit, whereas changing 9 to 1 and inserting 0 is two edits. Unless I'm misunderstanding...? Please post the exact sequence of changes. – DLosc – 2016-11-15T03:30:59.993

@DLosc: I believe the rules allow 1 insertion character and resetting all the mask characters. If not so, all of the edit-only solutions don't work for 10. – Joshua – 2016-11-15T03:34:13.673

4The wording of the rules is admittedly not the clearest, but I'm quite sure that each iteration must be a modification from the previous iteration, without "resetting." See all the solutions that do 0+1 -> 8+1 -> 9+1 rather than 1 -> 9 -> 10. In any case, I can tell you that my original code does not reset, but makes one edit at each step. – DLosc – 2016-11-15T03:42:22.147

The second attempt inserts 3 characters before the I where there are only two blanks, but would it work if you started with ?+INT(LOG(3)) and then continued with the same 2-10? – feersum – 2016-11-15T23:31:08.007

@feersum: That would work if I'm allowed to change the inserted character. – Joshua – 2016-11-16T02:30:14.597

The 1 program must have exactly one character for each blank. After that, each new program must have a Levenshtein distance of one from the previous, irrespective of where the blanks were. – feersum – 2016-11-16T02:33:19.830

@DLosc: Try the second one then. – Joshua – 2016-11-18T17:17:48.560

Ah. There I confess you've got me. (But please edit the first one out of your answer.) – DLosc – 2016-11-18T17:36:53.613

2

Python 2, 26 bytes, 10 numbers, DLosc

print range(11)[1or+ [  ]]
print range(11)[2or+ [  ]]
print range(11)[3or+ [  ]]
print range(11)[4or+ [  ]]
print range(11)[5or+ [  ]]
print range(11)[-5or+ [  ]]
print range(11)[-4or+ [  ]]
print range(11)[-3or+ [  ]]
print range(11)[-2or+ [  ]]
print range(11)[-1or+ [  ]]

I thought I'd try this with comments or newlines or anything. Definitely not the intended solution...

Sp3000

Posted 2016-11-12T12:45:00.623

Reputation: 58 729

Nope, not intended. :) Back to the drawing board... – DLosc – 2016-11-15T04:18:06.770

2

JavaScript (ES6), 63 bytes, 10 numbers by Arnauld

Original code:

eval([...(n=0,"l?0?a?(?x?")].sort(_=>[...????+[]][n++]).join``)

Modified:

eval([...(n=0,"le0ta1(rx)")].sort(_=>[...8/73+[]][n++]).join``)
eval([...(n=0,"le0ta2(rx)")].sort(_=>[...8/73+[]][n++]).join``)
...
eval([...(n=0,"le0ta9(rx)")].sort(_=>[...8/73+[]][n++]).join``)
eval([...(n=0,"le0taa(rx)")].sort(_=>[...8/73+[]][n++]).join``)

This was a lot of fun to get to the bottom of, even though my first approach was off!

Dom Hastings

Posted 2016-11-12T12:45:00.623

Reputation: 16 415

1Hey, well done! ;) – Arnauld – 2016-11-15T13:29:59.343

2

Perl, 31 bytes, 10 numbers, by Gabriel Benamy

Original code:

__e_$a__<__$_;1 while_$a_;say$_

Cracked:

  1. the;$a+=<1\$>;1 while!$a ;say$a
  2. the;$a+=<1\$>+1 while!$a ;say$a
  3. the;$a+=<1\$>+2 while!$a ;say$a
  4. the;$a+=<1\$>+3 while!$a ;say$a
  5. the;$a+=<1\$>+4 while!$a ;say$a
  6. the;$a+=<1\$>+5 while!$a ;say$a
  7. the;$a+=<1\$>+6 while!$a ;say$a
  8. the;$a+=<1\$>+7 while!$a ;say$a
  9. the;$a+=<1\$>+8 while!$a ;say$a
  10. the;$a+=<1\$>+9 while!$a ;say$a

The principle using q<> I used last time doesn't seem to quite work here, so I used one of the intended uses of <> brackets (if a fairly obscure one) to create the string 1$ via globbing. Using += rather than = for the assignment to $a converts it to an integer, thus just 1, and then the solution continues the same way as my previous crack.

Fun fact: random sequences of letters in void context (such as the) are no-ops in Perl if they don't happen to spell a keyword.

user62131

Posted 2016-11-12T12:45:00.623

Reputation:

You're really gonna make me give up how I did it, aren't you? :P Should I add one more byte to confuse you? – Gabriel Benamy – 2016-11-15T16:59:27.620

2

Perl, 26 bytes, 10 numbers by Gabriel Benamy

Original code:

____;@a=($_..10);say$a[__]

Cracked:

$_=0;@a=($_..10);say$a[+1]
$_=1;@a=($_..10);say$a[+1]
$_=2;@a=($_..10);say$a[+1]
$_=3;@a=($_..10);say$a[+1]
$_=4;@a=($_..10);say$a[+1]
$_=5;@a=($_..10);say$a[+1]
$_=6;@a=($_..10);say$a[+1]
$_=7;@a=($_..10);say$a[+1]
$_=8;@a=($_..10);say$a[+1]
$_=9;@a=($_..10);say$a[+1]

In fact I tested this on my Mac using print instead of say with perl -e... However I do think they should work basically the same.

This is incrementing the "base" of the array and say the second element of the array. Replacing _s by other characters should work too.

Sunny Pun

Posted 2016-11-12T12:45:00.623

Reputation: 821

2

Perl, 26 bytes, 10 numbers, by Gabriel Benamy

Original code:

____;@a=($_..10);say$a[__]

Cracked:

  1. ____;@a=($|..10);say$a[+1]
  2. ____;@a=($|..10);say$a[1+1]
  3. ____;@a=($|..10);say$a[2+1]
  4. ____;@a=($|..10);say$a[3+1]
  5. ____;@a=($|..10);say$a[4+1]
  6. ____;@a=($|..10);say$a[5+1]
  7. ____;@a=($|..10);say$a[6+1]
  8. ____;@a=($|..10);say$a[7+1]
  9. ____;@a=($|..10);say$a[8+1]
  10. ____;@a=($|..10);say$a[9+1]

I didn't even need the blanks at the start (and as ____ is a legal but pointless Perl statement, I left them as is). The only subtlety here is finding a variable that starts at 0, but there are plenty to choose from; I chose $|.

user62131

Posted 2016-11-12T12:45:00.623

Reputation:

2

C++, 10 numbers, 468 bytes, by Joshua

Original program:

#include <unistd.h>
#include <iostream>
#include <fstream>

$$$$$$$$$$$$$ {
    std::ofstream *garbalgase()
    {
        std::ofstream *golgi = new std::ofstream;
        golgi->open("/dev/null");
        return golgi;
    }

    std::ostream * const jawbone = garbalgase();
    $$$$$ int value = $_$$$$$$;
}

int main()
{
    $$$$$ $$$$$$$$/$$int vl = value;
    if (fork() == 0)
    {
        $$$$$$$$$$$<std::ostream $*>($jawbone) = &std::cout;
        vl -= 4;
        _exit(0);
    }
    (*jawbone) << (vl - 9) << std::endl;
}

My crack (prints 1):

#include <unistd.h>
#include <iostream>
#include <fstream>

extern "C++"  {
    std::ofstream *garbalgase()
    {
        std::ofstream *golgi = new std::ofstream;
        golgi->open("/dev/null");
        return golgi;
    }

    std::ostream * const jawbone = garbalgase();
    /*$*/ int value = '_',vl=1;
}

int main()
{
    std:: cout<<+1/1;int vl = value;
    if (fork() == 0)
    {
        //$$$$$$$$$<std::ostream $*>($jawbone) = &std::cout;
        vl -= 4;
        _exit(0);
    }
    (*jawbone) << (vl - 9) << std::endl;
}

To get a crack for 2 up to 10, change the +1/1 to 1+1/1, 2+1/1, 3+1/1, and so on.

I originally tried to comment out much more of the program than this, but it turns out that most of it is naturally harmless and cancels itself out. (Because it happens to use _exit rather than exit, we can put the number to print out into the stdout buffer in both threads; the parent thread won't have time to flush it before it exits.) The hardest part is dealing with the } character just before int main(); you can't make it the closing brace of a function without -fpermissive, but you can make it the closing brace of a calling convention block (in this case I used extern "C++", the default, to basically cancel the braces out).

I also accidentally declared vl twice, but oh well. It doesn't break the crack, just shows how many spare characters there are here.

user62131

Posted 2016-11-12T12:45:00.623

Reputation:

Ohhhh, extern "C++"! That was the missing piece of the puzzle for me. – Lynn – 2016-11-15T18:11:35.400

The intended solution is quite different. I forgot you could have a space after :: or I would have managed to block this solution. Oh well. – Joshua – 2016-11-15T18:34:29.080

2

COW, 51 bytes, 10 numbers, by Gabriel Benamy

MoO ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ OOM // incomplete
MoO Mo_ Mo_ Mo_ Mo_ Mo_ Mo_ Mo_ Mo_ Mo_ Mo_ Mo_ OOM //original code outputs 1

Other numbers:

MoO MoO Mo_ Mo_ Mo_ Mo_ Mo_ Mo_ Mo_ Mo_ Mo_ Mo_ OOM //2
MoO MoO MoO Mo_ Mo_ Mo_ Mo_ Mo_ Mo_ Mo_ Mo_ Mo_ OOM //3
MoO MoO MoO MoO Mo_ Mo_ Mo_ Mo_ Mo_ Mo_ Mo_ Mo_ OOM //4
MoO MoO MoO MoO MoO Mo_ Mo_ Mo_ Mo_ Mo_ Mo_ Mo_ OOM //5
MoO MoO MoO MoO MoO MoO Mo_ Mo_ Mo_ Mo_ Mo_ Mo_ OOM //6
MoO MoO MoO MoO MoO MoO MoO Mo_ Mo_ Mo_ Mo_ Mo_ OOM //7
MoO MoO MoO MoO MoO MoO MoO MoO Mo_ Mo_ Mo_ Mo_ OOM //8
MoO MoO MoO MoO MoO MoO MoO MoO MoO Mo_ Mo_ Mo_ OOM //9
MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO Mo_ Mo_ OOM //10

Explanation

MoO //increment current memory block value by 1.
OOM //print current memory block as output to STDOUT
Mo_ //gets ignored since the compiler doesn't recognise it

Try it online!

Cows don't moo, Cows quack!

user41805

Posted 2016-11-12T12:45:00.623

Reputation: 16 320

2

Hexagony, 15 bytes, 10 numbers, Sunny Pun

\!?\1<<3@_!?_<3
\!?\2<<3@_!?_<3
\!?\3<<3@_!?_<3
\!?\4<<3@_!?_<3
\!?\5<<3@_!?_<3
\!?\6<<3@_!?_<3
\!?\7<<3@_!?_<3
\!?\8<<3@_!?_<3
\!?\9<<3@_!?_<3
\!?\9)<<3@_!?_<3

Try it online!

I'm afraid this wasn't sufficiently well constrained (as this is almost definitely nowhere near the intended solution).

Martin Ender

Posted 2016-11-12T12:45:00.623

Reputation: 184 808

Will mark as cracked once not on mobile. Overlooked that adding a byte at line 2 will also shift line 3 :P – Sunny Pun – 2016-11-15T20:10:13.557

2

Python 2, 26 bytes, 10 numbers DLosc

Original: print r___e(3_4____+_[___]

print range(304)[ 1+#[
0 ]

Where the 0 character is incremented up through 9.

feersum

Posted 2016-11-12T12:45:00.623

Reputation: 29 566

Well, Sp3000 warned me about newlines... heh. Have an upvote. – DLosc – 2016-11-15T21:28:08.970

alternate: print r'1_e(3_4____+'[0 ] – Destructible Lemon – 2016-11-15T23:16:14.687

@DestructibleWatermelon How do you get 10 with that? – feersum – 2016-11-15T23:18:09.690

whoops lol. It almost worked – Destructible Lemon – 2016-11-15T23:22:23.787

I got it! print r'10e(3642345+'[0+0], print r'10e(3642345+'[0+7], print r'10(3642345+'[0+7], print r'103642345+'[0+7], print r'10642345+'[0+7], print r'10642345+'[0+2], print r'10742345+'[0+2], print r'10842345+'[0+2], print r'10942345+'[0+2], print r'10942345+'[0:2] – Destructible Lemon – 2016-11-15T23:45:10.427

I'm actually rather proud of myself for that one – Destructible Lemon – 2016-11-15T23:45:43.893

1

Python 2, 33 bytes, 9 numbers, CrazyPython

Original code:

#__________________
riny
________

Code to print 1:

# my comment
riny=1
riny
print +1

And then just increment the 1 from there on out.

ETHproductions

Posted 2016-11-12T12:45:00.623

Reputation: 47 880

Try solving it without exploiting an unintended easy solution. – noɥʇʎԀʎzɐɹƆ – 2016-11-16T00:52:35.730

@CrazyPython Do you mean "without literal newlines", or there something further? – xnor – 2016-11-16T00:53:29.413

1

Hexagony, 12 bytes, 10 numbers, Sunny Pun

[!_>!@!1)@!_
[!_>!@!2)@!_
[!_>!@!3)@!_
[!_>!@!4)@!_
[!_>!@!5)@!_
[!_>!@!6)@!_
[!_>!@!7)@!_
[!_>!@!8)@!_
[!_>!@!9)@!_
[!__!@!9)@!_

Try it online!

Unfortunately, this is again a cheap solution.

Martin Ender

Posted 2016-11-12T12:45:00.623

Reputation: 184 808

1

Hexagony, 18 bytes, 10 numbers, Riley

.<.{_]5[$@!.=@.!!1
.<.{_]5[$@!.=@.!!2
.<.{_]5[$@!.=@.!!3
.<.{_]5[$@!.=@.!!4
.<.{_]5[$@!.=@.!!5
.<.{_]5[$@!.=@.!!6
.<.{_]5[$@!.=@.!!7
.<.{_]5[$@!.=@.!!8
.<.{_]5[$@!.=@.!!9
.<.{_]5[$@!.=@)!!9

Try it online!

Certainly not the intended solution.

Martin Ender

Posted 2016-11-12T12:45:00.623

Reputation: 184 808

1

Acc!!, 46 bytes, 10 numbers, DLosc

1
Count i while 0^_-i  {
Write 49
}
Write _+48

The first character goes 1, 2, 3, 4, 5, 6, 7, 8, 9, 0. This uses a Python golfing trick that 0**_ is like +(not _). So if _ (which is set by the first line) is zero, the loop will execute once, while if it is nonzero the loop will execute zero times.

feersum

Posted 2016-11-12T12:45:00.623

Reputation: 29 566

1

><>, 23 bytes, Teal pelican

"H"|;v+2i~?
  _  >l?!;n

For the remaining 9 numbers, replace the i with 0, 1, ..., 8 successively.

Try it online!

Martin Ender

Posted 2016-11-12T12:45:00.623

Reputation: 184 808

1

QBasic, 12 bytes, 10 numbers, by DLosc

Cop:

_I_T__O_(3))

Crack:

?I+T-(O<(3))
?I+1-(O<(3))
?I+2-(O<(3))
?I+3-(O<(3))
?I+4-(O<(3))
?I+5-(O<(3))
?I+6-(O<(3))
?I+7-(O<(3))
?I+8-(O<(3))
?I+9-(O<(3))

Still downloading QB64. But I think this should work. Not sure whether it is the original, though.

QBasic uses bitwise operators as logical operators, instead of having both of them. So true is -1.

jimmy23013

Posted 2016-11-12T12:45:00.623

Reputation: 34 042

Well that was unexpected. No, definitely not the original. ;) – DLosc – 2016-11-18T18:09:27.337

1

QBasic, 12 bytes, 10 numbers, by DLosc

Cop:

_INT(_O_(3))

Crack:

?INT(LOG(3))
?INT(LOG(13))
?INT(LOG(33))
?INT(LOG(73))
?INT(LOG(173))
?INT(LOG(573))
?INT(LOG(1573))
?INT(LOG(5573))
?INT(LOG(9573))
?INT(LOG(39573))

jimmy23013

Posted 2016-11-12T12:45:00.623

Reputation: 34 042

Finally, the intended solution! – DLosc – 2016-11-18T18:48:36.987

1

Pyth, 4 bytes, 9 numbers, isaacg

Original code:

."1Q

Which is a packed string containing the character 1. The other programs:

."2Q
."3Q
."4Q
."5Q
."6Q
."7Q
."8Q
."9Q

I thought this would also contain some unprintables, but if you insert a l in the beginning of each code, you can see that the length of each string is always 1 (only containing the digit).

Adnan

Posted 2016-11-12T12:45:00.623

Reputation: 41 965

1

Python, 28 bytes, 10 numbers, by CrazyPython

print (0+1+0*1000)+(0*0*0*4)
print (1+1+0*1000)+(0*0*0*4)
print (2+1+0*1000)+(0*0*0*4)
...

flawr

Posted 2016-11-12T12:45:00.623

Reputation: 40 560

My original solution had odr and stuff.. welp you cracked it; congrats. – noɥʇʎԀʎzɐɹƆ – 2016-11-14T03:23:39.113

1

><>, 5 bytes, 10 numbers, Teal pelican

>21n;
>22n;
>23n;
>24n;
>25n;
>26n;
>27n;
>28n;
>29n;
>2an;

Emigna

Posted 2016-11-12T12:45:00.623

Reputation: 50 798

1

Javascript 19 bytes 10 numbers, by Shaun H

Original:

alert((_1*1_10__1_)

Code that produces 1 - 10:

alert(( 1*1%10)/1 )
alert(( 2*1%10)/1 )
alert(( 3*1%10)/1 )
alert(( 4*1%10)/1 )
alert(( 5*1%10)/1 )
alert(( 6*1%10)/1 )
alert(( 7*1%10)/1 )
alert(( 8*1%10)/1 )
alert(( 9*1%10)/1 )
alert(( 9*1%10)+1 )

Riley

Posted 2016-11-12T12:45:00.623

Reputation: 11 345

1

Python 2, 26 bytes, 10 numbers by DLosc, non-competing

Non-competing because Sp3000 beat me to it.

print r___e(_______+_[___]

print range(19)[1]#+_[___]
print range(19)[2]#+_[___]
print range(19)[3]#+_[___]
print range(19)[4]#+_[___]
print range(19)[5]#+_[___]
print range(19)[6]#+_[___]
print range(19)[7]#+_[___]
print range(19)[8]#+_[___]
print range(19)[9]#+_[___]
print range(19)[-9]#+_[___]

xnor

Posted 2016-11-12T12:45:00.623

Reputation: 115 687

1

R, 21 bytes, 10 numbers, Gregor

  • Cop's: __i___________i______
  • Rob's: write(a<-1+0,file="")

Of course there's a bunch of possibility as a can be any letter (and is not needed at all)...

Tensibai

Posted 2016-11-12T12:45:00.623

Reputation: 409

1

R, 8 bytes, 10 numbers by Tensibai

Original code:

_a___+__

Modified:

max(0+1)
max(1+1)
...
max(4+5)
max(5+5)

Dom Hastings

Posted 2016-11-12T12:45:00.623

Reputation: 16 415

1That's the idea, I assume that it's ok as the problem didn't specify if the program should print or return, so cat or max will give the same thing for 1+0 to 1+9. Good job ;) – Tensibai – 2016-11-15T12:41:41.423

1@Tesnbai Awesome! I've not used R before so I wasn't sure on IO rules... Thanks for confirming! – Dom Hastings – 2016-11-15T12:44:12.103

1Well, on a script call, this one won't output anything, the result will only be printed in an interactive session, but as the original challenge doesn't really specify it, I assume it's ok :) – Tensibai – 2016-11-15T12:47:02.667

1

ASMD, 8 bytes, 10 numbers, by Oliver

  • For 1, 1t-t+++C
  • For 2, 1t-t+++C{
  • For 3, 1t-t+++C{{

Works with the latest commit at the time of posting. C claims to be implemented, but it isn’t.

Each program works as follows:

1              Push 1.             1
 t             Triplicate.         1 1 1
  -            Subtract.           1 0
   t           Triplicate.         1 0 0 0
    +          Add.                1 0 0
     +         Add.                1 0
      +        Add.                1
       C       Do nothing.         1
        {{{    Increment n times.  4

Lynn

Posted 2016-11-12T12:45:00.623

Reputation: 55 648

1

Perl, 31 bytes, 10 numbers, by Gabriel Benamy

Original code:

__e_$a__<__$_;1 while_$__;say$_

Code that produces 1 to 10 (note: these answers each have a leading space that doesn't show up in StackExchange's markdown):

  1. $e=$a+q<1_$>;1 while!$e ;say$e
  2. $e=$a+q<1_$>+1 while!$e ;say$e
  3. $e=$a+q<1_$>+2 while!$e ;say$e
  4. $e=$a+q<1_$>+3 while!$e ;say$e
  5. $e=$a+q<1_$>+4 while!$e ;say$e
  6. $e=$a+q<1_$>+5 while!$e ;say$e
  7. $e=$a+q<1_$>+6 while!$e ;say$e
  8. $e=$a+q<1_$>+7 while!$e ;say$e
  9. $e=$a+q<1_$>+8 while!$e ;say$e
  10. $e=$a+q<1_$>+9 while!$e ;say$e

I'm genuinely unsure whether you intended something like this and were aiming for misdirection, or whether this solution is completely different from the intended one.

The main trick I used is Perl's ability to get rid of unwanted characters by using a q, thus changing them into custom quotation marks (while allowing me to drop something that looks like 1 as an integer into the string that's actually quoted). It's not a trick that's normally that useful when golfing, because Perl has quote marks that use fewer bytes, but it comes in handy for challenges like this.

user62131

Posted 2016-11-12T12:45:00.623

Reputation:

Holy crap?? This is not even remotely what I was going for, but really nicely done! Let me see if I can add one more character to give you another challenge! – Gabriel Benamy – 2016-11-15T16:22:23.550

1

Perl, 7 bytes, 10 numbers, ais523

^F means a "Control-F" character. $^F is a magic variable that equals 2.

say$^F-1
say$^F*1
say$^F+1
say$^F+2
say$^F+3
say$^F+4
say$^F+5
say$^F+6
say$^F+7
say$^F+8

feersum

Posted 2016-11-12T12:45:00.623

Reputation: 29 566

Unless "control-f" is 2 bytes, this is only 7 bytes, not 8. – Riley – 2016-11-15T21:30:03.347

I miscounted. The original was meant to be 7 bytes. – None – 2016-11-15T22:19:35.527

1

Alternate crack to DLosc, 26 bytes, 10 numbers

original:

print r___e(3_4____+_[___]

crack

>>> print r'10e(3642345+'[0+0]
1
>>> print r'10e(3642345+'[0+7]
2
>>> print r'10(3642345+'[0+7]
3
>>> print r'103642345+'[0+7]
4
>>> print r'10642345+'[0+7]
5
>>> print r'10642345+'[0+2]
6
>>> print r'10742345+'[0+2]
7
>>> print r'10842345+'[0+2]
8
>>> print r'10942345+'[0+2]
9
>>> print r'10942345+'[0:2]
10

programs 2 to 5's purpose is to place a number next to 10, so that for 10, we can change [0+2] to [0:2], and get the number 10. the rest just change the number to get the other numbers

nice challenge :)

Intended solution?

Destructible Lemon

Posted 2016-11-12T12:45:00.623

Reputation: 5 908

This is essentially the intended solution, just with a few details changed. Nice work! – DLosc – 2016-11-16T01:22:23.517

@DLosc I take it that the original program was print r'10e(3541234+'[0+7]? – Destructible Lemon – 2016-11-16T01:51:43.583

No--see edit to cop submission. – DLosc – 2016-11-16T01:56:33.210

1

Ruby, 81 bytes, 10 numbers, histocrat

Yay comments...

require'digest/md5'
p Digest::MD5.digest('')&&0+1#')[n=0].ord^'straYNpraq'[n].ord

0+1 ... 9+1 as usual.

feersum

Posted 2016-11-12T12:45:00.623

Reputation: 29 566

You're quite lucky, that barely fits... – ETHproductions – 2016-11-16T00:17:29.560

Ha, I should've left in a linebreak. – histocrat – 2016-11-16T14:23:51.700

0

Hexagony, 15 bytes, 10 numbers, Sunny Pun

[!?>!@!1)\!?!!!
[!?>!@!2)\!?!!!
[!?>!@!3)\!?!!!
[!?>!@!4)\!?!!!
[!?>!@!5)\!?!!!
[!?>!@!6)\!?!!!
[!?>!@!7)\!?!!!
[!?>!@!8)\!?!!!
[!?>!@!9)\!?!!!
$!?>!@!9)\!?!!!

Try it online!

This might be the intended solution this time, but I'm not entirely sure. This one was definitely a lot more challenging in any case. :)

Martin Ender

Posted 2016-11-12T12:45:00.623

Reputation: 184 808

I laughed into tears because I changed the @ in my mind to a \\ as that looks less repetitive to the last post... Anyway I am impressed to have forced a change to the 1st byte in the code :) – Sunny Pun – 2016-11-16T13:01:37.113

0

Python 2, 110 bytes, 10 numbers CrazyPython

from hashlib import *
h=md5()
h.update('*F[`')
if h.hexdigest()=='88f4002e27b0902c7018359da9bc5b44':print(0+1)

feersum

Posted 2016-11-12T12:45:00.623

Reputation: 29 566

0

TI-Basic, 13(?) bytes, 10 numbers, Timtech

DelVar A1→θ
BL>A
θ

The 1 goes up to 9, and then we change it to Xmax. I'm too good at remembering useless information I don't even want to know.

feersum

Posted 2016-11-12T12:45:00.623

Reputation: 29 566

Nice try! Almost correct, but you cannot assume variables like Xmax will be set to certain values. http://tibasicdev.wikidot.com/graphscreen

– Timtech – 2016-11-17T12:06:34.583

@Timtech Yes I can. See for example http://codegolf.stackexchange.com/a/52967/30688

– feersum – 2016-11-17T21:10:14.783

Alright then, whatever. I made the mistake of thinking you had to add characters... didn't realize substitutions xD – Timtech – 2016-11-17T21:26:18.483

0

PHP, 38 bytes, 10 numbers, by Leo

Original code:

<?php__n_p___(_n=___(__=1___echo___?>

Cracks for 1-10:

  1. <?php "n p ( n= ( =1"; echo +1?>
  2. <?php "n p ( n= ( =1"; echo 1+1?>
  3. <?php "n p ( n= ( =1"; echo 2+1?>
  4. <?php "n p ( n= ( =1"; echo 3+1?>
  5. <?php "n p ( n= ( =1"; echo 4+1?>
  6. <?php "n p ( n= ( =1"; echo 5+1?>
  7. <?php "n p ( n= ( =1"; echo 6+1?>
  8. <?php "n p ( n= ( =1"; echo 7+1?>
  9. <?php "n p ( n= ( =1"; echo 8+1?>
  10. <?php "n p ( n= ( =1"; echo 9+1?>

Unfortunately, you left way too much space after the echo and it became possible to sneak a +1 in there.

user62131

Posted 2016-11-12T12:45:00.623

Reputation:

0

ASMD, 10 bytes (non-competing), by Oliver

Original:

1_**_**_*÷

Code that produces 1 - 10:

1t**t**t*÷
1t**t**t*÷{
1t**t**t*÷{{
...
1t**t**t*÷{{{{{{{{{

Did I miss something? I had to mess around with the interpreter to get it to work on my system, and this seems too easy.

Riley

Posted 2016-11-12T12:45:00.623

Reputation: 11 345