Bug 778

Summary: Need to handle card value input format errors
Product: 2023A CS3343 Group 33 Project Reporter: chris li <yiuhangli3-c>
Component: HumanStrategyAssignee: chris li <yiuhangli3-c>
Status: CONFIRMED ---    
Severity: major    
Priority: ---    
Version: unspecified   
Hardware: PC   
OS: Windows   

Description chris li 2023-11-13 11:18:16 HKT
Currently, the game requires a user to input card value. 

However, if the user input wrong format like "0" or "Blue", then the game will be crashed, because input[1] does not exist in new Card(input[0], input[1]).

Should modify the code the handle this case.

-----------------------------------------------------------------

Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: Index 1 out of bounds for length 1
	at Strategic.HumanStrategy.chooseCards(HumanStrategy.java:40)
	at Player.Player.executeStrategy(Player.java:81)
	at GameManager.GameManager.startTurn(GameManager.java:87)
	at Main.main(Main.java:59)