/* package whatever; // don't place package name! */
import java.util.*;
import java.lang.*;
import java.io.*;
/* Testing black jack dealing code. */
class Ideone
{
{
int[][] values = initDeal(5);
for(int[] val : values)
{
// Cycle through each value and print out the hands.
System.
out.
println("First Card: " + val
[0] + "\nSecond Card: " + val
[1]); }
}
/**
* Supplied method for printing out the hands.
*/
public static int[][] initDeal(int NPlayers)
{
int hands[][] = new int[NPlayers][2];
for(int a = 0; a<NPlayers; a++)
{
hands
[a
][0] = (int)Math.
round((Math.
random() * 13))-1; hands
[a
][1] = (int)Math.
round((Math.
random() * 13))-1;
}
return hands;
}
}
LyogcGFja2FnZSB3aGF0ZXZlcjsgLy8gZG9uJ3QgcGxhY2UgcGFja2FnZSBuYW1lISAqLwoKaW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5sYW5nLio7CmltcG9ydCBqYXZhLmlvLio7CgovKiBUZXN0aW5nIGJsYWNrIGphY2sgZGVhbGluZyBjb2RlLiAqLwpjbGFzcyBJZGVvbmUKewoJcHVibGljIHN0YXRpYyB2b2lkIG1haW4gKFN0cmluZ1tdIGFyZ3MpIHRocm93cyBqYXZhLmxhbmcuRXhjZXB0aW9uCgl7CgkJaW50W11bXSB2YWx1ZXMgPSBpbml0RGVhbCg1KTsKCQlmb3IoaW50W10gdmFsIDogdmFsdWVzKQoJCXsKCQkJLy8gQ3ljbGUgdGhyb3VnaCBlYWNoIHZhbHVlIGFuZCBwcmludCBvdXQgdGhlIGhhbmRzLgoJCQlTeXN0ZW0ub3V0LnByaW50bG4oIkZpcnN0IENhcmQ6ICIgKyB2YWxbMF0gKyAiXG5TZWNvbmQgQ2FyZDogIiArIHZhbFsxXSk7CgkJfQoJfQoJCgkvKioKCSAqIFN1cHBsaWVkIG1ldGhvZCBmb3IgcHJpbnRpbmcgb3V0IHRoZSBoYW5kcy4KCSAqLwoJcHVibGljIHN0YXRpYyBpbnRbXVtdIGluaXREZWFsKGludCBOUGxheWVycykKICAgIHsKICAgICAgICBpbnQgaGF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