yaworsw/euler-manager

View on GitHub
data/problems/349.yml

Summary

Maintainability
Test Coverage
---
:id: 349
:name: Langton's ant
:url: https://projecteuler.net/problem=349
:content: "An ant moves on a regular grid of squares that are coloured either black
  or white.  \n The ant is always oriented in one of the cardinal directions (left,
  right, up or down) and moves from square to adjacent square according to the following
  rules:  \n- if it is on a black square, it flips the color of the square to white,
  rotates 90 degrees counterclockwise and moves forward one square.  \n- if it is
  on a white square, it flips the color of the square to black, rotates 90 degrees
  clockwise and moves forward one square.\n\nStarting with a grid that is entirely
  white, how many squares are black after 10<sup>18</sup> moves of the ant?\n\n"