Page 3 of 3
Posted: Sun Jul 22, 2012 9:04 am
by Allosentient
AMindForeverVoyaging wrote:I'm still trying to find a way to tackle this challenge.
So my first idea was to use the formula of the
Archimedean spiral, but because of the jitter to the left and to the right this does not work, at least not without corrections of some kind.
Another idea I had to traverse the spiral goes something like this:
- 1.) Define possible directions as { up, up/right, right, right/down, down, down/left, left, left/up }
2.) Define starting point as (x,y) and starting direction as right
3.) Move (x,y) one pixel in current direction
4.) Compute "boundary pixels" of (x,y) in such a distance that they are just outside of the spiral, thus black.
5.) As soon as a "boundary pixel" is not black anymore, a direction in change is needed.
e.g. if current direction == right and lower boundary pixel is not black anymore, change to right/down
6.) Repeat 3. to 5. as needed
A problem with this is that this approach needs enough black space around the spiral bits to work, which is not always the case as can be seen in this magnified screenshot:
Image Link
So, how do people tackle this? Do you code an exception just for those cases, like filling the data there manually, and then defining a new starting point and direction? Is that a sensible approach?
Try using vector math. Calculate the approximate center of each "region" of the circle and then calculate the angle between it and the previous circle, and then travel in that direction until a new region is reached. Build a list of pixels to check when traveling "forward", pixels which "touch" the vector you are traveling. Rinse and repeat.
Posted: Sun Jul 22, 2012 9:43 am
by AMindForeverVoyaging
Thank you for the hint Allosentient.
Posted: Sat Dec 05, 2015 8:59 pm
by Hippo
Don't try to find formula for the spiral, you would hardly catch the random number generator probably used in the formula.
Try to implement some kind of "best match walk".
If I remember it well, I have drawn to the picture (copy) as the debug tool.
Yes I made green and red dots in the picture
... it really helped in debugging.
....I bet I got some information wrongly, but luckily the result was readable enough. I have solved it before I created tools for error recoveries for the "subresult".
So I think the tools could be helpful in localising the point of problem, but they are not crucial.
... this probably was not case of this challenge
Posted: Mon Dec 28, 2015 7:18 am
by Hippo
Maybe following the spiral is easier from one end than from the other.
Posted: Thu May 31, 2018 1:52 pm
by MrTerry
is some1 still here who solved this?
i cannot make sense out of these tipps and it drives me crazy.
What kind of encoding is this? some kind of variable length encoding or do i have to perform something with these bits?
Posted: Sat Jun 02, 2018 7:07 am
by Hippo
MrTerry wrote:is some1 still here who solved this?
i cannot make sense out of these tipps and it drives me crazy.
What kind of encoding is this? some kind of variable length encoding or do i have to perform something with these bits?
Try to write the bits to a file and look inside (in hex editor). ... Consider all symmetries.
... of course you can do first few bits by hand what did I and it gave me enough info.
Posted: Wed Jun 06, 2018 10:55 pm
by MrTerry
ok i m stupid. I thought about the symmetry aspect, but gave up just to early to realize. Many thanks!
Posted: Mon Jun 11, 2018 11:56 am
by Hippo
MrTerry wrote:ok i m stupid. I thought about the symmetry aspect, but gave up just to early to realize. Many thanks!
Enjoy post Spiral Bits challenges.
Posted: Sun Jun 17, 2018 12:44 pm
by MrTerry
I m having a blast! So far shattered and shuffled, maelstrom and hvm cipher belong to my favourite challenges ever. Even though especially hvm cipher wasnt that difficult. But fun! Glad I came back to hacker org after some years