Problem 288 - Langtons Ant

Back to General discussions forum

sam_bandara     2023-01-11 01:57:48

Hello Experts,

My code takes forever to run even though I used pypy3 :-) The code works quite fast for small numbers (less than 10^8)but not for larger numbers. I submitted a wrong answer to submit the code for you guys to inspect. Can you guys please suggest a different approach?

Cheers, Sam.

zelevin     2023-01-11 05:52:32

Perhaps some sort of an online encyclopedia would be useful in suggesting a way not to iterate for every, um, iteration?

sam_bandara     2023-01-12 03:40:22

Thanks mate! I will find a way :-)

sam_bandara     2023-01-13 00:20:20

Hi Zelevin, Is this problem fall under any advanced programming concepts? or it just a simple (sorry for the word :-) ) strightforward one. Can you give me a hint please? I noted the word "Celluar Automation" every where. :-)

Cheers.

zelevin     2023-01-13 00:27:38

Naah, it does not fall under any advanced concepts (it is a cellular automaton, but the problem's description covers everything you need to know about that). But do read the Wikipedia article.

sam_bandara     2023-01-13 00:51:36

Thanks for the tip mate. I noted this :-) "Three distinct modes of behavior are apparent"

sam_bandara     2023-01-15 23:40:16

Done and Dusted!!! Thanks Zelevin,

Please login and solve 5 problems to be able to post at forum