資源簡介
入門級示例
代碼片段和文件信息
??
#include?
#include?
#include?
#include?
#include?
#include?
#include?
using?namespace?std;?
const?int?dd[4][2]={{10}{01}{-10}{0-1}};?
char?map[33][53];?
int?dfxfyscore;?
bool?eat;?
struct?body?
{?
?int?xy;?
?body?*last*next;?
?body(){last=next=NULL;}?
}*head;?
int?Rand(int?lint?r)?
{?
?return?rand()%(r-l+1)+l;?
}?
void?init()?
{?
?for(int?i=0;i<22;i++)?
?for(int?j=0;j<52;j++)?
?map[i][j]=‘?‘;?
?for(int?i=0;i<52;i++)?
?map[0][i]=map[21][i]=‘#‘;?
?for(int?i=0;i<22;i++)?
?map[i][0]=map[i][51]=‘#‘;?
?srand((unsigned)time(NULL));?
?head=new?body;?
?head->x=Rand(515)head->y=Rand(1040);?
?d=Rand(03);?
?switch(d
- 上一篇:360新版界面源代碼
- 下一篇:俄羅斯方塊(小游戲源碼)
評論
共有 條評論