-
作业
本题编写程序模拟人进行连连看游戏,电脑模拟人玩连连看的过程如下:
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
-
lua易语言模块源码 luajit
lua易语言模块源码,可以通过绑定函数实现易语言执行lua代码,同时兼容luajit二进制lua代码.(Lua easy language module source code, you can achieve the binding function to achieve Lua code, and luajit binary Lua code.)
- 2020-06-28 09:03:23下载
- 积分:1
-
PolyEnE 0.01+.txt
ollydbg script polyene oep detector
- 2020-06-16 12:00:01下载
- 积分:1
-
OPTICS
实现optics聚类算法,结合dbcasn进行对比(Optics clustering algorithm is implemented)
- 2020-11-07 15:29:49下载
- 积分:1
-
切比雪夫滤波器设计
说明: 根据滤波器设计指标,可计算出系统归一化传递函数,并转换成带通滤波器传递函数(According to the filter design index, the system normalized transfer function can be calculated and converted into a bandpass filter transfer function.)
- 2020-06-18 00:20:01下载
- 积分:1
-
GSM half rate of the source code (VSELP) GSM half rate of the source code (VSELP...
GSM半数率源代码(VSELP)
GSM半数率源代码(VSELP)
-GSM half rate of the source code (VSELP) GSM half rate of the source code (VSELP)
- 2022-02-25 01:01:10下载
- 积分:1
-
c8051 f020 步进电机控制
/*P5.0STEPA,P5.1STEPB,P5.2STEPC,P5.3STEPD*/
控制电机正转
- 2022-03-04 13:55:51下载
- 积分:1
-
图像傅里叶变换
说明: 二维傅立叶变换的Matlab实现,是利用图像处理软件对给出的图像进行傅立叶变换处理。在Matlab中,函数fft2表示二维傅立叶变换,函数ifft2则表示二维傅立叶反变换。(The Fourier transform of the image)
- 2020-05-21 17:42:19下载
- 积分:1
-
simple Chinese chess game for the source code from C++ beginners learning
简单的中国象棋游戏源代码 适合从c++初学者学习-simple Chinese chess game for the source code from C++ beginners learning
- 2022-02-09 15:09:08下载
- 积分:1
-
16对红外对管线
16对红外对管的寻线板的主控程序,在AVR单片机上使用-16 pairs of infrared on the tube line-tracking master board program, using the AVR microcontroller
- 2023-07-23 07:45:03下载
- 积分:1