?? shape.java
字號:
/*
* Created on 2004-10-21
*
* TODO To change the template for this generated file go to
* Window - Preferences - Java - Code Style - Code Templates
*/
/**
* @author Administrator
*
* TODO To change the template for this generated type comment go to
* Window - Preferences - Java - Code Style - Code Templates
*/
abstract public class Shape
{
public byte cell[][]; //矩形必須是能夠置換(4*4, 3*3等)
public int iSideLength;
public Shape(int l)
{
iSideLength = l;
cell = new byte[l][l];
for (int i=0; i<l; i++)
{
for (int j=0; j<l; j++)
{
cell[i][j] = 0;
}
}
}
public void Rotate() //矩形置換
{
byte change[][] = new byte[iSideLength][iSideLength];
for (int i=0; i<iSideLength; i++)
{
for (int j=0; j<iSideLength; j++)
{
change[i][j] = cell[j][iSideLength - i - 1];
}
}
cell = null;
cell = change;
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -