-
作业
本题编写程序模拟人进行连连看游戏,电脑模拟人玩连连看的过程如下:
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
-
car multithreaded parallel threads
汽车线程多线程并行-car multithreaded parallel threads
- 2022-03-13 06:18:00下载
- 积分:1
-
FSK2_demodu_SNR
利用morlet小波变换提取小波脊线,进而利用小波脊线完成2FSK解调(the demodulation of 2FSK signal)
- 2009-09-04 11:11:01下载
- 积分:1
-
matlab程序,包括kruskal算法和kijkstra算法的程序
matlab程序,包括kruskal算法和kijkstra算法的程序
- 2022-08-22 05:30:46下载
- 积分:1
-
OFDM_PAPR
有slm、pts、clipping三种抑制papr并画出ccdf图的程序(SLM and PTS, clipping three inhibit papr and draw the figure of CCDF program)
- 2019-03-20 09:46:14下载
- 积分:1
-
bellhop水声信道仿真工具箱及说明书
说明: 水声通信信道建模;bellhop水声信道仿真工具箱及说明书(Modeling of underwater acoustic communication channel)
- 2020-04-29 15:49:04下载
- 积分:1
-
AEC-Spec
AEC 回声消除参考书,里面全面介绍了AEC相关理论。(AEC spec documents)
- 2010-11-07 12:53:16下载
- 积分:1
-
网吧计费系统源码.
网吧计费系统源码.-Internet Billing System source.
- 2022-01-25 15:06:52下载
- 积分:1
-
模糊逻辑空调
fuzzy logic air conditioner
- 2023-03-16 21:35:04下载
- 积分:1
-
上传pudn
从心电信号提取呼吸信号,和信号频谱分析
用于对信号的频谱分布做分析,输出为频谱变量和图示(Signal processing, signal spectrum analysis, signal energy
It is used to analyze the spectrum distribution of the signal, and output it as spectrum variable and icon.)
- 2018-08-28 16:37:35下载
- 积分:1