Code
1. #include <graphics.h>
2. #include <conio.h>
3. #include <dos.h>
送别的古诗有哪些4. #include <bios.h>
5. #include <malloc.h>
6. #include <stdlib.h>
7. #include <stdio.h>
8. #define R 10 /*The size of mou*/
9. void init(void); /* BGI initialization */
10. int cover(int); /*draw lines , t color, output the text*/
11. void get_board(void);
12. /*using the loop and the line function to draw the chessboard*/
13. void word(int); /*input word,the color is come from the rand*/
14. void getmou(int *,int *,int *);
15. /*get the location and the button of mou,key=1 is the left button,key=2 is the right button*/
16. void visbilemou(void);
17. /*Display the mou*//*after typing ,gets the x, y and mou button,then return */
18. void mou(int *,int *,int *);
19. /*drawing a mou is to put an empty rectangular in the memory , then draw the shape of the mou in the empty rectangular*/
20. void change_word(int); /*show the black or the white*/
21. void help(void); /*get playing help*/
22. void prompt(int); /*the cancel or quit*/
23. void game_player(void); 明天休息图片/*how to realize the game*/
24. int main()
25. {
26. int key;
27. init();/*BGI initialization*/
28. key=cover(0); /*the welcome interface*/
29. while(key) /*only it is 1.it will running the loop*/
30. {
31. get_board(); /*draw the chessboard*/
32. game_player(); /*control or play the games*/
33. }
34. clograph();
35. return 0;
36. }
37. void init() /* BGI initialization */
38. {
39. 积累的名言名句 int graphdriver = DETECT, graphmode = 0;
40. /* The same effect with gd =VGA and gm = VGAHI */
公告的格式及范文41. registerbgidriver(EGAVGA_driver);
/* After register the BGI driver needn't the support of running the BGI */
42. initgraph(&graphdriver, &graphmode, "");
43. return;
44. }
45. int cover(int choo)
46. {
47. int row,col,i;
48. char answer;
49. switch(choo)
50. {
51. ca 0:
52. tfillstyle(SOLID_FILL,BLUE); /*fill in the color*/
53. bar(630,450,10,30);
54. for(row=30;row<=180;row+=30) /*draw cross lines*/
55. line(10,row,160,row);
56. for(col=10;col<=180;col+=30) /*draw vertical lines*/
57. line(col,30,col,180);
58. tcolor(BLACK);
59. ttextstyle(0,0,3);
60. outtextxy(200,200,"");
61. tfillstyle(1,BLACK);
62. for(i=25;i<175;i+=30)
63. {
64. pieslice(i,i+20,0,360,14);
65. sleep(1);
66. }
67. for(row=30;row<=180;row+=30)
68. line(480,row,630,row);
69. for(col=480;col<=630;col+=30)
70. line(col,30,col,180);
71. tcolor(WHITE);
72. ttextstyle(0,0,3);
73. outtextxy(200,200,"");
74. tfillstyle(1,WHITE);
75. for(i=495;i<=615;i+=30)
76. {
77. pieslice(i,660-i,0,360,14);
78. sleep(1);
79. }
80. tcolor(BLUE);
81. ttextstyle(0,0,3);
非我所有82. outtextxy(200,200,"");
83. ttextstyle(0,0,5);
84. 最近的时政热点/* fornt :DEFAULT_FONT, TRIPLEX_FONT,SMALL_FONT, SANSSERIF_FONT, GOTHIC_FONT /direction:lateral and vertical /size */
85. for(i=1;i<=21;i++)
86. {
摇滚的手势
87. tcolor(i); /*the color of the text*/
88. outtextxy(65,100,"FIVE IN A ROW"); /*output the text*/
89. }
90. tcolor(6);
91. ttextstyle(0,0,3);
92. sleep(1);
93. outtextxy(50,300,"Made by Hu yin feng");
94. sleep(1);
95. outtextxy(100,350," Xiao xin ran");
96. sleep(1);
97. outtextxy(100,400," Zheng yun");
98. tcolor(7);
99. ttextstyle(0,0,2);
100. sleep(2);
101. outtextxy(20,430,"would you like to try?(Y/N:)");
102. answer=getch();
103. break;
104. ca 1:
105. tfillstyle(SOLID_FILL,3);
106. bar(640,400,451,220);
107. tcolor(BLACK);
108. ttextstyle(0,0,2.5);
109. outtextxy(455,280,"BLACK WIN!");
110. sleep(1);
111. tcolor(RED);
112. ttextstyle(0,0,2);
黄芪的功效与作用
113. outtextxy(451,320,"Try again?");
114. answer=getch();
115. break;
116. ca 2:
117. tfillstyle(SOLID_FILL,3);
118. bar(640,400,451,220);
119. tcolor(WHITE);