Game 21
Game 21
import java.util.Scanner;
final static String INPUT =DASH +"\n"+ "Press 's' for \"Stand\" (not ask for another card) or 'h'
for \"hit\" (ask for another card)";
System.out.println("*********************************************************************");
System.out.println("*********************************************************************");
System.out.println("***************************************************");
drawRandomCard();
{
PrintOutput();
return;
// 2: Play the game further based on the user on the user decision
System.out.println(INPUT);
pickCards();
/* Main function where the user and the computer pickcards and all the conditions are
checked here
* Also user is asked to select the choice to stand or hit the card.
*/
System.out.println("Game Over!!!");
if(userScore<=21)
return;
PrintOutput();
return;
}
if(Character.toLowerCase(choice) =='h')
drawRandomCard();
PrintOutput();
return;
else
System.out.println(INPUT);
/*This function is to generate the minimum and maximum value of both user and computer
*/
for(int i=0;i<2;i++)
if(i==0)
else
userScore=userScore+CurrentUserCardValue;
*/
System.out.println("\nGame over!!!\n");
if(computerScore <=MAXIMUMCOMPUTERLIMIT)
return;
return;