當前位置:首頁 » 課程大全 » c打字游戲課程設計報告

c打字游戲課程設計報告

發布時間: 2021-02-05 07:34:10

① 關於猜拳游戲的c語言課程設計報告怎麼寫啊

題目,分析題目,然後寫設計思路,然後編寫代碼,分析代碼,然後測試代碼,可以寫很多的,一般對寫代碼的報告就寫那麼多久夠了

② c語言課程設計打字測驗

課程抄計劃,體現國家對學校的統一要求是編寫,哥哥。課程標准和教材的主要依據,課程標準是課程計劃的分科分,學科展開,每門科學都對應的,課程標准,教材是課程標準的,具體化。課程標准中規定的各門學科,一般都有相應的教材。

③ 急!!!求C語言課程設計之打字游戲代碼!

給你個.因分少就不改動了,
這個是給別的朋友定過的.
只有練習數字和字母.而且可以調速度,並配著簡單的動畫哦.如覺得好要加功能, 加我網路好友,再加分.哈哈.

#include<time.h>
#include<stdlib.h>
#include<graphics.h>
#include<conio.h>
#include<dos.h>
#include<math.h>

#define R 10
#define ESC 0x011b
#define LOW 0x5000
#define FAST 0x4800
int draw_car(int x,int y,char *ch);
double dalta=20,angle;

void *image;
int step=20;
main()
{

int gdriver=DETECT,gmode;
static int startx=60;
static int starty=20;
int maxy,maxx,l=1,n=1;
char ch,play, str[2];
int size,temch;
int ok,y=50;

clrscr();

printf("\n\n\n\n\n*****************************************\n");

printf(" 1.play only number 0-9 .\n");
printf(" 2.play only char a-z .\n");
printf(" 3.exit\n");
printf("*****************************************\n");
while(1){
printf("\nPls enter choice:");
play=getche();
if((play=='1')||(play=='2'))
break;

if(play=='3')
return;
}

registerbgidriver( EGAVGA_driver ); /*注冊vga驅動*/
initgraph(&gdriver,&gmode,"d:\\tc3\\bgi"); /*初始化圖形界面*/
cleardevice(); /*清除屏幕*/
setbkcolor(BLUE); /*將背景色設置成藍色*/
size=imagesize(startx,starty,startx+60,starty+60); /*計算生成60×60個象素的圖需要的位元組數*/
image=(unsigned char *)malloc(size); /*分配內存*/
maxx=getmaxx();
maxy=getmaxy();
randomize();

printf("Press ESC to exit game! ");
printf(" %c to fast speed,%c to low speed!",24,25);
do{

ok=0;
if(play=='1')
ch=random(9)+48;
if(play=='2')
ch=random(26)+65;
str[0]=ch;
do{

while(bioskey(1)==0) /*如果沒有按鍵就不停的循環*/
{
if(l==1) /*從左到右*/
{
n++;
angle=-1*(n*step)/M_PI*180/R;
if((int)(-1*angle)%360<dalta)
angle-=dalta;
if(n>(maxx-180)/step){
if(starty>maxy-100)
starty=20;
else
starty+=y;

l=0;
}
}
if(l==0) /*從右到左*/
{
--n;
angle=-1*(n*step)/R/M_PI*180;
if((int)(-1*angle)%360<dalta)
angle-=dalta;

if(n==1){
if(starty>maxy-100)
starty=20;
else
starty+=y;

l=1;
}
}

draw_car(startx+n*step,starty,str);
}

temch=bioskey(0);
if(temch==FAST){
step+=10;
y+=10;
}
if(temch==LOW){
step-=10;
y-=10;
}
ok=temch&0x00ff;

if((ok==ch)||(ok==ch+32)){
ok=1;
starty=20;
break;
}

}while(temch!=ESC);
if(ok!=1)
break;
}while(1);
free(image);
closegraph();
return;
}

int draw_car(int x,int y,char *ch){
setcolor(YELLOW); /*設置前景色為黃色*/
rectangle(x,y,x+60,y+40); /*畫車廂*/

pieslice(x+15,y+50,angle,angle-dalta,10); /*畫輪上的小片扇形部分*/
pieslice(x+45,y+50,angle,angle-dalta,10);

setfillstyle(SOLID_FILL, YELLOW); /*設置填充模式為實填充,顏色為黃色*/
circle(x+15,y+50,10); /*畫車輪*/
circle(x+45,y+50,10);
circle(x+15,y+50,3);
circle(x+45,y+50,3);
setcolor(WHITE);
settextstyle(1,0,4);
outtextxy(x+25,y,ch);
getimage(x,y,x+60,y+60,image); /*獲取當前的圖片*/
delay(200);
putimage(x,y,image,XOR_PUT); /*使用異或模式將圖片顯示上去*/

return;
}

④ 課程設計之打字游戲(c語言或c++),要詳細的實驗報告

分少就算了,還只有一句話。
你要的是怎樣的打字游戲呢?

⑤ 匯編語言程序神經打字游戲報告

分數太少了。
報告就不寫了。
這個分數只夠源代碼的。
;--------------------------------------------------------------------------------
;此模板是純DOS程序代碼,需要MASM5.0,編譯時請使用"編譯 -> DOS"方式。
;--------------------------------------------------------------------------------
Init_game macro op1,op2,op3,op4,op5,op6

mov cx,00h
mov dh,op1
mov dl,op2
op6:
mov ah,02h
mov bh,00h
int 10h

push cx
mov ah,0ah
mov al,op3
mov bh,00h
mov cx,01h
int 10h
pop cx

inc cx
inc op4
cmp cx,op5
jne op6

endm

clear_screen macro op1,op2,op3,op4
mov ah,06h
mov al,00h
mov bh,07h
mov ch,op1
mov cl,op2
mov dh,op3
mov dl,op4
int 10h

mov ah,02h
mov bh,00h
mov dh,00h
mov dl,00h
int 10h
endm

menu macro op1,op2,op3
mov ah,02h
mov bh,00h
mov dh,op1
mov dl,op2
int 10h

mov ah,09h
lea dx,op3
int 21h
endm

data segment

linjiang db "Made by lin jiang$"
no db "NO.:021411$"
meg db "Let us have a game!!Come on!!$"
meg1 db "**Select Menu**$"
meg2 db "Please select the game speed,ESC to quit.$"
meg3 db "1.Very slow Too easy,speed up!$"
meg4 db "2.Slow Everybody can deal.$"
meg5 db "3.Nomal I think you can deal!$"
meg6 db "4.Fast A challenge.Pay attention!$"
meg7 db "5.Very Fast Too hard,Have a try?$"
meg8 db "6.Fastest Are you crazy??$"
meg9 db "*Select the number among 1-6 and press ENTER to start!*$"
meg10 db "Game Speed Select:$"

hotkey db "When you are playing games:$"
hotkey1 db "ESC to return to menu$"
hotkey2 db "SPACE to pause the game$"
hotkey3 db "Press any key to play games......$"
hotkey4 db "Are you ready??$"

failmeg db "The letter is arrive the bottom, You are lost ! :($"
failmeg0 db "Press ENTER to go on......$"
failmeg1 db "Game is over!$"
failmeg2 db "Press ENTER to return menu and press ESC to exit!$"
failmeg3 db "Bye-Bye!Thank for your playing!!$"
failmeg4 db "Press any key to quit......$"

speed dw 00d,1200d,800d,600d,400d,200d,100d

letters db "jwmilzoeucgpravskntxhdyqfb"
db "iytpkwnxlsvxrmofzhgaebudjq"
db "nwimzoexrphysfqtvdcgljukda"

letters_bak db "jwmilzoeucgpravskntxhdyqfb"
db "iytpkwnxlsvxrmofzhgaebudjq"
db "nwimzoexrphysfqtvdcgljukda"

letter_counter db 0
life_flag db 78 p(0)

position_flag db 78 p(0)
present_position db 1

data ends

stack segment para stack 'stack'
db 64 p(0)
stack ends

code segment
main proc far
assume cs:code,ds:data,ss:stack
start:

mov ax,data
mov ds,ax

mov letter_counter,00h
mov present_position,1

lea si,position_flag

mov ah,00h
mov cx,00h

init_postion_flag:
mov [si],ah
inc si
inc cx
cmp cx,78d
jne init_postion_flag

lea di,letters
lea si,letters_bak
mov cx,00h
init_letters:
mov ah,[si]
mov [di],ah
inc si
inc di
inc cx
cmp cx,78d
jne init_letters

mov ah,00h
lea si,life_flag
mov cx,00h
init_life_flag:
mov [si],ah
inc si
inc cx
cmp cx,78d
jne init_life_flag

mov cx,00h
mov ah,01h
or ch,00010000b
int 10h

clear_screen 00d,00d,24d,79d

Init_game 00d,00d,0ah,dl,80d,nextsign1

Init_game 24d,00d,0ah,dl,80d,nextsign2

Init_game 00d,00d,0ah,dh,25d,nextsign3

Init_game 00d,79d,0ah,dh,25d,nextsign4

menu 01d,15d,meg ;菜單信息的宏展開
menu 01h,61d,linjiang
menu 03d,20d,meg1
menu 03d,68d,no
menu 05d,15d,meg2
menu 07d,15d,meg3
menu 09d,15d,meg4
menu 11d,15d,meg5
menu 13d,15d,meg6
menu 15d,15d,meg7
menu 17d,15d,meg8
menu 19d,15d,meg9
menu 22d,15d,meg10

input: mov ah,02h
mov bh,00h
mov dh,22d
mov dl,33d
int 10h

mov ah,0ah
mov al," "
mov bh,00h
mov cx,01h
int 10h

mov ah,01h
int 21h
retry: cmp al,"1"
je speed1
cmp al,"2"
je speed2
cmp al,"3"
je speed3
cmp al,"4"
je speed4
cmp al,"5"
je speed5
cmp al,"6"
je speed6
cmp al,1bh
je to_over0
jmp input

to_over0:jmp over

speed1: mov ah,01h
int 21h
cmp al,0dh
jne otherkey
mov ax,speed+2
mov speed,ax
jmp begin

speed2: mov ah,01h
int 21h
cmp al,0dh
jne otherkey
mov ax,speed+4
mov speed,ax
jmp begin

speed3: mov ah,01h
int 21h
cmp al,0dh
jne otherkey
mov ax,speed+6
mov speed,ax
jmp begin

speed4: mov ah,01h
int 21h
cmp al,0dh
jne otherkey
mov ax,speed+8
mov speed,ax
jmp begin

speed5: mov ah,01h
int 21h
cmp al,0dh
jne otherkey
mov ax,speed+10
mov speed,ax
jmp begin

speed6: mov ah,01h
int 21h
cmp al,0dh
jne otherkey
mov ax,speed+12
mov speed,ax
jmp begin

otherkey: ; 處理重復輸入的代碼段

push ax
mov ah,02h
mov bh,00h
mov dh,22d
mov dl,34d
int 10h

mov ah,0ah
mov al," "
mov bh,00h
mov cx,01h
int 10h

mov ah,02h
mov bh,00h
mov dh,22d
mov dl,33d
int 10h
pop ax

mov dx,ax
mov ah,02h
int 21h

jmp retry

begin:

clear_screen 01d,01d,23d,78d

menu 08d,20d,hotkey
menu 10d,20d,hotkey1
menu 12d,20d,hotkey2
menu 14d,20d,hotkey4
menu 16d,20d,hotkey3

mov ah,07h
int 21h

clear_screen 01d,01d,23d,78d
Init_game 23d,01d,01h,dl,78d,nextsign5

mov ah,02h ;游標初始化
mov bh,00h
mov dh,01h
mov dl,01h
int 10h

mov cx,00h
lea si,letters
nextletter: ; 初始化屏幕上方的字母
mov ah,02h
mov dl,[si]
int 21h

inc si
inc cx
cmp cx,78d
je nextcycle
jmp nextletter

from_front: ; 相關循環的演算法
sub present_position,78d
jmp gobackto_si

find_zero:cmp letter_counter,78d
je recycle

cmp present_position,78d
je from_one

mov ah,00h
nextsi: add present_position,01h
inc si
cmp [si],ah
je gobackto_di

cmp present_position,78d
je from_one

jmp nextsi

from_one:mov present_position,01h

jmp gobackto_si

recycle:mov letter_counter,00h
mov present_position,01d
lea si,position_flag
mov cx,00h

mov ah,00h
clearsi: mov [si],ah
inc cx
cmp cx,78d
je nextcycle
inc si
jmp clearsi

nextcycle:
lea di,letters
lea si,position_flag
add present_position,31d
cmp present_position,78
ja from_front

gobackto_si:
add si,word ptr present_position
dec si
mov ah,[si]
cmp ah,01h
je find_zero

gobackto_di:
mov ah,01h
mov [si],ah
add di,word ptr present_position
dec di
mov dl,present_position

mov ah,02h ; 字母下落的代碼段部分
mov bh,00h
mov dh,01h
int 10h

mov cx,00h
nextrow:push cx ; 新的一行

mov cx,00h
out_cycle: ; 延遲
push cx
mov cx,00h
in_cycle:
add cx,01h
cmp cx,50000d
jne in_cycle

push dx
mov ah,06h
mov dl,0ffh
int 21h
pop dx

jz pass ; 如果鍵盤緩沖區部分為空,則跳轉

cmp al,1bh ; 如果鍵入ESC,則返回主菜單
je to_start1

cmp al," " ;如果鍵入SPACE,則游戲暫停
je pause

cmp al,[di] ;輸入字母正確!跳轉!
je disappear

pass:
pop cx
inc cx
cmp cx,speed
je print
jmp out_cycle

pause: push dx ;暫停處理
mov ah,06h
mov dl,0ffh
int 21h
pop dx
cmp al," "
jne pause

jmp pass

to_start1: ;返回主菜單
jmp start

print:

mov ah,0ah
mov al," "
mov bh,00h
mov cx,01h
int 10h

inc dh
mov ah,02h
mov bh,00h
int 10h

mov ah,0ah
mov al,[di]
mov bh,00h
mov cx,01h
int 10h

pop cx
inc cx
cmp cx,21d
je print_next_letter
jmp nextrow ; 下一行

disappear: ; 擊中字母後的相關處理
pop cx
pop cx

mov ah,0ah
mov al," "
mov bh,00h
mov cx,01h
int 10h

jmp hit

print_next_letter: ; 處理原位置的空缺
lea si,life_flag
add si,word ptr present_position
dec si

mov ah,[si]
cmp ah,1
je fail

mov ah,0ah
mov al," "
mov bh,00h
mov cx,01h
int 10h

inc dh
mov ah,02h
mov bh,00h
int 10h

mov ah,0ah
mov al," "
mov bh,00h
mov cx,01h
int 10h

mov ah,1
mov [si],ah

hit: mov ah,02h
mov bh,00h
mov dh,01h
mov dl,present_position
int 10h

mov al,[di] ; 出現下一個新字母的數法
add al,7
cmp al,7ah
ja convey_letter
mov ah,0ah
mov bh,00h
mov cx,01h
int 10h

mov [di],al
add letter_counter,01h
jmp nextcycle

convey_letter:
sub al,7ah
add al,61h
mov ah,0ah
mov bh,00h
mov cx,01h
int 10h

mov [di],al
add letter_counter,01h
jmp nextcycle

fail: mov ah,0ah ;游戲失敗後的相關處理
mov al," "
mov cx,01h
int 10h

inc dh
mov ah,02h
mov bh,00h
int 10h

mov ah,0ah
mov al,[di]
mov bh,00h
mov cx,01h
int 10h

mov ah,02h
mov bh,00h
mov dh,12d
mov dl,17d
int 10h

push dx
mov ah,09h
lea dx,failmeg
int 21h
pop dx

add dh,2
mov ah,02h
mov bh,00h
int 10h

mov ah,09h
lea dx,failmeg0
int 21h

re: mov ah,07h
int 21h
cmp al,0dh
jne re

clear_screen 01,01,23,78
mov ah,02h
mov bh,00h
mov dh,11d
mov dl,20d
int 10h

push dx
mov ah,09h
lea dx,failmeg1
int 21h
pop dx

inc dh
inc dh
mov ah,02h
mov bh,00h
int 10h

mov ah,09h
lea dx,failmeg2
int 21h

notkey:
mov ah,07h
int 21h
cmp al,0dh
je to_start
cmp al,1bh
je over
jmp notkey
to_start:
clear_screen 00,00,24,79
jmp start

over: clear_screen 01,01,23,78
mov ah,02h
mov bh,00h
mov dh,11d
mov dl,15h
int 10h

mov ah,09h
lea dx,failmeg3
int 21h

mov ah,02h
mov bh,00h
mov dh,13d
mov dl,15h
int 10h

mov ah,09h
lea dx,failmeg4
int 21h

mov ah,07h
int 21h

mov ah,07h
int 21h

clear_screen 00,00,24,79

mov ax,4c00h
int 21h

main endp
code ends
end start

⑥ 急!!!!C程序小型打字游戲程序報告,要求帶模塊圖,程序說明,實驗結果與分析,實驗結論及體會。

打字游戲 的 設計報告!!! 分數太少了。報告就不寫了。這個分數只;此模板是純DOS程序代碼,需要MASM5.0,編譯時請使用"編譯 -> DOS"方式。

⑦ c語言課程設計(打字測驗平台)

void Type(int num)
{
FILE *fp;
FILE *userfp;
int i,j,k;
char chose;
clock_t c1,c2;
char fname[30];
char read[51];
char type[51];
char error[200];
//char wrong[51];
char etype[200];
float time,percent,speed;
i=0;j=0;k=0;
loop4: printf("\t=============\n");
//printf("\t1.選擇課文\n");
printf("\t2.自定義文章\n");
printf("\t3.錯誤練習\n");
printf("\t=============\n");
chose=getch();
/*if(chose=='1')
{
printf("\n");
printf("\n");
chose=getch();
switch(chose)
{
case '1':
str(fanme,"");
default :
printf("輸入錯誤,重新選擇!\n");
goto loop4;
}
}*/
//else
//{
if(chose==2)
{
printf("\n");
for(j=0;j<30;j++)
scanf("%c",fname[j]);
}
else
{
if((fuser=fopen(FUSER,"rb+"))==NULL)
{
printf("用戶文件無法打開!\n");
goto end;
}
fseek(fuser,num*SIZE,SEEK_SET);
fread(&A,SIZE,1,fuser);
for(i=0;A.error[i]!='\0';i++)
printf("\tA.error[i]");
for(j=0;j<=i;j++)
scanf("%c",etype[j]);
fclose(fuser);
}
// }
if((fp=(fopen(fname,"r")))==NULL)
{
printf("\n文件打開失敗!");
goto end;
}
c1=clock();
while(!feof(fp))
{
fread(&read,sizeof(char),50,fp);
for(i=0;i<50;i++)
{
printf("%c",read[i]);
k++;
}
printf("type this line\n");
for(i=0;i<51;i++)
scanf("%c",type[i]);
type[51]='\0';
for(i=0;i<51;i++)
if(read[i]!=type[i])
{
error[j]=read[i];
j++;
}
}
c2=clock();
percent=(float)(j)/(float)(k);
printf("您的錯誤率是%f\n",percent);
time=(float)(c2-c1)/CLOCKS_PER_SEC;
printf("您所用時間是%f\n",time);
speed=float(k)/time;
printf("您的打字速度是%4f個/s\n",speed);
if((fuser=fopen(FUSER,"rb+"))==NULL)
{
printf("用戶文件無法打開!\n");
goto end;
}

}

⑧ C++有個簡單的課程設計是打字游戲

#include<iostream>
#include<conio.h>
#include<time.h>
usingnamespacestd;
intmain()
{
cout<<"打字游戲"<<endl;
cout<<"按1開始游戲,按0結束游戲"<<endl;
intgo;
cin>>go;
if(go==1)
{
clock_tstart,finish;
system("color3");
chars[100]={"howareyou"};
cout<<s<<endl;
start=clock();//游戲開始時間
charch;
inti=0;
while(i<11)
{
ch=getch();
if(ch==s[i])
{
cout<<ch;
system("color4");
i++;
}
else
{
cout<<'a';//響鈴提示輸入錯誤
}
}
finish=clock();//游戲結束時間
cout<<endl;
inttime=finish-start;
system("color5");
cout<<"游戲結束"<<endl;
cout<<"用時"<<time<<"毫秒"<<endl;
}
else
if(go==0)
{
cout<<"謝謝"<<endl;
}

return0;
}

⑨ c語言打字游戲

想到了小霸王學習機,呵呵.

熱點內容
武漢大學學生會輔導員寄語 發布:2021-03-16 21:44:16 瀏覽:612
七年級學生作文輔導學案 發布:2021-03-16 21:42:09 瀏覽:1
不屑弟高考成績 發布:2021-03-16 21:40:59 瀏覽:754
大學畢業證會有成績單 發布:2021-03-16 21:40:07 瀏覽:756
2017信陽學院輔導員招聘名單 發布:2021-03-16 21:40:02 瀏覽:800
查詢重慶2018中考成績查詢 發布:2021-03-16 21:39:58 瀏覽:21
結業考試成績怎麼查詢 發布:2021-03-16 21:28:40 瀏覽:679
14中醫醫師資格筆試考試成績查分 發布:2021-03-16 21:28:39 瀏覽:655
名著賞析課程標准 發布:2021-03-16 21:27:57 瀏覽:881
北京大學商業領袖高端培訓課程 發布:2021-03-16 21:27:41 瀏覽:919