It learns to get closer to the apple by rewarding it if it gets it's new high score (distance to apple.) Sometimes an output (moving down, right, left or up) will be so low, it will never learn to do it. Make sure to click the green flag after about 30 generations if Bob hasn't gotten closer. Press "s" to toggle the "Best Generation" list. Press "r" to hide it. Press "e" to implement a neural network. I have a rewarding system, but I don't have any idea how to do a punishment system. It doesn't matter though. It works. Edit: I've just figured out how to do a punishment system, but, sadly, I'm not going to implement that into this project. I will, though, if I can make another project with Bob.
A little neural network I made. Since I'm learning it in school, I thought it would be cool to make one on Scratch. Make sure to post your neural networks in the comments! If anyone is wondering how you use the "Implement your own neural network," just ask in the comments. I also added the ability to move the food. The best brain Bob could get to: 1.513647846822038 -2.600932771909367 -5.026867735909125 -0.04155078282528146 -4.177185014931538 -1.484225952771 1.76443025666511 -1.3001296659033197 -0.3501852883059211 4.639692187533527 3.6625010814312353 -3.90773692476 -4.630702355877825 -5.2168215613426145 -0.13298830611865542 3.968085343631612 -2.4567179399062864 -2.9269680140 2.358775770638109 2.1826983576377272 0.08466838213