|
package jpoker;
public class JCard {
public static char estraiSEME() {
char ch = ' ';
switch ((int) (Math. round(Math. random() * 3 ) + 1 )) {
case 1:
ch = 'f';//fiori
break;
case 2:
ch = 'p';//picche
break;
case 3:
ch = 'q';//quadri
break;
case 4:
ch = 'c';//cuori
break;
}
return ch;
}
if (x.equals(t)) {
return estraicarta (x, String. valueOf((int) (Math. round(Math. random() * 12 ) + 1 )) + estraiSEME ());
}
return t;
}
if (x.equals(t) || y.equals(t)) {
return estraicarta (x, y, String. valueOf((int) (Math. round(Math. random() * 12 ) + 1 )) + estraiSEME ());
}
return t;
}
if (x.equals(t) || y.equals(t) || z.equals(t)) {
return estraicarta (x, y, z, String. valueOf((int) (Math. round(Math. random() * 12 ) + 1 )) + estraiSEME ());
}
return t;
}
if (x.equals(t) || y.equals(t) || z.equals(t) || h.equals(t)) {
return estraicarta (x, y, z, h, String. valueOf((int) (Math. round(Math. random() * 12 ) + 1 )) + estraiSEME ());
}
return t;
}
}
|
|