课程设计计算机技术基础c语言小虫子挖隧道设计_第1页
课程设计计算机技术基础c语言小虫子挖隧道设计_第2页
课程设计计算机技术基础c语言小虫子挖隧道设计_第3页
课程设计计算机技术基础c语言小虫子挖隧道设计_第4页
课程设计计算机技术基础c语言小虫子挖隧道设计_第5页
已阅读5页,还剩9页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、计算机技术基础课程设计c语言设计报告题目:小虫子挖隧道一、选题背景:1、问题提出:通过c语言的学习和对程序设计的兴趣,使我很想设计一个小程序,使自己对程序设计有更深的认识,来充实一下这学期的学习。2、在这个程序中应用了c语言中的一些基本知识,来运行出一个应用方向键的小程序。二、设计思路: 1、 练习进行图形的界面处理,通过语句include<graphics.h>将库函数引出,通过init( )函数初始化图形系统,编写相应的的功能函数完成大嘴巴的效果,通过循环响应 。2、在实现过程中,通过调用虫子嘴巴函数和四个方向移动函数,可以看到在设计的背景颜色下以张着大嘴巴挖出隧道移动。3、主

2、要应用如下:pieslice 绘制并填充一个扇形setfillstye 设置填充模式和颜色#include 文件包含初始化图形系统for 循环initgraph 初始化图形系统closegraph 关闭初始化图形系统setbkcolor 设计背景颜色putpixel 在指定位置画一像素真假for i=1i<=2000groundi+程序组i<=1000for i=1i+putpixelfor i=1init开始 真 假i<=200dauir 假while 真putpixelc!=015i+ switch 假caseacasepcasemcasehdefault 假退出四:程序

3、清单:#include <graphics.h>#include <stdio.h>#include <time.h>#include <dos.h>#define maxx 640#define maxy 480#define minx 0#define miny 0#define midx 0#define midy 0#define r 15main()int i,x,y;char c; /*定义变量*/init(); /*调用图形初始化函数*/ground(); /*调用画土地函数*/x=320;y=240;dazuir(x,y,13);

4、 /*调用画虫子函数*/c=' 'while(c!='015')c=getch();switch(c)case'm':dazui(x,y,13); /*调用合上嘴巴函数*/delay(2000); /*延迟2000毫秒*/dazui(x,y,0); /*调用合上嘴巴函数*/x=x+15; /*嘴巴前进*/delay(1000); /*延迟1000毫秒*/dazuir(x,y,13); /*调用向右嘴巴函数*/break;case'h':dazui(x,y,13); /*调用合上嘴巴函数*/delay(2000); /*延迟2000

5、毫秒*/dazui(x,y,0); /*调用合上嘴巴函数*/y=y-15; /*移动嘴巴位置*/delay(1000); /*延迟1000毫秒*/dazuit(x,y,13); /*调用向上嘴巴函数*/break;case'k':dazui(x,y,13); /*调用合上嘴巴函数*/delay(2000); /*延迟2000毫秒*/dazui(x,y,0); /*调用合上嘴巴函数*/x=x-15; /*移动嘴巴位置*/delay(1000); /*延迟1000毫秒*/dazuil(x,y,13); /*调用向左嘴巴函数*/break;case'p':dazui(

6、x,y,13); /*调用合上嘴巴函数*/delay(2000); /*延迟2000毫秒*/dazui(x,y,0); /*调用合上嘴巴函数*/y=y+15; /*移动嘴巴位置*/delay(1000); /*延迟1000毫秒*/dazuib(x,y,13); /*调用向下嘴巴函数*/break;default :;init() /*定义初始化图形系统函数*/int gdriver=detect;int gmobe;initgraph(&gdriver,&gmobe,"c:tcbgi"); /*初始化图象系统*/setbkcolor(0); /*定义背景为黑

7、色*/return;ground() /*画绿地函数*/int i,rx,ry;for(i=1;i<=2000;i+) /*循环系统语句*/putpixel(rand()%maxx,rand()%maxy,2); /*在指定位置画一像素*/for(i=1;i<=1000;i+)rx=rand()%maxx;ry=rand()%maxy; /*随机位置画一像素*/putpixel(rx,ry,12);putpixel(rx+1,ry,12);putpixel(rx+1,ry+1,12); /*在三个相邻位置画像素*/for(i=1;i<=20000;i+)putpixel(ra

8、nd()%maxx,rand()%maxy,10); /*在指定位置画一像素*/return;dazui(int x,int y,int lcolor) /*在x,y处以lcolor色画合上大嘴巴*/setcolor(lcolor); /*设置当前画线颜色*/setfillstyle(1,lcolor); /*设置填充模式和颜色*/pieslice(x,y,0,360,r); /*绘制并填充一个扇形*/setlinestyle(0,0,3); /*设置当前画线宽度和类型*/setcolor(0); /*设置当前画线颜色*/circle(x+4,y-6,2); /*在给定半径以(x,y)为圆心画

9、圆*/return;dazuir(int x,int y,int lcolor) /*在x,y处以lcolor色向右的大嘴巴*/setcolor(lcolor); /*设置当前画线颜色*/setfillstyle(1,lcolor); /*设置填充模式和颜色*/pieslice(x,y,30,330,r); /*绘制并填充一个扇形*/setlinestyle(0,0,3); /*设置当前画线宽度和类型*/setcolor(0); /*设置当前画线颜色*/circle(x+4,y-6,2); /*在给定半径以(x,y)为圆心画圆*/return;dazuil(int x,int y,int lc

10、olor) /*在x,y处以lcolor色向左的大嘴巴*/setcolor(lcolor); /*设置当前画线颜色*/setfillstyle(1,lcolor); /*设置填充模式和颜色*/pieslice(x,y,210,360,r); /*绘制并填充一个扇形*/pieslice(x,y,0,150,r); /*绘制并填充一个扇形*/setlinestyle(0,0,3); /*设置当前画线宽度和类型*/.setcolor(0); /*设置当前画线颜色*/circle(x-4,y-6,2); /*在给定半径以(x,y)为圆心画圆*/return;dazuit(int x,int y,int

11、 lcolor) /*在x,y处以lcolor色向上的大嘴巴*/setcolor(lcolor); /*设置当前画线颜色*/setfillstyle(1,lcolor); /*设置填充模式和颜色*/pieslice(x,y,120,360,r); /*绘制并填充一个扇形*/pieslice(x,y,0,60,r); /*绘制并填充一个扇形*/setlinestyle(0,0,3); /*设置当前画线宽度和类型*/setcolor(0); /*设置当前画线颜色*/circle(x-7,y-6,2); /*在给定半径以(x,y)为圆心画圆*/return;dazuib(int x,int y,in

12、t lcolor) /*在x,y处以lcolor色向下的大嘴巴*/setcolor(lcolor); /*设置当前画线颜色*/setfillstyle(1,lcolor); /*设置填充模式和颜色*/pieslice(x,y,0,240,r); /*绘制并填充一个扇形*/pieslice(x,y,300,360,r); /*绘制并填充一个扇形*/setlinestyle(0,0,3); /*设置当前画线宽度和类型*/setcolor(0); /*设置当前画线颜色*/circle(x+7,y+6,2); /*在给定半径以(x,y)为圆心画圆*/return;五、主要解决问题的方法及技术要求:主要

13、用函数和循环函数,结合背景设计,用pieslice,selfillstyle画扇形,并成为大嘴巴的电子形象。六、设计结果说明:1、 设计优点:该程序运用了所学到的基本知识,通过宏定义和多次的调用函数,浅显易懂,运行后比较生动,达到了设计的初衷。看过的人可以很清楚明白,并且可以通过改变程序的设计背景,达到意想的效果 。2、 设计不足:此程序不是游戏模式,只是一个运用所学过的知识,运行出一个可通过键盘调节的小程序。3、 设计改进:如果通过更深入的学习,可以尝试把此程序设计在音效之下,并改进成游戏模式。employment tribunals sort out disagreements betwe

14、en employers and employees.you may need to make a claim to an employment tribunal if:· you don't agree with the disciplinary action your employer has taken against you· your employer dismisses you and you think that you have been dismissed unfairly.for more information about dismissal

15、and unfair dismissal, see dismissal.you can make a claim to an employment tribunal, even if you haven't appealed against the disciplinary action your employer has taken against you. however, if you win your case, the tribunal may reduce any compensation awarded to you as a result

16、of your failure to appeal.remember that in most cases you must make an application to an employment tribunal within three months of the date when the event you are complaining about happened. if your application is received after this time limit, the tribunal will not usually accept it.if you are wo

17、rried about how the time limits apply to you, take advice from one of the organisations listed under further help.employment tribunals are less formal than some other courts, but it is still a legal process and you will need to give evidence under an oath or affirmation.most people find making

18、a claim to an employment tribunal challenging. if you are thinking about making a claim to an employment tribunal, you should get help straight away from one of the organisations listed under further help.if you are being represented by a solicitor at the tribunal, they may ask you to sign an a

19、greement where you pay their fee out of your compensation if you win the case. this is known as a damages-based agreement. in england and wales, your solicitor can't charge you more than 35% of your compensation  if you win the case.if you are thinking about signing up for  a dama

20、ges-based agreement, you should make sure you're clear about the terms of the agreement. it might be best to get advice from an experienced adviser, for example, at a citizens advice bureau.  to find your nearest cab, including those that give advice by e-mail, click on nearest cab.for

21、 more information about making a claim to an employment tribunal, see employment tribunals.the (lack of) air up there watch mcayman islands-based webb, the head of fifa's anti-racism taskforce, is in london for the football association's 150th anniversary celebrations and will attend ci

22、ty's premier league match at chelsea on sunday."i am going to be at the match tomorrow and i have asked to meet yaya toure," he told bbc sport."for me it's about how he felt and i would like to speak to him first to find out what his experience was."uefa has opened d

23、isciplinary proceedings against cska for the "racist behaviour of their fans" during city's 2-1 win.michel platini, president of european football's governing body, has also ordered an immediate investigation into the referee's actions.cska said they were "surpri

24、sed and disappointed" by toure's complaint. in a statement the russian side added: "we found no racist insults from fans of cska."age has reached the end of the beginning of a word. may be guilty in his seems to passing a lot of different life became the appearance of the same day

25、; may be back in the past, to oneself the paranoid weird belief disillusionment, these days, my mind has been very messy, in my mind constantly. always feel oneself should go to do something, or write something. twenty years of life trajectory deeply shallow, suddenly feel something, do it.一字开头的年龄已经

26、到了尾声。或许是愧疚于自己似乎把转瞬即逝的很多个不同的日子过成了同一天的样子;或许是追溯过去,对自己那些近乎偏执的怪异信念的醒悟,这些天以来,思绪一直很凌乱,在脑海中不断纠缠。总觉得自己自己似乎应该去做点什么,或者写点什么。二十年的人生轨迹深深浅浅,突然就感觉到有些事情,非做不可了。the end of our life, and can meet many things really do?而穷尽我们的一生,又能遇到多少事情是真正地非做不可?during my childhood, think lucky money and new clothes are necessary for new

27、 year, but as the advance of the age, will be more and more found that those things are optional; junior high school, thought to have a crush on just means that the real growth, but over the past three years later, his writing of alumni in peace, suddenly found that isn't really grow up, it seem

28、s is not so important; then in high school, think don't want to give vent to out your inner voice can be in the high school children of the feelings in a period, but was eventually infarction when graduation party in the throat, later again stood on the pitch he has sweat profusely, looked at hi

29、s thrown a basketball hoops, suddenly found himself has already can't remember his appearance.童年时,觉得压岁钱和新衣服是过年必备,但是随着年龄的推进,会越来越发现,那些东西根本就可有可无;初中时,以为要有一场暗恋才意味着真正的成长,但三年过去后,自己心平气和的写同学录的时候,突然就发现是不是真正的成长了,好像并没有那么重要了;然后到了高中,觉得非要吐露出自己的心声才能为高中生涯里的懵懂情愫划上一个句点,但毕业晚会的时候最终还是被梗塞在了咽喉,后来再次站在他曾经挥汗如雨的球场,看着他投过篮球的

30、球框时,突然间发现自己已经想不起他的容颜。originally, this world, can produce a chemical reaction to an event, in addition to resolutely, have to do, and time.原来,这个世界上,对某个事件能产生化学反应的,除了非做不可的坚决,还有,时间。a person's time, your ideas are always special to clear. want, want, line is clear, as if nothing could shake his. also

31、 once seemed to be determined to do something, but more often is he backed out at last. dislike his cowardice, finally found that there are a lot of love, there are a lot of miss, like shadow really have been doomed. those who do, just green years oneself give oneself an arm injection, or is a self-

32、righteous spiritual.一个人的时候,自己的想法总是特别地清晰。想要的,不想要的,界限明确,好像没有什么可以撼动自己。也曾经好像已经下定了决心去做某件事,但更多的时候是最后又打起了退堂鼓。嫌恶过自己的怯懦,最终却发现有很多缘分,有很多错过,好像冥冥之中真的已经注定。那些曾经所谓的非做不可,只是青葱年华里自己给自己注射的一支强心剂,或者说,是自以为是的精神寄托罢了。at the moment, the sky is dark, the air is fresh factor after just rained. suddenly thought of blue plaid shi

33、rt; those were broken into various shapes of stationery; from the corner at the beginning of deep friendship; have declared the end of the encounter that haven't start planning. those years, those days of do, finally, like youth, will end in our life.此刻,天空是阴暗的,空气里有着刚下过雨之后的清新因子。突然想到那件蓝格子衬衫;那些被折成各

34、种各样形状的信纸;那段从街角深巷伊始的友谊;还有那场还没有开始就宣告了终结的邂逅计划那些年那些天的非做不可,终于和青春一样,都将在我们的人生中谢幕。baumgartner the disappointing news: mission aborted. r plays an important role in this mission. starting at the ground, conditions have to be very calm - winds less than 2 mph, with no precipitation or humidity and limited clo

35、ud cover. the balloon, with capsule attached, will move through the lower level of the atmosphere (the troposphere) where our day-to-day weather lives. it will climb higher than the tip of mount everest (5.5 miles/8.85 kilometers), drifting even higher than the cruising altitude of commercial airlin

36、ers (5.6 miles/9.17 kilometers) and into the stratosphere. as he crosses the boundary layer (called the tropopause),e can expect a lot of turbulence.the supersonic descent could happen as early as sunda.the weathethe balloon will slowly drift to the edge of space at 120,000 feet ( then, i would assume, he will slowly step out onto something resembling an olympic diving platform.below, the earth becomes the concrete bottom of a swimm

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论