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

📄 tools.java

📁 这是一款益智类经典游戏
💻 JAVA
字号:
/*
 * Tools.java
 *
 * Created on 2005年12月13日, 下午2:05
 *
 * To change this template, choose Tools | Options and locate the template under
 * the Source Creation and Management node. Right-click the template and choose
 * Open. You can then make changes to the template in the Source Editor.
 */
import javax.microedition.lcdui.Image;
import javax.microedition.lcdui.Graphics;
import java.util.*;
/**
 *
 * @author YBGame_xu
 */
public final class Tools {
    public static final int GRAPHCS_TOP_LEFT=Graphics.TOP | Graphics.LEFT;
    private static final Random randomizer=new Random();
    public static int[] Numerics=new int[10];
    //将数组的长度增加
    /*
    public final static int[] expandArray(int[] oldArray, int expandBy){
        int[] newArray=new int[oldArray.length+expandBy];
        System.arraycopy(oldArray, 0,newArray, 0, oldArray.length);
        return newArray;
    }
    public final static Image[][]expandArray(Image[][] oldArray,int expandBy){
        Image[][] newArray=new Image[oldArray.length+expandBy][];
        System.arraycopy(oldArray, 0, newArray, 0, oldArray.length);
        return newArray;
    }
     **/
    public final static int getRand(int min,int max){
        int r=Math.abs(randomizer.nextInt());
        return (r% ((max-min + 1))) + min;
    }
    public final static int setNumerics(int s){
        if (s==0){
            Numerics[0]=0;
            return 0;
        }
        int t;
        int j=-1;
        while(s>0){
            t=s%10;
            Numerics[++j]=t;
            s=s/10;
        }
        return j;
    }
}

⌨️ 快捷键说明

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