AIs learn how to survive in a basic world. Based on ai-test, but with improved functionality and adaption. The goal is to make ai.js
easily adaptable to other simple games. If you want to try this with another game make a new game and make some minor edits to ai.js
.
When changing the inputs you can also use the special command __EXENOW(code_to_execute)__
to run code when the AI's genes are generated. For example if you'd put __EXENOW(Math.floor(Math.random() * max_genes))__
that would generate a random number that is the id of one of the AI's genes, which could for example become 5
. After execution all parts of the special command will be removed, only the result of the execution will be left in the genes and later executed in your own game.js
file.