欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

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)