[game] refactored with win and fail functions