Hanoi-towers/resolver.php

31 lines
538 B
PHP
Raw Normal View History

2017-11-17 23:06:00 +01:00
<?php
$discCount = 6;
//load the class
include("class.towers.php");
$tower = new Tower($discCount);
2017-11-20 19:26:05 +01:00
echo "1".$tower."\n";
$move = new Move();
$move->make("0 to 1");
$tower = $tower->add_move($move);
echo "2".$tower."\n";
2017-11-20 18:37:05 +01:00
/*
2017-11-17 23:06:00 +01:00
resolveHanoi($tower);
function resolveHanoi($tower){
//out of recursif if
$availablesMoves = $tower->list_moves_availables();
//don't take moves that will generate an ever used tower configuration
2017-11-20 18:37:05 +01:00
$useful_moves = array();
2017-11-17 23:06:00 +01:00
foreach($availablesMoves as $move){
}
}
2017-11-20 18:37:05 +01:00
*/