java小游戏代码24点的简单介绍( 三 )


y++ ;
result.add(tempS + "=24");
if (y == x) {
return result;
}
}
List temp1 = new ArrayList();
List temp2 = new ArrayList();
temp1.add(String.valueOf(a[0]));
temp1.add(String.valueOf(a[1]));
temp2.add(e[i]);
String temp = calculate24.bbb(temp2, temp1);
aa.clear();
aa.add(temp);
aa.add(String.valueOf(a[2]));
aa.add(String.valueOf(a[3]));
bb.clear();
bb.add(e[j]);
bb.add(e[k]);
s = "(" + a[0] + e[i] + a[1] + ")" + e[j] + a[2] + e[k]
+ a[3];
tempS = s;
s = calculate24.bbb(bb, aa);
if (Float.parseFloat(s) == 24) {
y++ ;
result.add(tempS + "=24");
if (y == x) {
return result;
}
}
temp1.clear();
temp2.clear();
temp1.add(String.valueOf(a[1]));
temp1.add(String.valueOf(a[2]));
temp2.add(e[j]);
temp = calculate24.bbb(temp2, temp1);
aa.clear();
aa.add(String.valueOf(a[0]));
aa.add(temp);
aa.add(String.valueOf(a[3]));
bb.clear();
bb.add(e[i]);
bb.add(e[k]);
s = a[0] + e[i] + "(" + a[1] + e[j] + a[2] + ")" + e[k]
+ a[3];
tempS = s;
s = calculate24.bbb(bb, aa);
if (Float.parseFloat(s) == 24) {
y++ ;
result.add(tempS + "=24");
if (y == x) {
return result;
}
}
temp1.clear();
temp2.clear();
temp1.add(String.valueOf(a[2]));
temp1.add(String.valueOf(a[3]));
temp2.add(e[k]);
temp = calculate24.bbb(temp2, temp1);
aa.clear();
aa.add(String.valueOf(a[0]));
aa.add(String.valueOf(a[1]));
aa.add(temp);
bb.clear();
bb.add(e[i]);
bb.add(e[j]);
s = a[0] + e[i] + a[1] + e[j] + "(" + a[2] + e[k]
+ a[3] + ")";
tempS = s;
s = calculate24.bbb(bb, aa);
if (Float.parseFloat(s) == 24) {
y++ ;
result.add(tempS + "=24");
if (y == x) {
return result;
}
}
temp1.clear();
temp2.clear();
temp1.add(String.valueOf(a[0]));
temp1.add(String.valueOf(a[1]));
temp1.add(String.valueOf(a[2]));
temp2.add(e[i]);
temp2.add(e[j]);
temp = calculate24.bbb(temp2, temp1);
aa.clear();
aa.add(temp);
aa.add(String.valueOf(a[3]));
bb.clear();
bb.add(e[k]);
s = "(" + a[0] + e[i] + a[1] + e[j] + a[2] + ")" + e[k]
+ a[3];
tempS = s;
s = calculate24.bbb(bb, aa);
if (Float.parseFloat(s) == 24) {
y++ ;
result.add(tempS + "=24");
if (y == x) {
return result;
}
}
temp1.clear();
temp2.clear();
temp1.add(String.valueOf(a[1]));
temp1.add(String.valueOf(a[2]));
temp1.add(String.valueOf(a[3]));
temp2.add(e[j]);
temp2.add(e[k]);
temp = calculate24.bbb(temp2, temp1);
aa.clear();
aa.add(String.valueOf(a[0]));
aa.add(temp);
bb.clear();
bb.add(e[i]);
s = a[0] + e[i] + "(" + a[1] + e[j] + a[2] + e[k]
+ a[3] + ")";
tempS = s;
s = calculate24.bbb(bb, aa);
if (Float.parseFloat(s) == 24) {
y++ ;
result.add(tempS + "=24");
if (y == x) {
return result;
}
}
temp1.clear();
temp2.clear();
temp1.add(String.valueOf(a[0]));
temp1.add(String.valueOf(a[1]));
temp2.add(e[i]);
temp = calculate24.bbb(temp2, temp1);
List temp3 = new ArrayList();
List temp4 = new ArrayList();
temp3.add(String.valueOf(a[2]));
temp3.add(String.valueOf(a[3]));
temp4.add(e[k]);
String temp11 = calculate24.bbb(temp4, temp3);
aa.clear();
aa.add(temp);
aa.add(temp11);
bb.clear();
bb.add(e[j]);
s = "(" + a[0] + e[i] + a[1] + ")" + e[j] + "(" + a[2]
+ e[k] + a[3] + ")";
tempS = s;
s = calculate24.bbb(bb, aa);
if (Float.parseFloat(s) == 24) {

推荐阅读