master
Gnieark 7 years ago
parent 3e937b3fa3
commit bd400745dd

@ -3,3 +3,4 @@
Resolve this problem by Resolve this problem by
php resolver.php > result.php php resolver.php > result.php
You can change the number of discs used on the game. Edit the resolver.php third line to do that.

@ -4,12 +4,10 @@ $discCount = 6;
//load the class //load the class
include("class.towers.php"); include("class.towers.php");
$tower = new Tower($discCount); $tower = new Tower($discCount);
$steps = new Steps(array()); $steps = new Steps(array());
$steps->add_step($tower); $steps->add_step($tower);
resolveHanoi($tower,$steps); resolveHanoi($tower,$steps);
function resolveHanoi(Tower $tower, Steps $steps){ function resolveHanoi(Tower $tower, Steps $steps){

Loading…
Cancel
Save