亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來(lái)到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? user.c

?? 24點(diǎn)游戲,DOS下運(yùn)行的,增加了輸入驗(yàn)證的強(qiáng)度,可以在程序中對(duì)答案進(jìn)行查詢
?? C
字號(hào):
/*界面功能函數(shù)模塊*/
#include "MAGIC.h"
#include <stdio.h>
#include <stdlib.h>
#include <graphics.h>
#include <conio.h>
#include <io.h>
#include <time.h>
#include <bios.h>
#include <math.h>
#include <string.h>

char *BMP0[13]={"card\\1.bmp","card\\2.bmp","card\\3.bmp","card\\4.bmp","card\\5.bmp",
                "card\\6.bmp","card\\7.bmp","card\\8.bmp","card\\9.bmp","card\\10.bmp",
                "card\\11.bmp","card\\12.bmp","card\\13.bmp"};
char *BMP1[13]={"card\\14.bmp","card\\15.bmp","card\\16.bmp","card\\17.bmp","card\\18.bmp",
                "card\\19.bmp","card\\20.bmp","card\\21.bmp","card\\22.bmp","card\\23.bmp",
                "card\\24.bmp","card\\25.bmp","card\\26.bmp"};
char *BMP2[13]={"card\\27.bmp","card\\28.bmp","card\\29.bmp","card\\30.bmp","card\\31.bmp",
                "card\\32.bmp","card\\33.bmp","card\\34.bmp","card\\35.bmp","card\\36.bmp",
                "card\\37.bmp","card\\38.bmp","card\\39.bmp"};
char *BMP3[13]={"card\\40.bmp","card\\41.bmp","card\\42.bmp","card\\43.bmp","card\\44.bmp",
                "card\\45.bmp","card\\46.bmp","card\\47.bmp","card\\48.bmp","card\\49.bmp",
                "card\\50.bmp","card\\51.bmp","card\\52.bmp"};

char *ntostr(int n,char Str[])
{
    int i=0,temp=n;

    do
    {
        i++;
        temp=temp/10;
    }while(temp);

    Str[i]='\0';

    while(i--)
    {
        Str[i]=n%10+48;
        n=n/10;
    }
    return Str;
}

void NewQues(int *a,int *b,int *c,int *d)                  /*出題函數(shù)*/
{
    char out[3]="00";

    srand(time(NULL));
    *a=rand()%13+1;
    *b=rand()%13+1;
    *c=rand()%13+1;
    *d=rand()%13+1;

    DrawBMP(120,50,BMP0[*a-1]);
    DrawBMP(220,50,BMP1[*b-1]);
    DrawBMP(320,50,BMP2[*c-1]);
    DrawBMP(420,50,BMP3[*d-1]);

    setcolor(WHITE);
    rectangle(120,165,490,200);

    setfillstyle(1,BLUE);
    bar(121,166,489,199);
    bar(311,301,633,439);

    settextstyle(DEFAULT_FONT,HORIZ_DIR,1);
    setcolor(WHITE);
    outtextxy(315,310,"   Make sure you have used the number");
    outtextxy(315,325,"ABOVE, and the symbols of the formula");
    outtextxy(315,340,"are NOT ILLEGAL.   Some Questions may");
    outtextxy(315,355,"have  more than  one answer, but you");
    outtextxy(315,370,"just input ONE. For the Questions has");
    outtextxy(315,385,"no answer, please input \'0\' instead.");
    setcolor(LIGHTGREEN);
    outtextxy(315,420,"Press ESC to quit the game. HAVE FUN!");

    setfillstyle(1,BLUE);
    bar(6,441,633,456);
    setcolor(YELLOW);
    outtextxy(155,445,"Use \'+ - * / \' and \'( )\' to calculate 24!");

    setcolor(LIGHTGREEN);
    settextstyle(DEFAULT_FONT,HORIZ_DIR,2);

    outtextxy(145,175,ntostr(*a,out));
    outtextxy(245,175,ntostr(*b,out));
    outtextxy(345,175,ntostr(*c,out));
    outtextxy(445,175,ntostr(*d,out));
}

int Justify(int a,int b,int c,int d,char Form[])    /*輸入驗(yàn)證是否為題目數(shù)字*/
{
    int i=0,j,temp=0,flag=0,key=0,count=0;
    int Just[4];

    Just[0]=a;
    Just[1]=b;
    Just[2]=c;
    Just[3]=d;
    
    do
    {
        if(Form[i]>='0'&&Form[i]<='9')
        {
            temp=temp*10+(Form[i]-48);
            flag=1;
        }
        else if(flag)
        {
            flag=0;

            for(j=0;j<4;j++)
            {
                if(temp==Just[j])
                {
                    Just[j]=-1;
                    key++;
                    break;
                }
            }
            count++;
            temp=0;
         }

    }while(Form[i++]!='\0');

    if(key==4&&count==4) return 1;
    else return 0;
}


void Welcome(void)                          /*歡迎界面*/
{
    setfillstyle(2,LIGHTBLUE);
    bar(20,80,619,120);

    setcolor(DARKGRAY);
    settextstyle(0,HORIZ_DIR,6);
    outtextxy(120,80,"Magic 24");

    setcolor(WHITE);
    outtextxy(115,77,"Magic 24");

    setcolor(LIGHTGRAY);
    settextstyle(0,HORIZ_DIR,1);
    outtextxy(90,450,"Version: Beta 1.1   Copyright (C) 2007 by snow_by@tom.com");

    DrawBMP(200,150,"card\\120.bmp");

    do
    {
        FlashText();

    }while(getch()!=13);
}

void Quit(void)
{
    void *buf;
    int size;
    char ch;

    size=imagesize(155,190,465,270);
    buf=malloc(size);

    getimage(155,190,465,270,buf);

    setfillstyle(1,RED);
    bar(155,190,465,270);

    setlinestyle(0,0,1);
    setcolor(YELLOW);
    rectangle(160,193,460,267);
    settextstyle(DEFAULT_FONT,HORIZ_DIR,1);
    outtextxy(168,230,"Are You Sure to Quit the Game?(Y/N)");
    Flash(448,230,YELLOW,RED,1);

    ch=getch();

    if(ch=='y'||ch=='Y')
    {
        closegraph();
        exit(0);
    }

    putimage(155,190,buf,COPY_PUT);
    free(buf);
}

void Showup(void)
{
    void *buf1,*buf2,*buf3,*buf4,*buf5;
    unsigned size;
    char ch;

    int gdriver=VGA,gmode=VGAHI;

    int i=0;
    int a,b,c,d;
    char *Ans[100];

    size=imagesize(0,0,639,100);
    buf1=malloc(size);
    getimage(0,0,639,100,buf1);

    size=imagesize(0,101,639,201);
    buf2=malloc(size);
    getimage(0,101,639,201,buf2);

    size=imagesize(0,202,639,302);
    buf3=malloc(size);
    getimage(0,202,639,302,buf3);

    size=imagesize(0,303,639,403);
    buf4=malloc(size);
    getimage(0,303,639,403,buf4);

    size=imagesize(0,404,639,479);
    buf5=malloc(size);
    getimage(0,404,639,479,buf5);

    closegraph();

    printf("Please Input 4 Numbers:\n");
    scanf("%d%d%d%d",&a,&b,&c,&d);
    fflush(stdin);

    Magic(a,b,c,d,Ans);

    printf("\n");
    while(Ans[i]!=NULL&&i<100)
    {
         printf("%s\n",Ans[i]);
         i++;
    }
    printf("\n\nMagic24 Version: Beta 1.1  Copyright (C) 2007 by snow_by@tom.com\n");
    printf("\nPress any key to return...");
    getch();

    initgraph(&gdriver,&gmode,"c:\\tc");

    putimage(0,0,buf1,COPY_PUT);
    putimage(0,101,buf2,COPY_PUT);
    putimage(0,202,buf3,COPY_PUT);
    putimage(0,303,buf4,COPY_PUT);
    putimage(0,404,buf5,COPY_PUT);

    free(buf1);
    free(buf2);
    free(buf3);
    free(buf4);
    free(buf5);

}

void DrawBK(void)                         /*畫背景*/
{
    setfillstyle(1,BLUE);
    bar(0,0,639,479);

    setcolor(WHITE);
    setlinestyle(0,1,NORM_WIDTH);

    line(5,10,634,10);
    line(5,12,634,12);
    line(5,457,634,457);
    line(5,10,5,457);
    line(634,10,634,457);

    line(5,300,634,300);
    line(5,230,634,230);

    line(5,440,634,440);
    line(310,300,310,440);

    setfillstyle(1,LIGHTGRAY);
    bar(5,460,634,475);
    
    setcolor(WHITE);
    settextstyle(DEFAULT_FONT,HORIZ_DIR,1);
    outtextxy(90,465,"Version: Beta 1.1   Copyright (C) 2007 by snow_by@tom.com");

    setfillstyle(1,BLUE);
    bar(270,10,349,20);
    settextstyle(DEFAULT_FONT,HORIZ_DIR,1);
    outtextxy(270,8," Question ");

    setfillstyle(1,BLUE);
    bar(255,220,359,240);
    settextstyle(DEFAULT_FONT,HORIZ_DIR,1);
    setcolor(WHITE);
    outtextxy(260,226,"Answer Sheet");
    setcolor(LIGHTGREEN);
    outtextxy(50,265,"Your Anwser is:");

    setcolor(CYAN);
    outtextxy(70,320,"Question Num:");
    outtextxy(70,350,"Right  Count:");
    outtextxy(70,380,"Wrong  Count:");
    outtextxy(70,410,"Tatal  Score:");


}

void FlashText(void)                      /*歡迎界面中的閃爍文字*/
{
    int timer;

    settextstyle(0,HORIZ_DIR,2);

    while(bioskey(1)==0)
    {
        setcolor(BLUE);
        outtextxy(100,400,"Press ENTER to continue...");
        setcolor(LIGHTBLUE);
        outtextxy(96,398,"Press ENTER to continue...");
        timer=clock();

        while(((clock()-timer)<5));

        setcolor(BLACK);
        outtextxy(100,400,"Press ENTER to continue...");
        outtextxy(96,398,"Press ENTER to continue...");
        timer=clock();

        while(((clock()-timer)<5));
    }    
}

void Flash(int x,int y,int color,int bkcolor,int size)                     /*輸入時(shí)的閃爍光標(biāo)*/
{
    int timer;

    settextstyle(DEFAULT_FONT,HORIZ_DIR,size);

    while(bioskey(1)==0)
    {
        setcolor(color);
        outtextxy(x,y,"_");
        timer=clock();

        while(((clock()-timer)<5)&&(bioskey(1)==0));

        setcolor(bkcolor);
        outtextxy(x,y,"_");
        timer=clock();

        while(((clock()-timer)<5)&&(bioskey(1)==0));
    }

}


void GetText(int x,int y,char *Str)             /*取得用戶輸入*/
{
    int i=0;
    char ch;

    settextstyle(DEFAULT_FONT,HORIZ_DIR,2);
    setcolor(WHITE);

    Flash(x,y,WHITE,BLUE,2);

    while((ch=getch())!=13)
    {
        if(ch==8)
        {
            if(i!=0)
            {
                x-=20;
                setcolor(BLUE);
                outtextxy(x,y,Str+i-1);
                setcolor(WHITE);
                Str[--i]='\0';
            }
        }
        else if(((ch>='0'&&ch<='9')||ch=='('||ch==')'||ch=='+'||ch=='-'||ch=='*'||ch=='/')&&i<18)
        {
            Str[i]=ch;
            Str[++i]='\0';

            setcolor(WHITE);
            outtextxy(x,y,Str+i-1);
            x+=20;
        }
        else if(ch==27) Quit();
        else if((ch=='|')&&(bioskey(2)&1)&&(bioskey(2)&2)) Showup();

        Flash(x,y,WHITE,BLUE,2);

    }
    return;
}

int DrawBMP(int x,int y,char filename[])            /*繪圖函數(shù)*/
{   

    int i,j=0;
    int width,height;
    int bytenum;
    unsigned char byte;
    FILE *fp;

    fp=fopen(filename,"rb");

    if(fp==NULL)
    {
        return 0;
    }

    fseek(fp,18,SEEK_SET);
    fread(&width,4,1,fp);
    fread(&height,4,1,fp);

    fseek(fp,118,SEEK_SET);

    for(i=y+height-1;i>=y;i--)
    {
        bytenum=0;

        for(j=x;j<width+x;j++)
        {
            fread(&byte,1,1,fp);
            bytenum++;

            putpixel(j,i,SetColor(byte>>4));
            putpixel(++j,i,SetColor(byte&0x0f));
        }

        while(bytenum%4)
        {
            fseek(fp,1,SEEK_CUR);
            bytenum++;
        }
    }

    fclose(fp);

    return 1;
}

int SetColor(int color)                /*顏色值轉(zhuǎn)換*/
{
    switch(color)
    {
        case 0:
            return 0;
        case 1:
            return 4;
        case 2:
            return 2;
        case 3:
            return 6;
        case 4:
            return 1;
        case 5:
            return 5;
        case 6:
            return 3;
        case 7:
            return 8;
        case 8:
            return 7;
        case 9:
            return 12;
        case 10:
            return 10;
        case 11:
            return 14;
        case 12:
            return 9;
        case 13:
            return 13;
        case 14:
            return 11;
        case 15:
            return 15;
    }
}


?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品麻豆99久久久久久| 成人黄色777网| 欧美久久高跟鞋激| 日韩伦理av电影| eeuss鲁一区二区三区| 1024国产精品| 在线视频一区二区三| 亚洲国产aⅴ成人精品无吗| 欧美高清www午色夜在线视频| 日韩国产一区二| 欧美不卡123| 国产成人av网站| 中文字幕永久在线不卡| 在线观看视频91| 日韩精品1区2区3区| 久久久蜜桃精品| 国产自产2019最新不卡| 国产亚洲成aⅴ人片在线观看| 国产一区二区三区av电影| 一区在线观看免费| 欧美日韩一区不卡| 国产麻豆精品在线| 一区二区在线观看视频在线观看| 欧美人狂配大交3d怪物一区| 精品无人码麻豆乱码1区2区| 欧美激情在线观看视频免费| 欧美视频在线一区| 国产91露脸合集magnet| 亚洲一区二区三区自拍| 精品免费国产二区三区| 99国产精品久久久| 美女网站色91| 亚洲视频香蕉人妖| 精品国产凹凸成av人导航| 91美女在线观看| 国产一区二区三区不卡在线观看| 亚洲欧美电影一区二区| 欧美精品一区二区不卡| 欧美视频一区在线观看| 粉嫩绯色av一区二区在线观看| 亚洲一区二区欧美日韩| 精品美女一区二区三区| 99视频超级精品| 国模少妇一区二区三区| 亚洲国产日韩a在线播放| 亚洲国产精品v| 日韩免费看的电影| 在线观看一区二区精品视频| 国产成人综合在线观看| 蜜臀精品一区二区三区在线观看| 中文字幕一区二区5566日韩| 久久人人爽爽爽人久久久| 欧美人妖巨大在线| 色综合久久综合网欧美综合网 | 日韩一区二区三区在线| 国产成人精品三级麻豆| 日韩国产欧美在线视频| 亚洲激情图片qvod| 久久综合狠狠综合久久综合88| 色噜噜狠狠成人网p站| 国产一区二区不卡老阿姨| 亚洲国产精品久久久男人的天堂| 国产精品午夜在线观看| 欧美人xxxx| 成人app在线观看| 狠狠久久亚洲欧美| 亚洲欧美日韩国产另类专区| 精品女同一区二区| 欧美日韩极品在线观看一区| 国产成人免费视频一区| 日韩精品午夜视频| 亚洲免费av网站| 久久综合九色综合欧美就去吻| 色88888久久久久久影院野外| 精品一区二区在线视频| 亚洲bdsm女犯bdsm网站| 国产精品免费视频一区| 亚洲国产岛国毛片在线| 国产欧美日韩另类视频免费观看| 欧美日韩国产在线观看| 91在线小视频| 国产乱人伦精品一区二区在线观看| 男人的天堂久久精品| 一区二区在线免费观看| 国产精品区一区二区三区 | 欧美一级久久久久久久大片| 99久久久精品| 国产乱人伦偷精品视频不卡| 久久精品国产亚洲一区二区三区| 91麻豆成人久久精品二区三区| av福利精品导航| 久久久91精品国产一区二区三区| 欧美mv和日韩mv的网站| 日韩三级.com| 91精品国产综合久久久蜜臀粉嫩| 在线不卡一区二区| 欧美一个色资源| 日韩美女视频在线| 久久午夜国产精品| 精品欧美一区二区久久| 中文在线一区二区| 中文字幕精品三区| 国产精品网站导航| 亚洲视频网在线直播| 亚洲.国产.中文慕字在线| 日本亚洲三级在线| 国产mv日韩mv欧美| 在线观看av一区二区| 日韩精品最新网址| 中文字幕一区二区三区蜜月| 亚洲电影视频在线| 国产一区二区三区精品欧美日韩一区二区三区| 国产在线精品国自产拍免费| 99精品国产视频| 日韩午夜av一区| 亚洲欧洲另类国产综合| 日韩av一区二区三区四区| 国产成人av电影在线| 在线中文字幕不卡| 久久影音资源网| 一卡二卡三卡日韩欧美| 免费高清成人在线| 91小视频在线免费看| 欧美成人精品高清在线播放| 中文字幕综合网| 久久疯狂做爰流白浆xx| 91视频国产资源| 精品国产精品一区二区夜夜嗨| 亚洲男女毛片无遮挡| 精彩视频一区二区三区| 日本高清无吗v一区| 久久精品人人做人人综合| 午夜久久久久久电影| 成人免费av网站| 日韩精品一区二区三区中文精品 | 欧美在线小视频| 国产日韩欧美一区二区三区乱码| 五月激情六月综合| 91麻豆国产在线观看| 国产日韩欧美精品在线| 日本中文一区二区三区| 在线亚洲精品福利网址导航| 中文字幕精品三区| 久久精品国产精品亚洲红杏| 在线观看网站黄不卡| 国产精品不卡视频| 国产精品正在播放| 精品少妇一区二区三区视频免付费 | 91色porny蝌蚪| 久久久天堂av| 国内外精品视频| 日韩一区二区三区三四区视频在线观看 | 国产精品乱码一区二区三区软件 | 26uuu亚洲| 看电视剧不卡顿的网站| 欧美高清激情brazzers| 亚洲一区二区三区中文字幕| 91在线观看地址| 亚洲三级免费观看| 91丨九色porny丨蝌蚪| 亚洲欧美综合网| 成人天堂资源www在线| 日本一区二区三区国色天香| 国产老女人精品毛片久久| 精品国产精品网麻豆系列| 久久精品99国产精品| 精品日产卡一卡二卡麻豆| 日本午夜精品视频在线观看 | 欧美精品一区二区高清在线观看| 日本欧美加勒比视频| 欧美丰满美乳xxx高潮www| 五月综合激情婷婷六月色窝| 欧美午夜在线观看| 五月天激情综合网| 欧美一区二区三区啪啪| 看国产成人h片视频| 久久女同精品一区二区| 丁香网亚洲国际| 亚洲色欲色欲www| 欧美体内she精高潮| 日韩精品乱码免费| 日韩一级免费观看| 久久er99精品| 国产欧美日韩视频一区二区| 不卡一卡二卡三乱码免费网站| 自拍偷在线精品自拍偷无码专区| 色婷婷国产精品久久包臀 | 欧美日韩一级视频| 亚洲.国产.中文慕字在线| 欧美一区二区三区四区视频| 久国产精品韩国三级视频| 国产欧美日韩视频在线观看| 99re热这里只有精品视频| 一区二区国产视频| 日韩片之四级片| 成人一区二区三区中文字幕| 一区二区三区四区不卡在线| 91精品国产aⅴ一区二区| 国产精品影视在线观看| 亚洲色图视频网|