Implementation of Langton's ant in Java Script