WinnieCWu / robot-gladiators

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Player Name Prompt Error Handling

WinnieCWu opened this issue · comments

Expected Behavior

If the prompt for player name is left blank or cancelled, a new prompt should be re-requesting the player's name

Current Behavior

If prompt for player is left blank, that answer is stored as the player's name.
If prompt is cancelled, null is stored as the player's name

Possible Solution

Create function getPlayerName() that will loop until a valid response can be returned

Created function getPlayerName() to bypass the issue

Resolved player name prompt issue