I am creating a card game (blackJack) in android. the first two cards are easy card1 and card2, however i want to press a Hit me button and deal a new card and assign it to card3, card4 etc is there any way to do this without essentially creating the maximum number of variables you would need and using if then statements to check if they have been assigned a value or not?
Share
Use a
Listto keep track of your dealt cards instead of having individual variables.you can then add and remove your cards easily,and dynamically.