A Robot path problem – SydJS June 2012 by Filippo Vitale
Published June 20, 2012 in Programming
A Robot path problem helped me realise I still love JavaScript
Project Euler 208 – https://projecteuler.net/problem=208
4. One-minute Rule
"My program takes days to get to the answer!"
Each problem has been designed according to a
"one-minute rule", which means that although it
may take several hours to design a successful
algorithm with more difficult problems, an efficient
implementation will allow a solution to be obtained
on a modestly powered computer
in less than one minute.
9. Project Euler - Problem 208
A robot moves in a series
of one-fifth circular arcs
(72°)
10. Project Euler - Problem 208
A robot moves in a series
of one-fifth circular arcs
(72°)
with a free choice of
■ a clockwise or
■ an anti-clockwise arc for each step
but no turning on the spot.
11. Project Euler - Problem 208
One of 70932 possible closed paths of 25 arcs
12. Project Euler - Problem 208
Given that the robot starts facing North:
How many journeys of 70 arcs in
length can it take that return it, after
the final arc, to its starting position?
(Any arc may be traversed multiple times)
http://projecteuler.net/problem=208
42. Move left, move right
How can we rotate a point on a plane?
http://www.wolframalpha.com/input/?i=%7B100%2C+0%7D+72%C2%B0+rotation
43. Move left, move right
How can we rotate a point on a plane?
http://www.wolframalpha.com/input/?i=%7B100%2C+0%7D+72%C2%B0+rotation
http://www.wolframalpha.com/input/?i=with+center+%7B-50%2C0%7D+rotate+72+deg+%7B50%2C0%7D
44. Move left, move right
http://www.wolframalpha.com/input/?i=%7B100%2C+0%7D+72%C2%B0+rotation