Brokener Keys
Brokener Keys
My program only works for numbers with a difference smaller than 300. Has someone a solution without this limitation?
OK, here is my solution:
It's pretty neat, isn't it?
BTW: To print the minimum without :,? and / instructions I only need 18 instructions:
Code: Select all
...
BTW: To print the minimum without :,? and / instructions I only need 18 instructions:
Code: Select all
...
-
- Posts: 61
- Joined: Wed Apr 30, 2008 3:31 am
Nice.efe wrote:OK, here is my solution:
It's pretty neat, isn't it?Code: Select all
...
BTW: To print the minimum without :,? and / instructions I only need 18 instructions:
Code: Select all
...
I have similar solution but the loop is in other direction and so it's 60 instructions long.
Code: Select all
.....
It works for numbers starting with 1 and with difference no more 1242 to fit into cycle limit.
Last edited by the_impaler on Wed Dec 24, 2008 1:26 am, edited 1 time in total.
I more or less had the same solution as snibril, the same concept anyway. I can find a nice evolution is my solutions for this line of puzzles. They are getting more and more specific to the input that is used in the tests.
For the first puzzle, I had one that even worked with negative numbers, only limitation was that the difference squared is still an integer. I haven't tested it with large numbers myself, but I think it was still making the cycle limit.
For the second one it only worked for positive numbers, but the limitation about the difference dropped. The code was actually a lot nicer then the first challenge, and I don't see any problems with the cycle limit for any size of numbers.
And now for the last one, it is limited to the small range that the test cases are made of. When the range extends, it will become pretty hard to get it working within the cycle limit.
For the first puzzle, I had one that even worked with negative numbers, only limitation was that the difference squared is still an integer. I haven't tested it with large numbers myself, but I think it was still making the cycle limit.
For the second one it only worked for positive numbers, but the limitation about the difference dropped. The code was actually a lot nicer then the first challenge, and I don't see any problems with the cycle limit for any size of numbers.
And now for the last one, it is limited to the small range that the test cases are made of. When the range extends, it will become pretty hard to get it working within the cycle limit.
Loop? It is possible to do loops without condition testing? Hm good to know... thanks for the hintthe_impaler wrote: Nice.
I have similar solution but the loop is in other direction and so it's 60 instructions long.
Well all I can imagine is infinity loops but somewhen you have to stop.
I had an idea about implementing the challenge's solution quite nice and short but I just thought loops are not possible anyway so I forgot that idea and did it with the dirty filling spaces solution (mine is >7k, I considered that the differences between the numbers could be quite large)
It's a pity that the codes are not there anymore but I guess they would reveal too much for the "Brokenest keys" challenge
-
- Posts: 144
- Joined: Fri Mar 28, 2008 11:29 pm
- Location: #hacker.org on Freenode
My code, I guess, was like efes. It **** until it finds a number.
EDIT: After reading the Brokenest Keys thread, apparently this technique gives it away
Code: Select all
...
This I invented for challenge before, and it worked perfectly also in this
Code: Select all
20<>11<>32> 2<0^<8*g1+2>56+c 2<<1-<p!
my solution only works for positive integers
and require the small number smaller than the maximum cycles allowed
and require the small number smaller than the maximum cycles allowed
Code: Select all
0<1<+60<61<00>01>>>00^<g1+45*c-p