String temp_str_aa1 = String.valueOf(temp_aa1); String temp_str_aa2 = String.valueOf(temp_aa2); String temp_str_aa3 = String.valueOf(temp_aa3); String temp_str_aa4 = String.valueOf(temp_aa4); if(str.equals(\ {
tf.setText(\你没有输入,是空的\ } else {
if(count==1&&flag==true) {
if(str.equals(create_str)) {
tf.setText(\你真厉害,一次就猜中了呵呵\ count++; flag = false; }
- 21 -
else { count++;
if(temp_aa1==temp_bb1) { x++; }
if(temp_aa2==temp_bb2) { x++; }
if(temp_aa3==temp_bb3) { x++; }
if(temp_aa4==temp_bb4) { x++;
- 22 -
}
if(((create_str.indexOf(temp_str_aa1))!=-1)&&(temp_aa1!=temp_bb1)) { y++; }
if(((create_str.indexOf(temp_str_aa2))!=-1)&&(temp_aa2!=temp_bb2)) { y++; }
if(((create_str.indexOf(temp_str_aa3))!=-1)&&(temp_aa3!=temp_bb3)) { y++;
- 23 -
}
if(((create_str.indexOf(temp_str_aa4))!=-1)&&(temp_aa4!=temp_bb4)) { y++; } if(x==4) {
tf.setText(\恭喜你,终于答对了呵呵\ } else {
tf.setText(\没关系,才猜一次,继续!\猜中了\位置换错了\ } x = 0; y = 0;
- 24 -
相关推荐: