📄 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 + -