import java.util.Random;
import java.util.Scanner;


public class Blackjack {

/**
* @param args
*/
@SuppressWarnings("static-access")
public static void main(String[] args) {
{
// TODO Auto-generated method stub

Random generator = new Random();
Scanner myscanner = new Scanner(System.in);

System.out.println(
" ____ _ _ _ _ ___ __ \n"+
"| _ \\| | | | (_) | | |__ \\/_ |\n"+
"| |_) | | __ _ ___| | ___ __ _ ___| | __ ) || |\n"+
"| _ <| |/ _` |/ __| |/ / |/ _` |/ __| |/ / / / | |\n"+
"| |_) | | (_| | (__| <| | (_| | (__| < / /_ | |\n"+
"|____/|_|\\__,_|\\___|_|\\_\\ |\\__,_|\\___|_|\\_\\ |____||_|\n"+
" __/ |Super Asian Edition 1.2 \n"+
" |__ / \n"



);

int score = 0;
int dealerScore = 0;
boolean playAgain = true;
while(playAgain) {
int sum = 0;
System.out.println("Do you want to play BLACKJACK 21 SUPER ASIAN EDITION!?!?! > !!!!? Y/N");
String play = myscanner.next();



if(play.compareToIgnoreCase("y")==0 || play.compareToIgnoreCase("h")==0 || play.compareToIgnoreCase("s")==0 )
{

int card1 = generator.nextInt(11)+1;



System.out.println("Card : " + card1+" "+ getSuit());
String hit ="h";
sum = card1;

do
{

int cards = generator.nextInt(11)+1;
System.out.println("Card : "+cards+" "+getSuit());

sum += cards;
System.out.println("Total : "+sum);



if(sum==21){
System.out.println("Blackjack! You win.");
score+=2;
System.out.println("Your score is :"+ score);
System.out.println("The dealers score is:"+dealerScore);
}
else if(sum>21){
System.out.println("You bust fool.");
dealerScore++;
System.out.println("Your score is :"+ score);
System.out.println("The dealers score is:"+dealerScore);
} else {
System.out.println("Hit or stay?");
hit = myscanner.next();
}

} while(hit.compareTo("h")==0&& sum<21);
//End of while

//IF STAY FIND DEALER COUNT
if(sum<21) {
int counter = 0;
int dealersum = 0;
do
{
int dealersCards = generator.nextInt(11)+1;

System.out.print("Dealer's card :"+ dealersCards+" "+getSuit());

dealersum += dealersCards;
System.out.println("Dealer Total : "+dealersum);

if(dealersum>21){
System.out.println("Dealer bust, you win.");
score++;
System.out.println("Your score is :"+ score);
System.out.println("The dealers score is :"+dealerScore);

}

}while(dealersum<16);

if(dealersum<sum){
System.out.println("You win.");
score++;
System.out.println("Your score is :"+ score);
System.out.println("The dealers score is:"+dealerScore);
}
else if(dealersum>sum&&dealersum<=20){
System.out.println("Dealer wins.");
dealerScore++;
System.out.println("Your score is :"+ score);
System.out.println("The dealers score is :"+dealerScore);
}
else if(dealersum==sum){
System.out.println("Draw. Dealer wins.");
dealerScore++;
System.out.println("Your score is :"+ score);
System.out.println("The dealers score is:"+dealerScore);
}

else if(dealersum==21){
System.out.println("Dealer got blackjack, you lose.");
dealerScore++;
System.out.println("Your score is :"+ score);
System.out.println("The dealers score is:"+dealerScore);

}




} else {

}

//COMPARE DEALER vs PLAYER

}
else if(play.compareTo("n")==0)
{
System.out.println("YOU MADE THE WRONG CHOICE CUZ THIS GAME IS SO SUPER SICK!!");
System.out.println("Copyright 2009 Kyle Sargent and Joey Smith. All rights reserved.");
try {
Thread.currentThread().sleep(3000);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
System.exit(0);

}
else
{
System.out.println("Wrong button, try again.");
}
}
}



}

public static String getSuit(){
Random generator = new Random();
int suit = generator.nextInt(4)+1;
String suitAsString= "";

switch (suit){
case 1:
suitAsString = "of Spades. ";
break;
case 2:
suitAsString = "of Hearts. ";
break;
case 3:
suitAsString = "of Clubs. ";
break;
case 4:
suitAsString = " of Diamonds. ";
break;
}


return suitAsString;
}


}
For this to run you must name the class Blackjack.

It is text based.