Added simple game logic.

Problem with getAvailMoves function, sometimes returns moves that are not availabe.