I Created An AI!

in #ai7 years ago

Quick Note: Big thanks to Arjes on Reddit, he basically revived my broken code

So I actually finished the AI on Saturday, I've just been trying to improve it recently. So to explain how it works, I'll use an analogy. (If you just want to check out the AI, click the link below and open the JavaScript console to view the results).
https://ninja25538.github.io/js-genetic-algo/

If you don't like analogies, you can know that it uses a simplified Genetic Algorithm in case you just want that info.

Imagine that you are very rich (because your father gave you a small loan of a million dollars) and you want some gold. You hire 50 (which is the case in the AI as I write this, it will hopefully change to 100 soon) people to go find some gold in a very dark cave. Since they can't see, they move around randomly, all of them keeping track of the steps they take so they can find their way back. Once one of them finds the gold, he goes back to you and the other 49 miners the steps he took. The other 49 miners are killed since they failed =(. You hire 50 more miners. Before the miner that found the gold leaves to retire, he tells the 50 new miners the path he took. They only generally remember it but the more steps you tell them, the more likely they are to forget the rest. The 50 new miners go into the mines, and if none of them find it before the original miner found it, they're all slaughtered. Repeat this process for a while, and you'll eventually find the best path to the gold. The more miners you hire, the quicker the process is.

I had 2 players (miners) at first, but I quickly changed the number to 50. You can fork the code as long as you follow the rules of the license. I encourage commits!
https://github.com/ninja25538/js-genetic-algo

Coin Marketplace

STEEM 0.19
TRX 0.15
JST 0.029
BTC 63188.04
ETH 2570.49
USDT 1.00
SBD 2.79