Langton's Ant implementation in JavaScript