俄罗斯方块,4个方块的形状有5个,5个方块呢?6个?

来源:互联网 发布:淘宝数据怎么分析 编辑:程序博客网 时间:2024/05/01 09:57

转自:http://www.zhihu.com/question/20540487

曾经做过一个俄罗斯方块游戏,收集资料时见识过几种:


四格骨牌(Tetromino)[1]
俄罗斯方块(Tetris )名称就是变形自词缀「四」( tetra),可以发现这种可变形状比较少。

五格骨牌(Pentomino)[2]


六格骨牌(Hexomino)[3]


[1] en.wikipedia.org/wiki/T
[2] en.wikipedia.org/wiki/P
[3] en.wikipedia.org/wiki/H


==== 补充 ====
想了解程序里面如何简单地存储方块形状,可以看我的业余练习 github.com/ambar/Tetris
样例:
{
Z: {
color: new HSLColor(0, 1, .47),
shape: [
[1, 1, 0],
[0, 1, 1]
]
},
L: {
color: new HSLColor(40, 1, .47),
shape: [
[1, 1, 1],
[1, 0, 0]
]
}
}
0 0
原创粉丝点击