⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dictionary.java

📁 WebHangman a game can be play on the website contain the total code of JAVA
💻 JAVA
字号:
package com.aztsoft.games.dict;

import java.util.Random;

/**
 * class Dictonary is a facade for the genereated Dict_ classes
 * It can return a random dictionary entry
 */
public class Dictionary {
    private static Random random = new Random();
    public static int MAX_SIZE = Dict_A.targetKeywordsTotalLength + Dict_B.targetKeywordsTotalLength + Dict_C.targetKeywordsTotalLength;

    public static synchronized int getRandomIndex() {
        return (int) (Math.abs(random.nextInt() % MAX_SIZE));
    }

    public static String getTargetKeyword(int index) {
        String keyword = "keyword";
        keyword = Dict_A.getTargetKeyword(index);
        return keyword;
    }

    public static synchronized String getTargetKeywordToUpper(int index) {
        String keyword = getTargetKeyword(index);
        keyword = keyword.toUpperCase();
        return keyword;
    }

    public static synchronized int[] getTargetLanguageUpperCharSet() {
        int arr[];
        int size = 26;
        int offset = 65;
        arr = new int[size];
        for (int i = 0; i < arr.length; i++) {
            arr[i] = offset + i;
        }
        return arr;
    }

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -