国产精品天干天干,亚洲毛片在线,日韩gay小鲜肉啪啪18禁,女同Gay自慰喷水

歡迎光臨散文網(wǎng) 會員登陸 & 注冊

C語言實現(xiàn)意大利炮小游戲

2020-12-29 15:35 作者:無關(guān)于李比都  | 我要投稿

#include <stdio.h>

#include <stdlib.h>

#include <conio.h>

#include <windows.h>

#include <time.h>

#include <string.h>

void HideCursor();

void gotoxy(int x, int y);

#define R 26?

#define N 5//通關(guān)分數(shù)

int ax[3] = { 0 }, y[3] = { 3,7,11 }, i, fd[3];

void cshcxhs()

{

? ? system(" 二營長的意大利炮");

? ? system("mode con cols=100 lines=30");

? ? HideCursor();

? ? gotoxy(46, 12);? printf("二營長的意大利炮");

? ? gotoxy(36, 14);? printf("w a d鍵控制方向,空格鍵開炮");

? ? gotoxy(26, 16); printf("打中小鬼子 |---0> 記一等功一次,打中自己人 >>>>0>記大過處分一次");

? ? gotoxy(40, 18);

? ? Sleep(2800);

? ? system("cls");

? ? int k;

? ? gotoxy(40, R);

? ? for (k = 0; k < 17; k++)? printf("_");

? ? gotoxy(46, R);

? ? printf("[_O_]");

? ? gotoxy(48, 25);

? ? printf("|");

? ? int j;

? ? srand((unsigned)time(NULL));

? ? for (j = 0; j < 3; j++)

? ? {

? ? ? ? ax[j] = rand() % R;

? ? ? ? fd[j] = rand() % 2;

? ? }


? ? gotoxy(0, R);

? ? printf("一等功次數(shù):");

}


void hcfjhs()

{

? ? gotoxy(ax[i], y[i]);

? ? if (fd[i] == 1)

? ? ? ? printf("|---0>");

? ? else

? ? ? ? printf(">>>>0>");

? ? gotoxy(ax[i] - 1, y[i]);

? ? printf(" ");

? ? ax[i]++;

}


void dhpdxshs()

{

? ? for (i = 0; i < 3; i++)

? ? {

? ? ? ? hcfjhs();


? ? ? ? if (ax[i] + 6 > 93)

? ? ? ? {

? ? ? ? ? ? gotoxy(94, y[i]);

? ? ? ? ? ? printf(" ");

? ? ? ? ? ? if (ax[i] + 6 >= 101)

? ? ? ? ? ? {

? ? ? ? ? ? ? ? ax[i] = rand() % R;

? ? ? ? ? ? ? ? fd[i] = rand() % 2;

? ? ? ? ? ? }

? ? ? ? }

? ? }

}

int da = 2, yip = 0, rtde = 1;

int shells_x, shells_y;

void ckkzhs()

{

? ? char ch;

? ? ch = _getch();


? ? if (ch == 'd' || ch == 'D')

? ? {

? ? ? ? gotoxy(49, 25);

? ? ? ? printf("/");

? ? ? ? gotoxy(47, 25);

? ? ? ? printf(" ");

? ? ? ? da = 3;

? ? }

? ? if (ch == 'A' || ch == 'a')

? ? {

? ? ? ? gotoxy(47, 25);

? ? ? ? printf("\\");

? ? ? ? gotoxy(48, 25);

? ? ? ? printf(" ");

? ? ? ? da = 1;

? ? }

? ? if (ch == 'W' || ch == 'w')

? ? {

? ? ? ? gotoxy(48, 25);

? ? ? ? printf("|");

? ? ? ? gotoxy(47, 25);

? ? ? ? printf(" ");

? ? ? ? gotoxy(49, 25);

? ? ? ? printf(" ");

? ? ? ? da = 2;

? ? }


? ? if (ch == ' ' && rtde == 0)

? ? {

? ? ? ? if (da == 2)

? ? ? ? ? ? yip = 2;


? ? ? ? if (da == 1)

? ? ? ? {

? ? ? ? ? ? yip = 1;

? ? ? ? ? ? shells_x = 45;

? ? ? ? }

? ? ? ? if (da == 3)

? ? ? ? {

? ? ? ? ? ? yip = 3;

? ? ? ? ? ? shells_x = 51;

? ? ? ? }

? ? ? ? shells_y = 23;

? ? }

}


void dpfshs()

{

? ? rtde = 1;

? ? if (yip == 2)

? ? {

? ? ? ? shells_x = 48;

? ? ? ? gotoxy(shells_x, shells_y -= 2);

? ? ? ? printf("o");

? ? ? ? gotoxy(shells_x, shells_y + 2);

? ? ? ? printf(" ");

? ? }

? ? if (yip == 1)

? ? {

? ? ? ? gotoxy(shells_x -= 2, shells_y -= 2);

? ? ? ? printf("o");

? ? ? ? gotoxy(shells_x + 2, shells_y + 2);

? ? ? ? printf(" ");

? ? }

? ? if (yip == 3)

? ? {

? ? ? ? gotoxy(shells_x += 2, shells_y -= 2);

? ? ? ? printf("o");

? ? ? ? gotoxy(shells_x - 2, shells_y + 2);

? ? ? ? printf(" ");

? ? }


? ? if (shells_y <= 1)

? ? {

? ? ? ? yip = 0;

? ? ? ? gotoxy(48, 1);

? ? ? ? printf(" ");

? ? ? ? gotoxy(23, 1);

? ? ? ? printf(" ");

? ? ? ? gotoxy(73, 1);

? ? ? ? printf(" ");

? ? ? ? rtde = 0;

? ? }

}


int score;


void pdfsjzhs()

{


? ? for (i = 0; i < 3; i++)

? ? {

? ? ? ? if (shells_x >= ax[i] && shells_x <= ax[i] + 6 && shells_y == y[i])

? ? ? ? {

? ? ? ? ? ? if (fd[i] == 1)

? ? ? ? ? ? ? ? score++;

? ? ? ? ? ? else

? ? ? ? ? ? {

? ? ? ? ? ? ? ? score--;

? ? ? ? ? ? ? ? if (score <= 0)

? ? ? ? ? ? ? ? ? ? score = 0;

? ? ? ? ? ? }

? ? ? ? ? ? rtde = 0;

? ? ? ? ? ? gotoxy(ax[i] - 1, y[i]);

? ? ? ? ? ? printf(" ");

? ? ? ? ? ? ax[i] = rand() % R;

? ? ? ? ? ? fd[i] = rand() % 2;

? ? ? ? ? ? gotoxy(shells_x, shells_y);

? ? ? ? ? ? printf(" ");

? ? ? ? ? ? shells_x = 0, shells_y = 0;

? ? ? ? }

? ? }

? ? gotoxy(9, R);

? ? printf("%d", score);

? ? if (score >= N)

? ? {

? ? ? ? system("cls");

? ? ? ? gotoxy(39, 15);

? ? ? ? printf("你TND還真是個人才!");

? ? ? ? gotoxy(0, 29);

? ? ? ? exit(0);

? ? }

}

void process()

{

? ? while (1)

? ? {

? ? ? ? dhpdxshs();

? ? ? ? if (_kbhit())

? ? ? ? {

? ? ? ? ? ? ckkzhs();

? ? ? ? }

? ? ? ? dpfshs();

? ? ? ? pdfsjzhs();

? ? ? ? Sleep(18);

? ? }

}

int main()

{

? ? cshcxhs();

? ? process();

? ? return 0;

}

void HideCursor()

{

? ? CONSOLE_CURSOR_INFO cursor_info = { 1, 0 };

? ? SetConsoleCursorInfo(GetStdHandle(STD_OUTPUT_HANDLE), &cursor_info);

}

void gotoxy(int x, int y)

{

? ? COORD pos = { x,y };

? ? SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), pos);

}

實際上為捕魚達人類魔改,新手上路,還請輕噴。

C語言實現(xiàn)意大利炮小游戲的評論 (共 條)

分享到微博請遵守國家法律
财经| 富阳市| 宁强县| 厦门市| 平遥县| 离岛区| 彰化市| 富源县| 海阳市| 前郭尔| 麻江县| 姜堰市| 曲松县| 宿迁市| 临朐县| 河西区| 光山县| 和硕县| 淮阳县| 武冈市| 衡水市| 昌都县| 图们市| 丹巴县| 邢台县| 招远市| 长丰县| 肇庆市| 尉犁县| 通渭县| 江阴市| 汝南县| 从江县| 凤山县| 定日县| 汉沽区| 柳河县| 五河县| 南丰县| 烟台市| 福州市|