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

📄 boardcells.java

📁 基于WINCE5.2的ARM嵌入式手机软件的开发
💻 JAVA
字号:
/* * To change this template, choose Tools | Templates * and open the template in the editor. */import java.util.*;//方块操作public class BoardCells{	//7种方块形状,每种形状有四种方式,(懒得写翻转函数了^_^)	private int[][] Stick1 = new int[][]{ {1,0,0,0},											{1,0,0,0},											{1,0,0,0},											{1,0,0,0}},//| 特殊形状	Stick2 = new int[][]{   {1,1,1,1},							{0,0,0,0},							{0,0,0,0},							{0,0,0,0}},//----	Stick3 = new int[][]{    {1,0,0,0},							 {1,0,0,0},							 {1,0,0,0},							 {1,0,0,0}},//|	Stick4 = new int[][]{   {1,1,1,1},							{0,0,0,0},							{0,0,0,0},							{0,0,0,0}};//----	private int[][] Triada1 = new int[][]{ {0,1,0,0},											{1,1,1,0},											{0,0,0,0},											{0,0,0,0}},//T	Triada2 = new int[][]{ {1,0,0,0},						   {1,1,0,0},						   {1,0,0,0},						   {0,0,0,0}},//|-	Triada3 = new int[][]{{1,1,1,0},						  {0,1,0,0},						  {0,0,0,0},						  {0,0,0,0}},//	Triada4 = new int[][]{{0,1,0,0},						  {1,1,0,0},						  {0,1,0,0},						  {0,0,0,0}},//-|	LCorner1 = new int[][]{ {1,1,1,0},							{1,0,0,0},							{0,0,0,0},							{0,0,0,0}},//L	LCorner2 = new int[][]{ {1,1,0,0},							{0,1,0,0},							{0,1,0,0},							{0,0,0,0}},	LCorner3 = new int[][]{ {0,0,1,0},							{1,1,1,0},							{0,0,0,0},							{0,0,0,0}},	LCorner4 = new int[][]{ {1,0,0,0},							{1,0,0,0},							{1,1,0,0},							{0,0,0,0}},	RCorner1 = new int[][]{  {1,1,1,0},							 {0,0,1,0},							 {0,0,0,0},							 {0,0,0,0}},	RCorner2 = new int[][]{  {0,1,0,0},							 {0,1,0,0},							 {1,1,0,0},							 {0,0,0,0}},	RCorner3 = new int[][]{  {1,0,0,0},							 {1,1,1,0},							 {0,0,0,0},							 {0,0,0,0}},	RCorner4 = new int[][]{  {1,1,0,0},							 {1,0,0,0},							 {1,0,0,0},							 {0,0,0,0}},	LZigzag1 = new int[][]{ {1,1,0,0},						    {0,1,1,0},						    {0,0,0,0},						    {0,0,0,0}},//Z	LZigzag2 = new int[][]{ {0,1,0,0},						    {1,1,0,0},						    {1,0,0,0},						    {0,0,0,0}},//Z	LZigzag3 = new int[][]{ {1,1,0,0},						    {0,1,1,0},						    {0,0,0,0},						    {0,0,0,0}},//Z	LZigzag4 = new int[][]{ {0,1,0,0},						    {1,1,0,0},						    {1,0,0,0},						    {0,0,0,0}},//Z	RZigzag1 = new int[][]{  {0,1,1,0},							{1,1,0,0},							{0,0,0,0},							{0,0,0,0}},	RZigzag2 = new int[][]{  {1,0,0,0},							 {1,1,0,0},							 {0,1,0,0},							 {0,0,0,0}},	//	RZigzag3 = new int[][]{  {0,1,1,0},							{1,1,0,0},							{0,0,0,0,},							{0,0,0,0}},	//	RZigzag4 = new int[][]{  {1,0,0,0},							 {1,1,0,0},							 {0,1,0,0},							 {0,0,0,0}},	//	box = new int[][]{{1,1,0,0},{1,1,0,0},{0,0,0,0},{0,0,0,0}};//	private int[][][] workcell= new int[][][]{Stick1,Stick2,Stick3,Stick4,										Triada1,Triada2,Triada3,Triada4,										LCorner1,LCorner2,LCorner3,LCorner4,										RCorner1,RCorner2,RCorner3,RCorner4,										LZigzag1,LZigzag2,LZigzag3,LZigzag4,										RZigzag1,RZigzag2,RZigzag3,RZigzag4,										box,box,box,box,};	private int style = 0,begincell;	Random random;	public BoardCells(){		random = new Random();		}	//必须运行SetNewCells后才返回新的序号	public int GetNewCellCount()	{		return begincell;	}	//num 是1,2,3,4中的一个	public int[][] GetWorkcell(int num){		return workcell[style*4+num-1];	}	//获得随机方块	public int[][] SetNewCells(){		int getnum =0;		random = new Random();		getnum = random.nextInt(27);		style = getnum/4;		begincell = getnum%4;		return workcell[getnum];	}}

⌨️ 快捷键说明

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