Towers of Hanoi

バージョン 1.2.0.0 (24.1 KB) 作成者: Brian Moore
A MATLAB GUI for the popular Towers of Hanoi puzzle game with manual or automatic solution.
ダウンロード: 1.8K
更新 2014/4/14

ライセンスの表示

The objective of Towers of Hanoi is to move all blocks from the left-most peg to the right-most peg. In doing so, however, the player can only access/move the top block from each peg and cannot place a larger block on top of a smaller block.
This application provides a GUI for the user to manually solve the puzzle or request that the computer graphically solve the puzzle for them (auto-solution can be stopped at any time to allow the player to finish the solution).
The imbedded solution algorithm is provably optimal in the sense that it can solve a puzzle with n blocks in arbitrary arrangement in the fewest possible moves.

The Towers of Hanoi solution is a classic example of recursion. See <http://en.wikipedia.org/wiki/Tower_of_Hanoi#Logical_analysis_of_the_recursive_solution> for more information.

引用

Brian Moore (2025). Towers of Hanoi (https://www.mathworks.com/matlabcentral/fileexchange/38202-towers-of-hanoi), MATLAB Central File Exchange. に取得済み.

MATLAB リリースの互換性
作成: R2011b
すべてのリリースと互換性あり
プラットフォームの互換性
Windows macOS Linux
カテゴリ
Help Center および MATLAB AnswersStrategy & Logic についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
バージョン 公開済み リリース ノート
1.2.0.0

Minor tweaks to code organization

1.1.0.0

Porting application to object-oriented framework

1.0.0.0