import java.util.*;
public class ruko {
public static void main(String[] args) {
Map <String,String> map = new HashMap<>();
map.put("I","我");
map.put("am","是(第一人称)");
map.put("aah","啊");
map.put("hello","你好");
map.put("hi","嗨");
map.put("ooh","嗬");
map.put("goodbye","再见");
map.put("bye-bye","拜拜");
map.put("are","是(第二人称)");
map.put("good","好的");
map.put("morning","上午");
map.put("fine","健康");
map.put("thank","谢谢");
map.put("you","你,你们");
map.put("Ms","女士");
map.put("boy","男孩");
map.put("girl","女孩");
map.put("whoops","喔哟");
map.put("and","和");
map.put("too","也");
map.put("haha","哈哈");
map.put("what","什么");
map.put("is","是(第三人称)");
map.put("your","你的,你们的");
map.put("name","名字");
map.put("please","请");
map.put("afternoon","下午");
map.put("Mr","先生");
map.put("point","指");
map.put("to","向");
map.put("the","这个,那个");
map.put("door","门");
map.put("sit","坐");
map.put("down","下,向下");
map.put("stand","站");
map.put("up","上,向上");
map.put("window","窗户");
map.put("blackbord","黑板");
map.put("bird","鸟");
map.put("tweet","鸟叫声");
map.put("desk","桌子");
map.put("chair","椅子");
map.put("it","它");
map.put("red","红色");
map.put("look","看");
map.put("wow","哇");
map.put("yellow","黄色");
map.put("blue","蓝色");
map.put("a","一个");
map.put("chameleon","变色龙");
map.put("my","我的");
map.put("panda","熊猫");
map.put("now","现在");
map.put("green","绿色");
map.put("black","黑色");
map.put("dog","狗");
map.put("cat","猫");
map.put("cap","帽子");
map.put("one","一");
map.put("two","二");
map.put("three","三");
map.put("four","四");
map.put("five","五");
map.put("six","六");
map.put("seven","七");
map.put("eight","八");
map.put("nine","九");
map.put("oh","哦");
map.put("ten","十");
map.put("eleven","十一");
map.put("twelve","十二");
Scanner scan = new Scanner(System.in);
Random rand = new Random();
System.out.println("欢迎使用外研版英语单词记忆测评系统V0.1.0");
System.out.println("‘1’为三年级上册");
System.out.print("请输入:");
String a = scan.next();
int fan = 100;
int go = 1;
String[] tup1 = {"I","am","aah","hello","hi","ooh","goodbye","bye-bye","are","good","morning",
"fine","thank","you","Ms","boy","girl","whoops","and","too","haha","what",
"is","your","name","please","afternoon","Mr","point","to","the","door","sit",
"down","stand","up","window","blackbord","bird","tweet","desk","chair","it",
"red","look","wow","yellow","blue","a","chameleon","my","panda","now","green",
"black","dog","cat","cap","one","two","three","four","five","six","seven",
"eight","nine","oh","ten","eleven","twelve"};
if (a.equals("1")) {
for (;go <= 100;go += 1) {
String n = tup1[(int) Math.floor(Math.random()*tup1.length)];
Object c = map.get(n);
System.out.print("请输入" + c + "的英语意思:");
String b = scan.next();
if (b.equals(n)) {
System.out.println("答对了!");
} else {
System.out.println("答错了!");
System.out.println("正确答案是:" + n);
fan -= 1;
System.out.println("得分:" + fan);
}
}
String[] tup2 = {"I","am","aah","hello","hi","ooh","goodbye","bye-bye","are","good","morning",
"fine","thank","you","Ms","boy","girl","whoops","and","too","haha","what",
"is","your","name","please","afternoon","Mr","point","to","the","door","sit",
"down","stand","up","window","blackbord","bird","tweet","desk","chair","it",
"red","look","wow","yellow","blue","a","chameleon","my","panda","now","green",
"black","dog","cat","cap","one","two","three","four","five","six","seven",
"eight","nine","oh","ten","eleven","twelve"};
tup1 = tup2;
}
if (!a.equals("1") && !a.equals("2") && !a.equals("3") && !a.equals("4") && !a.equals("5") && !a.equals("6") && !a.equals("7") && !a.equals("8")) {
System.out.println("错误!");
}
}
}
按这样出题会出现重复的题目,我就想删掉出过的题目在tup1数组中的值,出完题后将tup2数组中的内容插回tup1。
但是一直不知道怎么删掉。