Monday October 19, 2015
This problem challenges you to write a model of a popular cellular automaton in JavaScript.
Langton's Ant is a popular cellular automaton. The Wikipedia page for it provides a decent introduction: https://en.wikipedia.org/wiki/Langton's_ant
Your challenge is to write a version that uses JavaScript to model the ant through 200 iterations, assuming the ant starts in a white cell in the center of the grid, facing left (immediately turning right and changing the cell beneath it to black).
A working version of the code is provided in obfuscated JavaScript as part of the "Langton's Ant in JavaScript starter zip file" below. Your task is to replace the langton.js file with one of your own writing.
Your challenge is to write a version that uses JavaScript to model the ant through 200 iterations, assuming the ant starts in a white cell in the center of the grid, facing left (immediately turning right and changing the cell beneath it to black).
A working version of the code is provided in obfuscated JavaScript as part of the "Langton's Ant in JavaScript starter zip file" below. Your task is to replace the langton.js file with one of your own writing.
Show solution
Challenge Resources:
Langton's Ant in JavaScript starter zip file
—
zip file containing starter code for the Langton's Ant in JavaScript challenge problem.
Langton's Ant in JavaScript solution zip file
—
zip file containing a solution for the Langton's Ant in JavaScript challenge problem.
©1994-2024
|
Shodor
|
Privacy Policy
|
NSDL
|
XSEDE
|
Blue Waters
|
ACM SIGHPC
|
|
|
|
|
|
XSEDE Code of Conduct
|
Not Logged In. Login