-
作业
本题编写程序模拟人进行连连看游戏,电脑模拟人玩连连看的过程如下:
1、分析本局游戏,将本局游戏转化成一个二位数组。0表示空白区域,数字表示该游戏牌为出现在游戏中的第几类游戏牌。
2、利用广度优先搜索算法,判断两个游戏牌是否可以消除。
3、程序模拟人点击可以消除的一对游戏牌进行消除。
对某局游戏转化成二维数组如下:
0 0 0 0 0
0 1 2 0 0
0 0 3 4 0
0 0 0 1 0
输入二位数组的行、列,二位数组、起始元素的的坐标、终止元素的坐标,判断起始游戏牌和终止游戏牌是否可以消除。
对上例输入
4 5
0 0 0 0 0 0 1 2 0 0 0 0 3 4 0 0 0 0 1 0
1 1
3 3
输出 TRUE(The writing program simulates the game, and the computer simulates the process of watching the game as follows:
1. Analyze the game and convert the game into a two - bit array. 0 is the blank area, the number indicates that the game card is the number of game cards that appear in the game.
2. Use the breadth first search algorithm to judge whether the two game cards can be eliminated.
3, the program simulates a pair of game cards that can be eliminated by clicking.
A game of a game is transformed into a two-dimensional array as follows:
00000
01200
00340
00010
Input the row and column of the two bit array, the coordinates of two bit array, the initial element, and the coordinates of the termination elements, so as to determine whether the initial game card and the ending game card can be eliminated.
For example input
45
0000001200 0034000010
11
33
Output TRUE)
- 2017-12-17 16:01:15下载
- 积分:1
-
STM32+BLDC+新版+资料
说明: 无刷BLDC+用STM32F103VET6开发的无刷直流电机控制程序+资料+原理图+开发资料参考(BLDC + control program of BLDC motor developed by stm32f103vet6 + data + schematic diagram + reference of development data)
- 2020-04-19 09:04:08下载
- 积分:1
-
neuro
很好的一个文件,希望对大家能有更大的帮助(A very good document, in the hope that everyone can have a greater help)
- 2008-07-24 19:34:45下载
- 积分:1
-
模糊控制
说明: 模糊控制的C语言实现,双输入单输出,采用查表法进行模糊推理,去模糊方法采用重心法,易于单片机实现(C language realization of fuzzy control, double input and single output, using look-up table method for fuzzy reasoning, using center of gravity method for deblurring, easy to realize by single chip computer)
- 2020-11-17 20:09:39下载
- 积分:1
-
蝇量级 C语言可变长数组实现
用C语言实现的可变长数组,参考了开源的glib库,对其中的GByteArrary数据结构的源代码进行了提取。可用于单片机开发环境。
- 2022-02-03 16:35:34下载
- 积分:1
-
spi
ARM程序,实现了SPI通信协议,可用于任何使用SPI通信协议的器件上,在LPC2103上测试成功。(ARM procedures realize the SPI communication protocol, can be used for any use of SPI communication protocol on the device, tested successfully in the LPC2103.)
- 2008-08-23 10:09:43下载
- 积分:1
-
wind_power_in_power_systems
研究风电接入对电力系统影响的经典书籍,适用于相关专业人士(classical text book to learn about winder power and its affect on power system)
- 2012-01-19 23:36:37下载
- 积分:1
-
PcModWin V3.7
说明: PcModWin V3.7,modtran4界面化输入软件(PcModWin V3.7,Gui for modtran4 input.)
- 2020-03-11 14:49:30下载
- 积分:1
-
ex-06
说明: fluent修改材料属性(粘度)UDF案例(fluent文件及UDF源代码)(UDF case of modifying material properties (viscosity) by fluent (fluent file and UDF source code))
- 2020-12-05 18:43:46下载
- 积分:1
-
dt012
micsdg sdlkfjl sdlkfj salksa dsaaslsa
- 2017-09-29 00:44:00下载
- 积分:1