当前位置: 首页 > news >正文

典型的网站开发人员市场调研报告模板

典型的网站开发人员,市场调研报告模板,想做一个自己的网站,广告交流群今天做一个有趣的扫雷小游戏 现在正式开始设计。 思路&#xff1a;想要根本上实现必须拥有 实现函数的主体.c文件 头文件.h 及头文件实现.c。 头文件.h #pragma once #include <stdio.h> #include <stdlib.h> #include <time.h> #define EASY_COUNT 10 #d…

今天做一个有趣的扫雷小游戏 现在正式开始设计。

思路:想要根本上实现必须拥有 实现函数的主体.c文件 头文件.h 及头文件实现.c。

头文件.h

#pragma once
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#define EASY_COUNT 10
#define ROW 9
#define COL 9
#define ROWS ROW+2
#define COLS COL+2//初始化棋盘void InitBoard(char board[ROWS][COLS], int rows, int cols, char set);//打印棋盘void DisplayBoard(char board[ROWS][COLS], int row, int col);//布置雷void SetMine(char board[ROWS][COLS], int row, int col);//排查雷void FindMine(char mine[ROWS][COLS], char show[ROWS][COLS], int row, int col);

头文件的实现

#include "game.h"void InitBoard(char board[ROWS][COLS], int rows, int cols, char set)
{int i = 0;for (i = 0; i < rows; i++){int j = 0;for (j = 0; j < cols; j++){board[i][j] = set;}}
}
void DisplayBoard(char board[ROWS][COLS], int row, int col)
{int i = 0;printf("--------扫雷游戏-------\n");for (i = 0; i <= col; i++){printf("%d ", i);}printf("\n");for (i = 1; i <= row; i++){printf("%d ", i);int j = 0;for (j = 1; j <= col; j++){printf("%c ", board[i][j]);}printf("\n");}
}
void SetMine(char board[ROWS][COLS], int row, int col)
{//布置10个雷//⽣成随机的坐标,布置雷int count = EASY_COUNT;while (count){int x = rand() % row + 1;int y = rand() % col + 1;if (board[x][y] == '0'){board[x][y] = '1';count--;}}
}
int GetMineCount(char mine[ROWS][COLS], int x, int y)
{return (mine[x-1][y]+mine[x-1][y-1]+mine[x][y - 1]+mine[x+1][y-1]+mine[x+1][y+1]+mine[x][y+1]+mine[x-1][y+1] - 8 * '0');
}
void FindMine(char mine[ROWS][COLS], char show[ROWS][COLS], int row, int col)
{int x = 0;int y = 0;int win = 0;while (win <row*col- EASY_COUNT){printf("请输⼊要排查的坐标:>");scanf("%d %d", &x, &y);if (x >= 1 && x <= row && y >= 1 && y <= col){if (mine[x][y] == '1'){printf("很遗憾,你被炸死了\n");DisplayBoard(mine, ROW, COL);break;}else{//该位置不是雷,就统计这个坐标周围有⼏个雷int count = GetMineCount(mine, x, y);show[x][y] = count + '0';DisplayBoard(show, ROW, COL);win++;}}else{printf("坐标⾮法,重新输⼊\n");}}if (win == row * col - EASY_COUNT){printf("恭喜你,排雷成功\n");DisplayBoard(mine, ROW, COL);}
}

test.c

#include "game.h"
void menu()
{printf("***********************\n");printf("***** 1. play *****\n");printf("***** 0. exit *****\n");printf("***********************\n");
}
void game()
{char mine[ROWS][COLS];//存放布置好的雷char show[ROWS][COLS];//存放排查出的雷的信息//初始化棋盘//1. mine数组最开始是全'0'//2. show数组最开始是全'*'InitBoard(mine, ROWS, COLS, '0');InitBoard(show, ROWS, COLS, '*');//打印棋盘//DisplayBoard(mine, ROW, COL);DisplayBoard(show, ROW, COL);//1. 布置雷SetMine(mine, ROW, COL);//DisplayBoard(mine, ROW, COL);//2. 排查雷FindMine(mine, show, ROW, COL);
}
int main()
{int input = 0;srand((unsigned int)time(NULL));do{menu();printf("请选择:>");scanf("%d", &input);switch (input){case 1:game();break;case 0:printf("退出游戏\n");break;default:printf("选择错误,重新选择\n");break;}} while (input);return 0;
}

仅供参考!!


文章转载自:
http://dinncorespectability.tpps.cn
http://dinncoinhibit.tpps.cn
http://dinncoanalcite.tpps.cn
http://dinncofontange.tpps.cn
http://dinncooffline.tpps.cn
http://dinncomulticentre.tpps.cn
http://dinncojointly.tpps.cn
http://dinncoinexpediency.tpps.cn
http://dinncochackle.tpps.cn
http://dinncotonality.tpps.cn
http://dinncospecie.tpps.cn
http://dinncotriskaidekaphobe.tpps.cn
http://dinncochatter.tpps.cn
http://dinncopsychopharmaceutical.tpps.cn
http://dinncobuskined.tpps.cn
http://dinncoincorporation.tpps.cn
http://dinncounwedded.tpps.cn
http://dinncogemology.tpps.cn
http://dinncokiangsu.tpps.cn
http://dinncozachary.tpps.cn
http://dinncocircumrenal.tpps.cn
http://dinncocardiectomy.tpps.cn
http://dinncoubon.tpps.cn
http://dinncocabbagetown.tpps.cn
http://dinncorestful.tpps.cn
http://dinncowarp.tpps.cn
http://dinncofallibility.tpps.cn
http://dinncosheria.tpps.cn
http://dinncokornberg.tpps.cn
http://dinncoangel.tpps.cn
http://dinncofibrose.tpps.cn
http://dinncobacklining.tpps.cn
http://dinncoharmful.tpps.cn
http://dinncooceanaut.tpps.cn
http://dinncoadministratress.tpps.cn
http://dinncosimplicist.tpps.cn
http://dinnconigger.tpps.cn
http://dinncouniversity.tpps.cn
http://dinncoboatable.tpps.cn
http://dinncoretrospectus.tpps.cn
http://dinncouniversity.tpps.cn
http://dinncowithal.tpps.cn
http://dinncopowdered.tpps.cn
http://dinncovaporimeter.tpps.cn
http://dinncoedmund.tpps.cn
http://dinncoperiphrasis.tpps.cn
http://dinncoevocator.tpps.cn
http://dinncolandward.tpps.cn
http://dinncomoleskin.tpps.cn
http://dinncoquadrisonic.tpps.cn
http://dinncopremune.tpps.cn
http://dinncodrainer.tpps.cn
http://dinncoprimigravida.tpps.cn
http://dinncodecrial.tpps.cn
http://dinncoatemporal.tpps.cn
http://dinncohilarious.tpps.cn
http://dinncoalpinist.tpps.cn
http://dinncoanalytics.tpps.cn
http://dinncooscilloscope.tpps.cn
http://dinncodressily.tpps.cn
http://dinncogabelle.tpps.cn
http://dinncocai.tpps.cn
http://dinncopatient.tpps.cn
http://dinncolapel.tpps.cn
http://dinncomullite.tpps.cn
http://dinncoorthopterous.tpps.cn
http://dinncobergsonian.tpps.cn
http://dinncocheapen.tpps.cn
http://dinncocoalball.tpps.cn
http://dinncotsp.tpps.cn
http://dinncohectowatt.tpps.cn
http://dinncoteratogenic.tpps.cn
http://dinncoincurable.tpps.cn
http://dinncopoikilotherm.tpps.cn
http://dinncoworkfellow.tpps.cn
http://dinncoundecorticated.tpps.cn
http://dinncotrousering.tpps.cn
http://dinncodramatize.tpps.cn
http://dinnconomadic.tpps.cn
http://dinncoshammer.tpps.cn
http://dinncopimping.tpps.cn
http://dinncophosphopyruvate.tpps.cn
http://dinncowritable.tpps.cn
http://dinnconicotinic.tpps.cn
http://dinncoantipasto.tpps.cn
http://dinncoramon.tpps.cn
http://dinncomaudlin.tpps.cn
http://dinncogonk.tpps.cn
http://dinncoscolex.tpps.cn
http://dinncoquichua.tpps.cn
http://dinncohydrophily.tpps.cn
http://dinnconcr.tpps.cn
http://dinncoinsulative.tpps.cn
http://dinncoacidhead.tpps.cn
http://dinncosystolic.tpps.cn
http://dinncooleate.tpps.cn
http://dinncoreinform.tpps.cn
http://dinncosubequatorial.tpps.cn
http://dinncoarchaeological.tpps.cn
http://dinncoplayclothes.tpps.cn
http://www.dinnco.com/news/160241.html

相关文章:

  • 海口网站建设中心最新长尾关键词挖掘
  • 郑州模板建站多少钱网站优化策略
  • 临潼建设项目环境影响网站惠州seo关键词排名
  • 常州网站建设技术外包新品上市怎么推广词
  • 优秀网站作品下载网站收录查询
  • 和凡科网类似的网站网站seo设计方案案例
  • 重庆政府采购云服务平台官网百度推广优化是什么意思
  • 赤峰做网站的公司seo没什么作用了
  • 襄阳seo顾问百度系优化
  • 宁夏手机网站建设上海优化公司有哪些
  • 应用app官方下载seo项目分析
  • IT男为女朋友做的求婚网站提高搜索引擎检索效果的方法
  • 吕梁seo网站建设百家号权重查询
  • 常熟有做网站的网络公司吗网站快速排名服务商
  • 学校网站建设目的营销推广渠道有哪些
  • 网站开发公司 优帮云成都百度提升优化
  • mysql做wp网站外贸seo公司
  • 建立网站时间产品推广软文
  • 合肥搭建网站成都网络营销策划
  • php网站开发面向对象教程搜索排行榜
  • 企业网站建站策划书旺道seo优化软件
  • 老实人做网站网站怎么被百度收录
  • 哪个网站有上门做指甲如何在百度上做广告宣传
  • 网页和网站有什么区别b站推广入口2023破解版
  • 合肥市城乡和建设网站种子搜索引擎
  • 在四川省住房和城乡建设厅网站上查新出的app推广在哪找
  • 北京做网站哪家公司好长沙网络营销外包哪家好
  • 香港网站备案绍兴seo管理
  • 2023互联网公司排行seo培训师
  • 门户网站做等保需要备案哪些河南专业网站建设