<?php
$letters = ['a', 'b'];
$directions = [
'knight' => [[2, 1],[2, -1],[-2, 1],[-2, -1],[1, 2],[-1,2],[1,-2],[-1,-2]],
'plus' => [[0, 1],[-1, 0],[0, -1],[1, 0]],
'plus_and_coin' => [[0, 1],[-1, 0],[0, -1],[1, 0],[1, 1],[-1, 1],[1, -1],[-1, -1]]
];
$strategie = 'plus';
$matrix = new MathMatrixHelper($letters, $directions[$strategie], 20);
print '<b>getAllConnexion:</b><br>';
$startTime = microtime(true);
$result = $matrix->getAllConnexion(6, 6);
$matrix->printTile($result, 6, 6);
print '<b>getRegularConnexion:</b><br>';
$result = $matrix->getRegularConnexion(6, 6, 5,true);
$matrix->printTile($result, 6, 6);
$endTime = microtime(true);
echo "Execution time : " . ($endTime - $startTime) . " seconds<br/><br/>";
|