The program wrote during my education on courses Javarush. Buttons for operating the game:
- move tiles with arrows(up, down, left, right)
- 'Esc' for restarting the game
- 'Z' for rolling back
- 'R' for random move(random choose of direction, only)
- 'A' for auto move(program looking for the best move). Not a strong strategy, but you could modify as you wish :))