Html5 puzzle game brain