News for hackers. Stuff that matters.
Re:Show HN: Square Game by bschne on Sunday September 01, 2019 @03:41PM (#20854325)
Looking at the bottom of the JS file [1], it looks like OP already started working on a genetic algorithm for this. I don't have time right now, but for anyone who's curious to try, you can just call

  myRPG.parseKeyPress({keyCode: 40})
replacing keyCode with the respective key's code, to automate moves. The global variable "dead" should tell you if you've failed, and "score.innerText" should tell you how well you've done :-)

1. https://smitop.com/square-game/rpg.js

Re:Show HN: Square Game by personjerry on Sunday September 01, 2019 @10:03PM (#20856261)
`mutate` in this code means "altering state". It does NOT hint at a "genetic algorithm". This game is solvable using floodfill where each floodfill state is a series of moves and the boundary condition is whether you've ended up alive or dead.
Re:Show HN: Square Game by numakerg on Sunday September 01, 2019 @06:13PM (#20855347)
I think living state, score and x,y position is all you would need to train a player. Is there any advantage to consuming the state of nearby cells if the game is entirely deterministic?