Refactored main() function: added init(), checkWin() & checkLose(). Fixes #5