-
作业
本题编写程序模拟人进行连连看游戏,电脑模拟人玩连连看的过程如下:
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
-
使用IrisSkin2控件的C#漂亮关机程序
使用IrisSkin2控件的C#漂亮关机程序,本程序可学习到两个亮点,1、换肤控件IrisSkin2的应用实例,2、C#实现关机。这种关机程序的界面效果可选择5种样式:MSN风格、Vista风格、经典风格等,关机功能可以在设定时间后自动程序,编译环境vs2008。
- 2022-07-13 08:04:15下载
- 积分:1
-
A classic Snake game, by using C language, and more inadequate.
一款经典小游戏贪吃蛇,用C语言编写而成,多有不足。-A classic Snake game, by using C language, and more inadequate.
- 2022-07-15 09:05:45下载
- 积分:1
-
本原码用VB2005演示了串口控制,多线程的实现,程序性指
本原码用VB2005演示了串口控制,多线程的实现,程序性指-primitive code using VB2005 demonstration of serial control, multi-thread and that the realization of procedural means
- 2022-03-11 00:36:02下载
- 积分:1
-
pmsg+erjiguan
永磁同步风力发电机+二极管整流+boost升压控制,实现直流电能输出。(Permanent magnet synchronous wind generator + diode rectifier +boost boost control to achieve DC power output.)
- 2017-12-12 15:09:20下载
- 积分:1
-
论坛 Script(php)
这是一个 php 的论坛。成员登录和有开机自检和评论的线程的能力。它是在附近的最好论坛脚本。演示 < a href ="www.naijaloaded.com"> < /a > 这里
- 2022-02-01 19:24:02下载
- 积分:1
-
高频地波雷达对于天基海杂波的仿真,其中有一阶海杂波和二阶海杂波的仿真,对初学者很有帮助...
高频地波雷达对于天基海杂波的仿真,其中有一阶海杂波和二阶海杂波的仿真,对初学者很有帮助-HF ground wave radar clutter simulation for the DMH days, including a first-order sea clutter and second-order sea clutter simulation, very useful for beginners
- 2022-07-02 12:00:17下载
- 积分:1
-
kernel-api
kernel-api书籍,英文版,希望对大家有所帮助(kernel-api book, in English, I hope all of you to help)
- 2009-05-23 23:25:34下载
- 积分:1
-
image enhancement by nonlinear extrapolation in frequency space. The use of wave...
image enhancement by nonlinear extrapolation in frequency space。使用小波进行边缘锐化和增强的论文-image enhancement by nonlinear extrapolation in frequency space. The use of wavelet edge sharpen and enhance the thesis
- 2022-05-22 08:26:48下载
- 积分:1
-
Matlab(wireless_charging_ADP)
基于自适应动态规划的执行依赖启发式动态规划仿真程序,包括评价模块、执行模块、图像输出等(Implementation based on adaptive dynamic programming relies on heuristic dynamic programming simulation program, including evaluation module, execution module, image output, etc.)
- 2020-11-10 14:49:46下载
- 积分:1