当前位置:网站首页>C language to realize mine sweeping game:
C language to realize mine sweeping game:
2022-07-27 01:26:00 【Mr y running】
( One ) The basic logic of the game

Through this circular judgment statement, the start and exit of the game can be realized ;

The implementation of the game can be divided into initialization of the chessboard -- Place mine -- Print chessboard -- Find ray ;
Initialize chessboard :

Print chessboard :
In the process of printing the chessboard, we must pay attention to our definition 11*11 Array of , But what we call is 9*9 Array of ;
So when we call, the initial value of the subscript is 1; Each time you print a line or output a prompt statement, remember to type \n;
Mine placement :

Ray's search :

There may be several conditions for jumping out of a loop , So you should first add conditions with judgment sentences ;
In the process of realization, be sure to make clear your intention , Clear your mind ;
Align with the coordinates around 8 Number of search , And subtract ‘0’ Turn into numbers ;

Okay ! Now the minesweeping game is successful !!!
边栏推荐
- In depth learning report (1)
- ESP8266-----SNTP获取网络时间
- 大四老学长的自我批评记录
- 05 - attack and defense of phishing websites
- Unity ugui text text box adaptation
- Code merging of centralized version control tools
- Solve the problem that rsyslog service occupies too much memory
- ESP8266 STA_UDP_Client
- Jenkins--基础--04--安装中文插件
- [untitled]
猜你喜欢

ESP8266 AP_TCP_Server

The MySQL character set is set to UTF-8, but the console still has the problem of Chinese garbled code

Play guest cloud brush machine 5.9

AssetBundle遇到的坑

创建MDK工程

Some simple extension methods commonly used by unity

Unity CharacterController

c语言实现扫雷游戏:

复杂度OJ题

Data storage summary of C language
随机推荐
ESP8266 AP_MODE
【unity】Unity界面scene视图[1]
matlab基本介绍[1]
4.root用户登录
Iptables detailed explanation and practical cases
记一次RawImage渲染出来的场景错乱
Remember that the scene rendered by rawimage is disordered once
c语言实现三子棋游戏
Unity常用的一些简易扩展方法
Are you ready for the Internet of things to revolutionize manufacturing?
ESP8266 STA_UDP_Client
Jenkins--基础--5.1--系统配置--插件管理
Some simple extension methods commonly used by unity
Unity CharacterController
Li Hongyi machine learning (2017 Edition)_ P6-8: gradient descent
Basic introduction to Matlab [1]
Surrounded area
MQTT协议------上
Unity[1] 学习目录
hdc_std