Tetris2
来源:互联网 发布:阿里移动推荐算法大赛 编辑:程序博客网 时间:2024/06/05 14:39
int get_holes()
{
int height_col=20,holes=0;
for (int x=0;x<=9;x++)
{
height_col = 20;
for (int y=2;y<=20;y++)
{
if(pool_image[x][y] == 0 && pool_image[x][y-1] == 1)
{
holes++;
}
}
}
return holes;
}
int get_well()
{
int deep=0,y;
for (int x=1;x<=8;x++)
{
for (y=1;y<=20;y++)
{
if( ((pool_image[x-1][y] & pool_image[x+1][y])!=0) && pool_image[x][y]==0)
{
deep ++;
for (int k=y+1;k<=21;k++)
{
if (pool_image[x][k]==0)
deep++;
else
break;
}
}
}
}
for (y=1;y<=20;y++)
{
if( (pool_image[0][y] == 0) & (pool_image[1][y] == 1))
{
deep ++;
for (int k=y+1;k<=21;k++)
{
if (pool_image[x][k]==0)
deep++;
else
break;
}
}
}
for (y=1;y<=20;y++)
{
if((pool_image[9][y] == 0) & (pool_image[8][y] == 1))
{
deep ++;
for (int k=y+1;k<=21;k++)
{
if (pool_image[x][k]==0)
deep++;
else
break;
}
}
}
return deep;
}
- Tetris2
- Android开发的一些重要知识点(二)
- 内存数据库简介
- 微软将开售82英寸Windows 8巨型平板电脑
- OpenGL 中常用的 GLUT 函数库
- php常用函数
- Tetris2
- Oracle数据库日常维护手册
- GLSurfaceView中添加button并监听click事件
- Linux socket网络编程之聊天室(三):select异步通讯实现
- C Looooops&&http://poj.org/problem?id=2115
- xcode 4 适配 iphone 3
- Oracle查询优化
- Apache错误:LoadModule takes two arguments, a module name and the name of a shared object
- 用cookie实现localstorage功能