-
作业
本题编写程序模拟人进行连连看游戏,电脑模拟人玩连连看的过程如下:
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
-
Mydbceditor1.22汉化版
说明: 发个汉化的高版本,功能强大,操作更方便,兼容性强。(MyDBCeditor Chinese version,Send a Chinese version with powerful function, more convenient operation and strong compatibility.)
- 2020-12-12 15:29:16下载
- 积分:1
-
5685475
导航栏,精选ios编程学习源码,很好的参考资料。(The navigation bar, select learning IOS programming source code, a good reference.)
- 2013-12-15 09:27:09下载
- 积分:1
-
发电机组的排序优化,实现节能发电
只考虑火电机组,模型可用于煤耗和排放的综合考虑。-Achieve energy-efficient scheduling of power generation units to sort, only the thermal power unit, model can be used in coal consumption and emissions considered.
- 2022-03-02 06:58:53下载
- 积分:1
-
hospitalManagementSystem
一般医院的收费及业务管理系统,运用vc6.0 + sql server 实现,包括所以源码(General hospital fees and business management systems, the use of vc6.0+ sql server implementation, including source code so)
- 2009-03-03 21:13:13下载
- 积分:1
-
C++ Primer第五版中文版
说明: C++prime中文第五版,希望能对你有帮助。(C++ Prime Chinese 5th Edition, I hope it will be helpful to you.)
- 2019-03-09 20:59:59下载
- 积分:1
-
HDSC额温枪release20200322
说明: 完整的额温枪 耳温枪 华大 HC32L136 方案 包含源代码和硬件原理图(The complete scheme of temperature gun includes source code and hardware schematic diagram)
- 2020-06-26 14:00:02下载
- 积分:1
-
autoquad_keil
autoquad_keil 是个好节目
本工程为著名开源飞控autoquad的Keil工程,大家可以下载下来,直接用Keil 5.2编译通过。-该项目是知名开源飞行控制 autoquad Keil 工程,你可以下载,直接用 Keil 5.2 编译。
- 2022-07-26 19:17:31下载
- 积分:1
-
ppp
This is some code definitions the app EXE2C
- 2016-01-16 08:33:21下载
- 积分:1
-
TreeViewDemo
说明: 使用TreeView控件实现游览照片功能(Using TreeView Control to Realize Tourist Photo Function)
- 2020-06-17 09:40:01下载
- 积分:1