April 05
Prde. Ismael H. F. Santos -  ismael@tecgraf.puc-rio.br                                                          2
Exemplo Baralho
nclass Deal {
n public static void main(String args[]) {
n  int numMãos = Integer.parseInt(args[0]); int cartasPorMão = Integer.parseInt(args[1]);
n  // Constroi um baralho com as 52 cartas
n  String[] naipes = new String[] {”espadas",”copas",”ouro",”paus"};
n  String[] seq=new String[]{”ás","2","3","4","5","6","7","8","9","10",
n                                              ”valete",”dama", ”rei"};
n  List<String> baralho = new ArrayList<String> ();
n  for (int i=0; i<naipes.length; i++)
n    for (int j=0; j<seq.length; j++)
n      baralho.add(seq[j] + " de " + naipes[i]);
n  Collections.shuffle(baralho);
n  for (int i = 0; i < numMãos; i++)
n    System.out.println(escolheMão(baralho, cartasPorMão));
n } 
target =
"_self" - show in the current frame
"_parent" - show in the parent frame
"_top" - show in the topmost frame
"_blank" - show in a new unnamed top-level window
name - show in a new top-level window named name