Created
April 26, 2012 15:51
-
-
Save bholzer/2500528 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
public class Card{ | |
private static String[] pairArray={"A,A","K,K","Q,Q","J,J","10,10","9,9","8,8","7,7","6,6","5,5","4,4","3,3","2,2"}; | |
public static void generateRandom(int k){ | |
int minimum = 0; | |
int maximum = 13; | |
for(int i = 1; i <= k; i++) | |
{ | |
int randomNum = minimum + (int)(Math.random()* maximum); | |
System.out.print("Player " + i +" , You have been dealt a pair of: "); | |
System.out.println(pairArray[randomNum]); | |
} | |
} | |
public static void main(String[] args) { | |
Scanner scan = new Scanner(System.in); | |
System.out.print("How many players? "); | |
int m = scan.nextInt(); | |
generateRandom(m); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment