文件名称:vc62445261344
介绍说明--下载内容均来自于网络,请自行研究使用
摘 要
本设计的内容是在一个八行八列的国际棋盘上,放置八个皇后,要求在任意一行,任意一列及任意一条对角线上都不能出现两个棋子。
本设计所涉及到的程序设计语言是VC++,采用的是递归和回溯的方法。首先在棋盘上找到一个位置,放置其中的一个皇后,然后对该皇后进行检查,查看她是否与棋盘同一行、同一列或同一斜线上已存在的皇后发生冲突。如果该皇后与棋盘上已经存在的皇后不发生冲突,则该皇后就摆放在此位置,继续试探下一个皇后的合适的位置;如果该皇后与棋盘上已经存在的皇后反生冲突,则该皇后就不能放在此位置,继续试探此皇后的下一个位置。直到将八个皇后都放到棋盘上,则问题解决。通过以上的方法对本课设题目进行设计与调试最后成功的输出了八皇后所有的92中合理布局,完成了设计题目的要求。
关 键 词:递归算法,八皇后,回溯法,VC++
-Abstract
The design of the content is in a line of eight international board, placed on any requirement, eight queen, any column and any diagonals cannot appear on two pieces.
This design involves the programming language is used, vc++ is recursive and back. First find a position on board, and placed in one of the queen, then the queen to inspect, check whether she and board with the same column or the same line, the queen of the existing cross-court conflict. If the queen and board existing queen not conflict, the queen will put in this position, continue to test a queen s place, If the queen on board with the queen the already existing conflict, the queen was born in this position, can continue to test the queen s next position. Until eight queen on board, problem solving. Through the above method for this class set subject designing and debugging of the output of the 92 8queens all reasonable layout, completed the design set the topic request.
Keywords: Recursive algorithm,Eight
本设计的内容是在一个八行八列的国际棋盘上,放置八个皇后,要求在任意一行,任意一列及任意一条对角线上都不能出现两个棋子。
本设计所涉及到的程序设计语言是VC++,采用的是递归和回溯的方法。首先在棋盘上找到一个位置,放置其中的一个皇后,然后对该皇后进行检查,查看她是否与棋盘同一行、同一列或同一斜线上已存在的皇后发生冲突。如果该皇后与棋盘上已经存在的皇后不发生冲突,则该皇后就摆放在此位置,继续试探下一个皇后的合适的位置;如果该皇后与棋盘上已经存在的皇后反生冲突,则该皇后就不能放在此位置,继续试探此皇后的下一个位置。直到将八个皇后都放到棋盘上,则问题解决。通过以上的方法对本课设题目进行设计与调试最后成功的输出了八皇后所有的92中合理布局,完成了设计题目的要求。
关 键 词:递归算法,八皇后,回溯法,VC++
-Abstract
The design of the content is in a line of eight international board, placed on any requirement, eight queen, any column and any diagonals cannot appear on two pieces.
This design involves the programming language is used, vc++ is recursive and back. First find a position on board, and placed in one of the queen, then the queen to inspect, check whether she and board with the same column or the same line, the queen of the existing cross-court conflict. If the queen and board existing queen not conflict, the queen will put in this position, continue to test a queen s place, If the queen on board with the queen the already existing conflict, the queen was born in this position, can continue to test the queen s next position. Until eight queen on board, problem solving. Through the above method for this class set subject designing and debugging of the output of the 92 8queens all reasonable layout, completed the design set the topic request.
Keywords: Recursive algorithm,Eight
(系统自动生成,下载前可以参看下载内容)
下载文件列表
vc62445261344\res\EightQueen.rc2
.............\...\EightQueen.ico
.............\res
.............\EightQueen.aps
.............\EightQueen.clw
.............\EightQueen.cpp
.............\EightQueen.dsp
.............\EightQueen.dsw
.............\EightQueen.h
.............\EightQueen.ncb
.............\EightQueen.opt
.............\EightQueen.plg
.............\EightQueen.rc
.............\EightQueenDlg.cpp
.............\EightQueenDlg.h
.............\QueenPanel.cpp
.............\QueenPanel.h
.............\ReadMe.txt
.............\Resource.h
.............\StdAfx.cpp
.............\StdAfx.h
.............\相关说明.txt
vc62445261344
.............\下载说明.html
.............\...\EightQueen.ico
.............\res
.............\EightQueen.aps
.............\EightQueen.clw
.............\EightQueen.cpp
.............\EightQueen.dsp
.............\EightQueen.dsw
.............\EightQueen.h
.............\EightQueen.ncb
.............\EightQueen.opt
.............\EightQueen.plg
.............\EightQueen.rc
.............\EightQueenDlg.cpp
.............\EightQueenDlg.h
.............\QueenPanel.cpp
.............\QueenPanel.h
.............\ReadMe.txt
.............\Resource.h
.............\StdAfx.cpp
.............\StdAfx.h
.............\相关说明.txt
vc62445261344
.............\下载说明.html