Login | Register

RoboZZle Forums

Forums / Puzzles / Intricate math

Thread for puzzle Intricate math. Hints are OK, but please no full solutions.

 

Log in to comment.

I'm sorry, I forgot that this puzzle has such test case. I just tried to implement some solution similar to "Intricate math II", but I got code that calculates something strange. It was possible to round it up and get sqare root (not sure that it would be general solution, anyway red in root section is problem, but existing case is still solvable). I fixed couple of other problems, and understood that this algorithm would never get last star. Possibly it was your first attempt.

Smylic, 34 months ago.

You mean reds in the square root section? You need to adapt the simple algorithm to handle that, but there's a nice way to do that.

keba, 34 months ago.

If I think about short algorithm in right direction it would fail on this:
http://robozzle.com/index.aspx#design/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaiBABBBBayaaaaayaaBBBBtlaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaWcufaa
Intended algorithm wouldn't.

Smylic, 34 months ago.

The algorithm is easy and beautiful once you figure it out. For those interested, I would recommend solving "Intricate math II" first, since it is more clean. It is noteable that the alorithm is general and works for any perfect square.

edsaw, 34 months ago.

Yes, I need to invent new algorithm. I tried to implement my current algorithm from scratch and got same length (but implementation itself is slightly different).

Smylic, 34 months ago.

19 actually, I had some leftovers from previous attempt. No tricky optimisation either, it's a straightforward implementation of the algorithm.

keba, 34 months ago.

I knew that overlapping path would prevent many solutions. And it was hard to make such field where my own solution works fine.

I expected you would find shorter solution, but length 21 is beyond praise. I'll try to optimize something...

Smylic, 34 months ago.

Never mind, I found fix that made solution much more satisfying too. My previous attempt wasn't calculating exact square root, it would round off the answer it found, but current solution calculates exactly.

keba, 34 months ago.

Overlapping path is preventing my solution again.

keba, 34 months ago.

Previous page (1 / 1) Next page

©2009 Igor Ostrovsky and other contributors. Terms of use