| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 543 人关注过本帖
标题:发错拉 不用看啦
只看楼主 加入收藏
jxt598598
Rank: 1
等 级:新手上路
帖 子:149
专家分:0
注 册:2007-6-13
结帖率:100%
收藏
 问题点数:0 回复次数:0 
发错拉 不用看啦
#include <stdio.h>
#include <bios.h>
#include <dos.h>
#include <graphics.h>
#include <string.h>
#include <stdlib.h>
#define BoardWidth   12
#define BoardHeight  23
#define _INNER_HELPER
typedef struct tagBlock
{
   char c[4][4];
   int  x;
   int  y;
   char color;
   char size;
   char name;
}Block;
int CellSize=18;
int BoardLeft=30;
int BoardTop=30;
int NBBoardLeft=300;
int NBBoardTop=30;
int NBCellSize=10;
int ScoreBoardLeft=300;
int ScoreBoardTop=100;
int ScoreBoardWidth=200;
int ScoreBoardHeight=35;
int ScoreColor=LIGHTCYAN;
int ToaalScore=100;
int InfoLeft=300;
int InfoTop=200;
int InfoColor=YELLOW;
int BkGndColor=BLACK;
int BorderColor=DARKGRAY;
int TotalScore=100;
char info_help[255];
char info_common[255];
char info_score[20];
unsigned char Board[BoardWidth][BoardHeight][2];
Block nextBlock;
void InitGame();
void DisplayScore();
void DisplayInfo(char *text)
void DisplayInfo(char *text)
{
   setcolor(BkGndColor);
   outtextxy(InfoLeft,InfoTop,info_common);
   strcpy(info_common,text);
   setcolor(InfoColor);
   outtextxy(InfoLeft,InfoTop,info_common);
}
void InitGame()
{
  int i,j,gdriver=DETECT,gmode;
  struct time sysTime;
  memset(Board,0,BoardWidth*BoardHeight*2);
  memset(nextBlock.c,0,16);
  strcpy(info_help,"P:Pause Game.  --by hoodlum1980");
  initgraph(&gdriver,&gmode,"d:\\tc\\");
  setcolor(BorderColor);
  for(i=0;i<=BoardWidth;i++)
  {
    line(BoardLeft+i*CellSize,BoardTop,BoardLeft+i*CellSize,BoardTop+BoardHeight*CellSize);
  }
  for(i=0;i<=BoardHeight;i++)
  {
    line(BoardLeft,BoardTop+i*CellSize,BoardLeft+BoardWidth*CellSize,BoardTop+i*CellSize);
  }
  rectangle(BoardLeft-CellSize/4,BoardTop-CellSize/4,BoardLeft+BoardWidth*CellSize+CellSize/4,BoardTop+BoardHeight*CellSize+CellSize/4);
  for(i=0;i<=4;i++)
  {
    line(NBBoardLeft+i*NBCellSize,NBBoardTop,NBBoardLeft+i*NBCellSize,NBBoardTop+4*NBCellSize);
    line(NBBoardLeft,NBBoardTop+i*NBCellSize,NBBoardLeft+4*NBCellSize,NBBoardTop+i*NBCellSize);
  }
  rectangle(ScoreBoardLeft,ScoreBoardTop,ScoreBoardLeft+ScoreBoardWidth,ScoreBoardTop+ScoreBoardHeight);
  DisplayScore();
  gettime(&sysTime);
  srand(sysTime.ti_hour*3600+sysTime.ti_min*60+sysTime.ti_sec);
  GenerateBlock(&nextBlock);
  NextBlock();
  setcolor(DARKGRAY);
  outtextxy(InfoLeft,InfoTop+20,"Up -rotate Space-drop");
  outtextxy(InfoLeft,InfoTop+35,"Left-left  Right-right");
  outtextxy(InfoLeft,InfoTop+50,"Esc -exit");
  DisplayInfo(info_help);
}
void _INNER_HELPER DisplayScore()
{
  setcolor(BkGndColor);
  outtextxy(ScoreBoardLeft+5,ScoreBoardTop+5,info_score);
  setcolor(ScoreColor);
  sprintf(info_score,"Score:%d",TotalScore);
  outtextxy(ScoreBoardLeft+5,ScoreBoardTop+5,info_score);
}
void main(void)
{
  InitGame();
}
程序运行有一个错误,搞不明白?

[[it] 本帖最后由 jxt598598 于 2008-3-23 02:40 编辑 [/it]]
搜索更多相关主题的帖子: 300 include color 
2008-03-23 02:32
快速回复:发错拉 不用看啦
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.020065 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved