Update main.cpp

Fix segmentation fault, fix a bit of logic, implement lose-checking, move input validation to Player class.