Page 1 of 2
Brokener Keys
Posted: Sat Dec 20, 2008 6:57 pm
by snibril
My program only works for numbers with a difference smaller than 300. Has someone a solution without this limitation?
Posted: Sat Dec 20, 2008 7:32 pm
by tog
I think you could enlarge the difference by just multiplying another 9
. But I wonder if there is a solution that isn't limited to some range of numbers.
Posted: Sat Dec 20, 2008 8:32 pm
by efe
My program is limited by the size of the memory.
It works only for numbers in the range [2..16384].
Due to the cycle limit I had to narrow it down even more to [2..1024].
Posted: Sat Dec 20, 2008 11:40 pm
by m!nus
numbers are 1-256 so no need for bigger limits.
did you do it with lots of spaces aswell?
Posted: Sun Dec 21, 2008 12:37 am
by efe
No, there are no spaces in my program.
It's only 24 instructions long and it can be made even shorter.
Posted: Sun Dec 21, 2008 7:27 am
by snibril
I don't like my solution:
1<0<1<-25*0^*3*+2*c {Spaces till pos. 600}p! {min. 600Spaces}0<p
Posted: Sun Dec 21, 2008 10:18 am
by m!nus
efe: i'd love to see how your method works, because mine, with its 2KB of spaces isn't very nice.
Posted: Sun Dec 21, 2008 12:40 pm
by efe
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:
Posted: Sun Dec 21, 2008 1:14 pm
by snibril
I had a similar idea, but I didn't find a function that always give me a zero except for one specific value. I didn't think to use the memory for this.
Posted: Mon Dec 22, 2008 5:03 am
by the_impaler
efe wrote: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:
Nice.
I have similar solution but the loop is in other direction and so it's 60 instructions long.
I had to take special precautions for neighboring numbers and for equal numbers
It works for numbers starting with 1 and with difference no more 1242 to fit into cycle limit.
Posted: Tue Dec 23, 2008 10:04 am
by Karian
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.
Posted: Tue Feb 10, 2009 5:44 pm
by theStack
the_impaler wrote:
Nice.
I have similar solution but the loop is in other direction and so it's 60 instructions long.
Loop? It is possible to do loops without condition testing? Hm good to know... thanks for the hint
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
Posted: Wed May 27, 2009 12:56 am
by therethinker
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
Posted: Mon Mar 08, 2010 6:46 pm
by jonik555
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!
Posted: Sun Aug 01, 2010 3:55 pm
by arthur
my solution only works for positive integers
and require the small number smaller than the maximum cycles allowed