Fill a grid with the numbers 0 to 3, then send an ant in from the left. Each number tells it how to turn. Keep it inside for as long as you can, on every grid from 10 × 10 to 34 × 34.
0, 1, 2 or 3. The easiest way is the grid itself: 4:, then one line per row of the grid. Spaces and line breaks between cells don't matter, so all 100 digits of a 10 × 10 grid on one line works too.How the scoring works, with three players. On 10 × 10, Ana’s best grid takes 200 steps, Ben’s 150 and Cleo’s 100. The most anyone has found is 200, so they score 1, 0.75 and 0.5. On 11 × 11, Ben has the record with 300 steps and Ana has 240, so Ben scores 1 and Ana 0.8; Cleo hasn’t sent one, so Cleo scores 0. The totals: Ana 1.8, Ben 1.75, Cleo 0.5. Now Cleo finds a 10 × 10 grid that takes 400 steps. That’s the new record, so Cleo scores 1 there, and Ana and Ben drop to 0.5 and 0.375. The totals become Ben 1.375, Ana 1.3, Cleo 1. Ben has passed Ana without sending anything: your score can go down when someone else finds something better.
Where this came from. Chris Langton invented his ant in 1986, in his paper “Studying artificial life with cellular automata”: it turns right on white, left on black, and flips the colour as it goes. Wikipedia has a good introduction to Langton’s ant. Greg Turk and Jim Propp gave the ant more colours, and A. K. Dewdney named the whole family turmites in his Scientific American column. Ours has four colours, and its numbers are simply how far it turns. The question this contest asks, how long an ant can be kept inside a box, comes from Kossi Roland Etse’s study of Langton’s ant (see also OEIS A282425). As far as Kossi Etse knows, nobody has studied the four-color version before, so every record here is new. Shut this ant in a box and it always escapes too, because every move can be undone: a walk that looped forever would have to lead back to the moment the ant walked in. How long can you keep it inside? Nobody knows.
For your own scripts. The best known for every size, with no grids, is at /api/contest/antescape/records (JSON), or add ?format=csv for a spreadsheet. Please use that rather than reading the leaderboard page: its format won’t change, and it updates every minute.
Tested by Dmitry Kamenetsky. Dmitry was the first to play Ant Escape, and he put it through its paces before launch. Many of his ideas are now part of it: sending grids one line per row, the Path and Visits views in the viewer, the Java and C++ scoring code, the satellite mark on the leaderboard, and the certificates in the Prizes. Thank you, Dmitry!
As on the original site, here is the code that scores every entry, so you can check your own before you send it. It's written to be easy to read, not fast. Each version reads one entry per line and prints its score. We've checked all six against the site on over a thousand test grids, good and bad.
Why QBasic? It's the first programming language Neil, who runs ISS, ever learned, and this version is a nod to that. QBasic can't read typed-in input the way the others do, so it reads your entries from GRIDS.TXT and saves its answers in RESULTS.TXT.
Loading…
Your concern goes to Neil privately. Nothing shows on the board, and he keeps your name to himself. If it needs talking through, he opens a thread on Discord, where the player can answer.
When the contest closes, everyone who sent an entry gets a certificate showing their rank and their leaderboard. The top three on each leaderboard, By Satellite and By Lantern, also get a gold, silver or bronze medal certificate.
Your results may also add to what’s known. Nobody has studied this ant before, so every record set here is new. When the contest closes, every grid sent becomes public for anyone to study, and the results may be shared with the OEIS, the On-Line Encyclopedia of Integer Sequences, where mathematicians record findings like these.
Infinite Search Space is free to play, and always will be. We’re always glad to hear from anyone who’d like to sponsor a prize, especially anything to do with science, technology, engineering or math. Digital prizes work best, such as software licenses or online subscriptions, because our players are spread all over the world. If that’s you, please get in touch.