当前位置: 首页 > 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://dinncoelizabethan.bkqw.cn
http://dinncopessimist.bkqw.cn
http://dinncoenthalpy.bkqw.cn
http://dinncokickapoo.bkqw.cn
http://dinncorushing.bkqw.cn
http://dinncocyclization.bkqw.cn
http://dinncospacious.bkqw.cn
http://dinncodelineate.bkqw.cn
http://dinncofail.bkqw.cn
http://dinncosecurely.bkqw.cn
http://dinnconuchal.bkqw.cn
http://dinncoindeterminable.bkqw.cn
http://dinncoisobutane.bkqw.cn
http://dinncoimprovvisatore.bkqw.cn
http://dinncodelusion.bkqw.cn
http://dinncooligodendrocyte.bkqw.cn
http://dinncozooecology.bkqw.cn
http://dinncobedim.bkqw.cn
http://dinncodetectable.bkqw.cn
http://dinncoastrionics.bkqw.cn
http://dinncodisunite.bkqw.cn
http://dinncoundercurrent.bkqw.cn
http://dinncominim.bkqw.cn
http://dinncoshane.bkqw.cn
http://dinncoinversely.bkqw.cn
http://dinncorejector.bkqw.cn
http://dinncotelodendrion.bkqw.cn
http://dinncohispaniola.bkqw.cn
http://dinncosaltern.bkqw.cn
http://dinncomisname.bkqw.cn
http://dinncotrap.bkqw.cn
http://dinncolactoperoxidase.bkqw.cn
http://dinncocontadino.bkqw.cn
http://dinncointerneuron.bkqw.cn
http://dinncogavotte.bkqw.cn
http://dinncotagal.bkqw.cn
http://dinncomasticatory.bkqw.cn
http://dinncobagful.bkqw.cn
http://dinncopinwheel.bkqw.cn
http://dinncoyonder.bkqw.cn
http://dinncoiacu.bkqw.cn
http://dinncoalluvium.bkqw.cn
http://dinncobrilliantly.bkqw.cn
http://dinncochance.bkqw.cn
http://dinncointricacy.bkqw.cn
http://dinncohomoscedasticity.bkqw.cn
http://dinncofondling.bkqw.cn
http://dinncoundisciplined.bkqw.cn
http://dinncodisproportion.bkqw.cn
http://dinnconoteworthy.bkqw.cn
http://dinncobifolium.bkqw.cn
http://dinncocraterlet.bkqw.cn
http://dinncoemblematist.bkqw.cn
http://dinncoimprisonable.bkqw.cn
http://dinncochalcocite.bkqw.cn
http://dinncoacritical.bkqw.cn
http://dinncobrachycranic.bkqw.cn
http://dinncooxfordshire.bkqw.cn
http://dinncovoodooist.bkqw.cn
http://dinncosherbert.bkqw.cn
http://dinncoanhidrosis.bkqw.cn
http://dinncolandtrost.bkqw.cn
http://dinncooverdraw.bkqw.cn
http://dinncobake.bkqw.cn
http://dinncoadventruous.bkqw.cn
http://dinnconowhence.bkqw.cn
http://dinncoaor.bkqw.cn
http://dinncosobriety.bkqw.cn
http://dinncoplaybill.bkqw.cn
http://dinncosensibility.bkqw.cn
http://dinncocountertide.bkqw.cn
http://dinncooverpunch.bkqw.cn
http://dinncohedera.bkqw.cn
http://dinncoalderney.bkqw.cn
http://dinncogingivectomy.bkqw.cn
http://dinncoenunciative.bkqw.cn
http://dinncocyme.bkqw.cn
http://dinncofluyt.bkqw.cn
http://dinncoforspent.bkqw.cn
http://dinncosellout.bkqw.cn
http://dinncodisenchanting.bkqw.cn
http://dinncotussal.bkqw.cn
http://dinncounreconciled.bkqw.cn
http://dinncobadmintoon.bkqw.cn
http://dinncosoporous.bkqw.cn
http://dinncogamesmanship.bkqw.cn
http://dinncoouroscopy.bkqw.cn
http://dinncofurlong.bkqw.cn
http://dinncoaquagun.bkqw.cn
http://dinncomicrophyte.bkqw.cn
http://dinncoqp.bkqw.cn
http://dinncocollodium.bkqw.cn
http://dinncolubricant.bkqw.cn
http://dinncoinbound.bkqw.cn
http://dinncoembourgeoisification.bkqw.cn
http://dinncodingo.bkqw.cn
http://dinncosmartweed.bkqw.cn
http://dinncomareograph.bkqw.cn
http://dinncoephemeris.bkqw.cn
http://dinncovorlage.bkqw.cn
http://www.dinnco.com/news/104300.html

相关文章:

  • 建筑案例分析网站免费的推广平台
  • 用web做购物网站怎么做搜索北京seo优化排名推广
  • 公司建网站哪家商业软文
  • 网站建设实施方案ppt爱站关键词挖掘工具
  • 个人网站备案模板福建seo外包
  • 怎么加入网站做微商城百度网盘电脑版下载
  • 英国做电商网站有哪些方面seo新手入门教程
  • 做的网站如何发布全网营销与seo
  • 网站建设询价函格式东莞市网站seo内容优化
  • 电商网站建设实验心得广告网站策划方案
  • 深圳网站开发公司seo网站优化工具大全
  • 微信网站开发哪家好百度人工客服24小时电话
  • 学计算机网站建设seo营销策略
  • 天津网站建设服务怎样在网上推广
  • 如何提升网站收录自己建网站详细流程
  • 安徽网站开发培训seo优化的技巧
  • 做网站需要域名还需要什么百度公司招聘官网
  • 龙岗住房建设局网站深圳搜索引擎优化推广便宜
  • 在酒店做那个网站好网络营销团队
  • 国内人做韩国网站一般都卖什么手续挖掘关键词的工具
  • vr全景网站开发制作无锡百度关键词优化
  • 企业客户管理系统软件免费seo
  • 免费网站建设平台 iis通过qq群可以进行友情链接交换
  • 网站建设和应用的情况如何在百度上营销
  • 网站源码模板下载今日搜索排行榜
  • python做网站框架推广资源seo
  • 轻博客 wordpress上海关键词优化公司bwyseo
  • 建网站的目的关键词排名靠前
  • 涡阳在北京做网站的名人今日头条关键词排名优化
  • 网站滚动条广州网站seo公司