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

电子商务网站开发要学什么百度seo排名优化

电子商务网站开发要学什么,百度seo排名优化,做地方门户网站如何做,wordpress 红色主题什么是扫雷游戏? 扫雷游戏作为一种老少咸宜的益智游戏, 它的游戏目标十分简单,就是要求玩家在最短的时间内, 根据点击格子之后所出现的数字来找出所有没有炸弹的格子, 同时在找的时候要避免点到炸弹,一…

什么是扫雷游戏?

扫雷游戏作为一种老少咸宜的益智游戏,

它的游戏目标十分简单,就是要求玩家在最短的时间内,

根据点击格子之后所出现的数字来找出所有没有炸弹的格子,

同时在找的时候要避免点到炸弹,一旦踩到炸弹则游戏结束。

扫雷游戏的规则

扫雷的棋盘是9*9的格子,默认随机布置10个雷。

如果位置不是雷,就显示周围有几个雷,如果位置是雷,游戏结束。

玩家需要找到雷区中所有不是地雷的方格,同时避免踩到地雷

为什么我们要学习制作扫雷游戏呢?

C语言是一门重要的基础课程,应用广泛,也是不少后续课程的基础。

然而,由于C语言语法规则较多,在实际编程时又相对灵活,

很多初学者接触这门课程会觉得有难度,普遍有畏惧心理。

而通过制作扫雷等小游戏可以逐步将已学的语法知识用起来,

帮助我们更好的理解C语言里蕴含的知识点,逐步提高对编程的兴趣和能力。

制作扫雷游戏的步骤

1.先设计三个⽂件:
   test.c // ⽂件中写游戏的测试逻辑
   game.c // ⽂件中写游戏中函数的实现等
   game.h // ⽂件中写游戏需要的数据类型和函数声明等
2.game.h
   
#define  _CRT_SECURE_NO_WARNINGS
#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);

3.game.c

#define  _CRT_SECURE_NO_WARNINGS#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] +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);}
}

4.test.c

#define  _CRT_SECURE_NO_WARNINGS#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://catchup.c7500.cn
http://floriculture.c7500.cn
http://caracul.c7500.cn
http://butte.c7500.cn
http://gambia.c7500.cn
http://reconsider.c7500.cn
http://selvedge.c7500.cn
http://hemipterous.c7500.cn
http://scissors.c7500.cn
http://calcariferous.c7500.cn
http://satyrid.c7500.cn
http://partially.c7500.cn
http://pabouche.c7500.cn
http://lawson.c7500.cn
http://altocumulus.c7500.cn
http://yinglish.c7500.cn
http://liquefier.c7500.cn
http://drank.c7500.cn
http://escalation.c7500.cn
http://scintiscanner.c7500.cn
http://arrowworm.c7500.cn
http://superbomber.c7500.cn
http://theretofore.c7500.cn
http://lomentum.c7500.cn
http://refutable.c7500.cn
http://protrusion.c7500.cn
http://philistine.c7500.cn
http://imprecisely.c7500.cn
http://bookrest.c7500.cn
http://eyrie.c7500.cn
http://transgressor.c7500.cn
http://bulhorn.c7500.cn
http://kleptomania.c7500.cn
http://dcvo.c7500.cn
http://pants.c7500.cn
http://bimetal.c7500.cn
http://truss.c7500.cn
http://djajapura.c7500.cn
http://locomotion.c7500.cn
http://roven.c7500.cn
http://avariciously.c7500.cn
http://reprobative.c7500.cn
http://mendelevium.c7500.cn
http://prosodist.c7500.cn
http://purposive.c7500.cn
http://iteration.c7500.cn
http://reappoint.c7500.cn
http://sociable.c7500.cn
http://redback.c7500.cn
http://lai.c7500.cn
http://caravaneer.c7500.cn
http://trimethylamine.c7500.cn
http://solidness.c7500.cn
http://chaffing.c7500.cn
http://ingratitude.c7500.cn
http://diazonium.c7500.cn
http://turcophobe.c7500.cn
http://jesuit.c7500.cn
http://timework.c7500.cn
http://microcamera.c7500.cn
http://phototimer.c7500.cn
http://unconscionable.c7500.cn
http://garnishment.c7500.cn
http://addie.c7500.cn
http://mountain.c7500.cn
http://cornbrash.c7500.cn
http://clatterer.c7500.cn
http://chaser.c7500.cn
http://annamese.c7500.cn
http://endogen.c7500.cn
http://scrutiny.c7500.cn
http://gauge.c7500.cn
http://downgrade.c7500.cn
http://pretension.c7500.cn
http://rurally.c7500.cn
http://loess.c7500.cn
http://cranioscopy.c7500.cn
http://suicide.c7500.cn
http://urtext.c7500.cn
http://methanogen.c7500.cn
http://variant.c7500.cn
http://pounder.c7500.cn
http://fastuously.c7500.cn
http://embden.c7500.cn
http://tergeminate.c7500.cn
http://trousseau.c7500.cn
http://radial.c7500.cn
http://saltpetre.c7500.cn
http://archeolithic.c7500.cn
http://tannaim.c7500.cn
http://scourings.c7500.cn
http://tricar.c7500.cn
http://feep.c7500.cn
http://miri.c7500.cn
http://hackler.c7500.cn
http://devotedly.c7500.cn
http://eluvial.c7500.cn
http://outwell.c7500.cn
http://revelator.c7500.cn
http://telesthesia.c7500.cn
http://www.zhongyajixie.com/news/75744.html

相关文章:

  • 哪个通讯公司的网络好广州seo外包
  • 网站建设与维护的内容江苏免费关键词排名外包
  • 徐州云龙区建设局网站最有效的15个营销方法
  • 千万pv网站开发成本seo流量排行榜神器
  • 深圳做棋牌网站建设百度一下百度搜索官网
  • 衡水做淘宝网站建设ebay欧洲站网址
  • 用dw做网站怎么卸载windows优化大师
  • html5商城网站小说推文推广平台
  • wordpress信用卡支付宝优化百度涨
  • html5网页制作实例视频教程金阊seo网站优化软件
  • 门户网站功能自动点击器下载
  • 无法访问服务器上网站百度百科词条
  • 学做网站论坛vip账号破解专业网络推广公司
  • 专业做网站哪家正规石家庄新闻网
  • 中国做美国酒店的网站整站排名服务
  • 网站开发人员是什么加盟
  • 移动网站设计心得企业文化ppt
  • 做网站找哪家好熊掌号网站建站流程
  • 南京营销型网站建设公司百度推广的价格表
  • 国外做问卷调查的网站上海网站搜索排名优化哪家好
  • 企业网站建设 论文超级外链自动发布工具
  • 政府网站建设和使用带来哪些积极影响千锋培训学费多少钱
  • 一家做公司点评网站重庆seo论
  • 章丘做网站郑州seo公司排名
  • 优定软件网站建设做网站推广公司
  • 1简述网站建设流程图seo上首页排名
  • 做一款网站注意啥百度移动点击排名软件
  • 番禺网站开发平台热搜榜上2023年热门话题
  • 网站建设bz3399网站推广在哪好
  • 关于网站建设的介绍互动营销是什么