Refactored code to remove redundancy

Removed redundancy in playGameAI which copy pasted a lot of code for
human vs AI, AI vs human, and AI vs AI