Refactored main() function: added init(), checkWin() & checkLose()