JAVA俄罗斯方块,里面的数字0,看不懂啊.// 方块的形状 第一组代表方块类型有S、Z、L、J、I、O、T 7种 第二组 代表旋转几次 第三四组为 方块矩阵private final int shapes[][][] = new int[][][] {// i{ { 0,0,0,0
2016-09-09
JAVA俄罗斯方块,里面的数字0,看不懂啊.
// 方块的形状 第一组代表方块类型有S、Z、L、J、I、O、T 7种 第二组 代表旋转几次 第三四组为 方块矩阵
private final int shapes[][][] = new int[][][] {
// i
{ { 0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0 },
{ 0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0 },
{ 0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0 },
{ 0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0 } },
// s
{ { 0,1,1,0,1,1,0,0,0,0,0,0,0,0,0,0 },
{ 1,0,0,0,1,1,0,0,0,1,0,0,0,0,0,0 },
{ 0,1,1,0,1,1,0,0,0,0,0,0,0,0,0,0 },
{ 1,0,0,0,1,1,0,0,0,1,0,0,0,0,0,0 } },
// z
{ { 1,1,0,0,0,1,1,0,0,0,0,0,0,0,0,0 },
{ 0,1,0,0,1,1,0,0,1,0,0,0,0,0,0,0 },
{ 1,1,0,0,0,1,1,0,0,0,0,0,0,0,0,0 },
{ 0,1,0,0,1,1,0,0,1,0,0,0,0,0,0,0 } },
// j
{ { 0,1,0,0,0,1,0,0,1,1,0,0,0,0,0,0 },
{ 1,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0 },
{ 1,1,0,0,1,0,0,0,1,0,0,0,0,0,0,0 },
{ 1,1,1,0,0,0,1,0,0,0,0,0,0,0,0,0 } },
// o
{ { 1,1,0,0,1,1,0,0,0,0,0,0,0,0,0,0 },
{ 1,1,0,0,1,1,0,0,0,0,0,0,0,0,0,0 },
{ 1,1,0,0,1,1,0,0,0,0,0,0,0,0,0,0 },
{ 1,1,0,0,1,1,0,0,0,0,0,0,0,0,0,0 } },
// l
{ { 1,0,0,0,1,0,0,0,1,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