-
作业
本题编写程序模拟人进行连连看游戏,电脑模拟人玩连连看的过程如下:
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
-
感应加热电源的研究
超音频串联谐振式感应加热电源为研究对象,应用锁相环和PID 技术,采用数字信号处理器(DSP)和复杂可编程逻辑器件(CPLD)联合控制的数字化技术实现感应加热电源的频率跟踪和0°~180° 自由移相调功,为感应加热电源系统的数字化、信息化、柔性化、智能化控制提供了优质、可靠的技术基础。(Superaudio series resonant induction heating power supply as the research object, the application of PLL and PID technology, using digital signal processor (DSP) and complex programmable logic device (CPLD) to achieve frequency tracking of induction heating power supply and 0 degrees to 180 degrees of freedom PS-PWM digital technology combined control for induction heating power supply system. Digital information, flexible and intelligent control to provide high-quality and reliable technical basis.)
- 2018-01-31 22:35:47下载
- 积分:1
-
In this paper, a detailed account of the image thinning algorithm based on knowl...
本文详细讲述了图像细化算法的基础知识,能够给研究图像细化算法的图像处理工作者提供较好的参考-In this paper, a detailed account of the image thinning algorithm based on knowledge, able to image thinning algorithm to the study of image processing workers to provide better reference
- 2022-04-23 04:29:28下载
- 积分:1
-
VC++ to write with the calculation of MD5 value of the dynamic library, is the s...
用VC++写的计算MD5值的动态库,是源代码哟,可加入自己的程序中进行密码的加密,呵,喜欢的下-VC++ to write with the calculation of MD5 value of the dynamic library, is the source code yo can add it to your program the password encryption, Oh, like the next
- 2023-07-23 03:05:04下载
- 积分:1
-
操作系统实验,编程实现进程的调度,最大优先数的调用
操作系统实验,编程实现进程的调度,最大优先数的调用-Operating system, experiment, programming process, scheduling, the largest number of calls of priority
- 2023-04-21 22:55:03下载
- 积分:1
-
Attachments1011183641
说明: Hacker PC, Exploit windows dektop and phshins
- 2019-07-11 21:06:49下载
- 积分:1
-
M8激光雷达动目标跟踪仿真
模拟八线激光雷达产生点云数据,实现目标聚类,并对聚类的目标进行跟踪。(Simulated eight line lidar generates point cloud data, achieves target clustering, and tracks the clustering targets.)
- 2020-07-26 22:18:41下载
- 积分:1
-
CoNTRoL1
Control the water tank by open and close the valve using PID controller. Each controller are tested, and compare.
- 2011-05-07 22:02:02下载
- 积分:1
-
File monitoring
说明: 这是一款对于U盘的文件监视程序,用于学习与交流(This is a file surveillance program for U disk, which is used for learning and communication.)
- 2019-02-13 23:02:02下载
- 积分:1
-
one prepared by the memory source, this procedure is particularly suited to stud...
一款vb编写的记忆力源程序,此程序特别适合初学者研究和学习-one prepared by the memory source, this procedure is particularly suited to study and learn from beginners
- 2022-03-21 10:11:40下载
- 积分:1