Source: Sporifica Virus
Part 1: Implement a cellular automaton on an infinite grid of
.
and#
pixels such that:
- Start at
(0, 0)
, facingUp
- Repeat:
- If the cursor is on
.
swap it to#
and turnLeft
- If the cursor is on
#
swap it to.
and turnRight
- Either way, after turning, move forward once
After 10,000 iterations, how many pixels were turned from
.
to#
?