没有合适的资源?快使用搜索试试~ 我知道了~
打地鼠 java部分程序
需积分: 9 1 下载量 11 浏览量
2013-01-07
18:41:07
上传
评论
收藏 1KB TXT 举报
温馨提示
试读
2页
打地鼠 java部分程序
资源推荐
资源详情
资源评论
package com.briup.ch04;
public class Mouse {
public int [][] initArray(int row,int column){
return new int [row][column];
}
public static int getRow(){//0--->2
return (int) (Math.random()*3);
}
public static int getRowColumn(){//0--->3
return (int) (Math.random()*4);
}
public static int getType(){
return (int) (Math.random()*3);
}
public static void main(String[] args) throws InterruptedException {
Mouse mouse =new Mouse();
int[][]arr=mouse.initArray(3,4);
int randomRow=0;
int randomColumn=0;
while (true){
randomRow=getRow();
randomColumn=getColumn();
switch (getType()){
case 0:
System.out.println("row"+randomRow+"column"+randomColumn+"generate monkey");break;
public class Mouse {
public int [][] initArray(int row,int column){
return new int [row][column];
}
public static int getRow(){//0--->2
return (int) (Math.random()*3);
}
public static int getRowColumn(){//0--->3
return (int) (Math.random()*4);
}
public static int getType(){
return (int) (Math.random()*3);
}
public static void main(String[] args) throws InterruptedException {
Mouse mouse =new Mouse();
int[][]arr=mouse.initArray(3,4);
int randomRow=0;
int randomColumn=0;
while (true){
randomRow=getRow();
randomColumn=getColumn();
switch (getType()){
case 0:
System.out.println("row"+randomRow+"column"+randomColumn+"generate monkey");break;
资源评论
snrdfl
- 粉丝: 0
- 资源: 10
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功