博文
asdadadada(2008-06-28 11:11:00)
摘要:#include "stdio.h"#include "stdlib.h"#include "string.h"typedef struct Node{ char name[10]; int x,y; struct Node *next;}Node,*Linklist;void main(){ void checkname(Node *L); void checklocation(Node *L); struct Node *L,*temp; char nametemp[10]; int xtmp=0,ytmp=0; int flag=1,check; L=(Linklist)malloc(sizeof(Node)); (*L).next=NULL; temp=(Linklist)malloc(sizeof(Node)); (*temp).next=NULL; while(flag) { printf("Please input the cities' name: "); scanf("%s",&nametemp); printf("Please input the location: "); scanf("%d%d",&xtmp,&ytmp); if(xtmp!=0&&strlen(nametemp)<10) { temp=(Node*)malloc(sizeof(Node)); strcpy(temp->name,nametemp); temp->x=xtmp; temp->y=ytmp; temp->next=L->next; L->next=temp; &......
TC++俄罗斯方块(2007-11-10 12:09:00)
摘要:程序有点繁琐,功能尚未完全实现,但因为要期中考试,没时间写了
4,6,8,2控制方向
// Note:Your choice is C++ IDE#include "iostream.h"#include "graphics.h"#include "stdlib.h"#include "math.h"#include "bios.h"#include "dos.h"#include "stdio.h"int score;struct xline{ int s[10];}xline[20];//class类class fangkuai{ public: void begain(); void show(); void keycon(char k1); void position(); int check(); void start(); void fall(); void score(); int checkscore(int k1); void scoreget(int k1); void kinds(int kin1); private: int a[4][2],a1[4][2],kin,move,sta;};voidfangkuai::begain() //初始化{ int i,j; for(i=0;i<20;i++) for(j=0;j<10;j++) xline[i].s[j]=0; sta=0; kin=rand()%7; kinds(kin);}voidfangkuai::start(){ int i; sta=0; kin=rand()%7; kinds(kin); }voidfangkuai::kinds(int kin1) //为下落块赋初值{ int i; if(kin1==0) for(i=0;i<......
不明玩意儿(2007-09-17 18:17:00)
摘要:/* Note:Your choice is C IDE */#include "stdio.h"#include "math.h"#include "graphics.h"#include "dos.h"#include "bios.h"#include "stdlib.h"void main(){ int shot(int *a,int *b); int speed(int x,int y,int x1,int y1); char a[2]="\14",b[2]="\13",k2,k3; int c[11][7],d[11][7],vx[11][7],vy[11][7],con[11][7],k,k1,n=310,m=450; int tim=0,t=0,t1=6,z,n1,m1,ju=0; int gd=DETECT,gm; initgraph(&gd,&gm,""); cleardevice(); settextstyle(0,0,2); for(k=1;k<=10;k++) for(k1=1;k1<=6;k1++) {c[k][k1]=120+k*30; d[k][k1]=20*k1; vx[k][k1]=0; vy[k][k1]=0; con[k][k1]=0; outtextxy(c[k][k1],d[k][k1],a);} outtextxy(n,m,b); &n......
简单扫雷(2007-09-13 18:28:00)
摘要:/* Note:Your choice is C IDE */#include "stdio.h"#include "graphics.h"#include "dos.h"#include "stdlib.h"union REGS regs;void main(){ char ch[2]; int number(int (*a)[16],int s); int open(int n,int m,int (*a)[16]); int fill(int px,int py,int (*a)[16]); int draw(); int draw2(int n,int m,int k); int Mscursor(int x,int y); int n,m,k,num,n1,m1,pix=0; int gd=VGA,gm=VGAHI,px,py,b,a[21][16]; srand(time(NULL)); initgraph(&gd,&gm,""); cleardevice(); am:for(n=1;n<=20;n++) for(m=1;m<=15;m++) a[n][m]=0; draw(); num=0; for(n=1;n<=20;n++) for(m=1;m<=15;m++) {k=rand()%5; if(k==0) {a[n][m]=9; num++;} &n......
