java单词随机产生
程序员文章站
2022-07-10 18:39:19
...
直接上代码
用javagui实现随机单词答题游戏可以看着篇随机单词答题游戏(java gui)
//随机产生单词
private String RandomWords() {//产生随机单词
String[] s = {"good", "cheer", "strive", "optimistic", "hello", "word", "tercher", "student",
"book", "genius", "handsome", "beautiful", "health", "happy", "exercice", "computer",
"english", "jspanese", "eat", "me","reset","center","blue","green","yellow"};
int b = ran.nextInt(21);//定义随机数区间[0,20]
return s[b];
}
用javagui实现随机单词答题游戏可以看着篇随机单词答题游戏(java gui)
上一篇: 如何进行开源贡献
下一篇: Java生成随机编号