Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
(+1)

Yeah...so...second update after 2 hours i was able to do something using the brainfuck logic and JS and it did take more time than i banked on.

I'll keep this one detailed since people who are not familiar with Langton's Ant and Brainfuck get an idea of what it does. You can ofcourse have  a look at the Literal Definition here, in short it's a two-dimensional cellular automaton where an ant moves on a b/w grid, turning based on the color of the square it enters: if it is white turn right and flip black and vice versa. 

How it plays
1. Click any cell to drop food (not the ant's own cell). You get 200 "thoughts" one per step. 
2. The ant runs automatically from the center, facing left.

What happens each step

- Flips its cell: white turns it right, black turns it left exactly how Langton's ant behaves.
- Sniffs straight ahead up to 6 cells. If it smells food, it works out which direction to face and steers toward it; otherwise it wanders on a totally random turn.
- That decision is chosen by a 39-character Brainfuck program (,>,>,[->+<]<<[>>>[-]<<[->>+<<]<[-]]>>>.) fed three inputs: food nearby, desired turn, random turn. 
- It returns desired if food is nearby, else random. Too basic for now but impressed that i made it exactly how Langton's work till now.

You just have a win condition, reach food in less than 200 thoughts and it's done; or you lose, in lose you've two conditions either you just escape (touch the ends) or die (run out of thoughts) :*(( 

I am planning to upgrade the base now and check on levels rather than making it just 205 lines of code of basic functions and let the mutations and arena more free to the players logic since it's supposed to be strategical (i decided that i'd try obfuscation if it gets any longer removing abstractions and doing something unique but that's quite a waste of time for the time i've left i might do it later so keep following this page if you want to. :3