-
作业
本题编写程序模拟人进行连连看游戏,电脑模拟人玩连连看的过程如下:
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
-
target_detect
说明: chirp信号目标探测,mti,mtd,可以对于初学者用于雷达杂波下的目标探测仿真(Chirp signal target detection, MTI, MTD)
- 2020-11-29 11:33:32下载
- 积分:1
-
VB实现窗口上的折叠展开式图标菜单
VB实现窗口上的多功能图文菜单,一个ToolBox测试项目的程序源代码,可在VB的Form中实现折叠展开的菜单、带图标的菜单,一个Activex类型的控件,值得一看。
- 2022-08-25 04:51:45下载
- 积分:1
-
voc_draw.py
说明: VOC格式标注可视化。用于数据标注的检查等(draw a picture with voc 2007 format)
- 2020-06-17 11:20:02下载
- 积分:1
-
为了方便大家学些,上传了一个贪心算法的算法
为了方便大家学些,上传了一个贪心算法的算法-In order to facilitate everyone to learn more, upload the algorithm, a greedy algorithm
- 2022-03-21 23:43:57下载
- 积分:1
-
thesnakegame
这个在Emu8086v3.07下调试通过的,贪食蛇游戏。It s better to set the "step delay" to "0" before running, it requires fast processing.Press ESC to exit。(This Emu8086v3.07 adopted under the debugger,贪食蛇game. It' s better to set the " step delay" to " 0" before running, it requires fast processing.Press ESC to exit.)
- 2009-06-02 21:09:34下载
- 积分:1
-
j2me游戏海底探险代码文件
j2me游戏海底探险Java代码文件,游戏功能:"新游戏","游戏背景","游戏规则","参数设置","载入游戏","查看排名"。child_ViewWindowCanvas.java;功能:完成菜单的定义及初始化;
SeaGame.java;功能:完成菜单的定义及初始化;
NewGame.java;功能:新建一个游戏;
child_weapon.java;功能:完成武器精灵的定义;
child_monster.java;功能:完成怪物精灵的定义;
- 2022-09-05 08:15:02下载
- 积分:1
-
一种用C++编写的小游戏
一个用C语言编写的小游戏―五子棋。他具有一切五子棋的功能,能对战,人机大战,比较有意思。-a C language prepared by the small game- 331. He had 331 all functions, the screen can, man-machine war, more interesting.
- 2022-02-03 09:07:47下载
- 积分:1
-
ezy-1.0.0
一款很好的源码,非常的好用,亲测哦,欢迎大家一起来好好的体验一下吧(A very good source code, very useful, personally tested oh, welcome to come together and have a good experience)
- 2020-06-17 13:20:01下载
- 积分:1
-
家庭通讯录系统,具有十分完善的各项功能,方便快捷
家庭通讯录系统,具有十分完善的各项功能,方便快捷-telephoneMS
- 2023-06-20 14:00:04下载
- 积分:1