-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_trajectory.php
More file actions
35 lines (30 loc) · 846 Bytes
/
test_trajectory.php
File metadata and controls
35 lines (30 loc) · 846 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?php
$autoload_location = '/vendor/autoload.php';
$tries=0;
while (!is_file(__DIR__.$autoload_location))
{
$autoload_location='/..'.$autoload_location;
$tries++;
if ($tries>10) die("Error trying to find autoload file\n");
}
require_once __DIR__.$autoload_location;
use Omatech\Checkers\Checkers;
use Omatech\Checkers\Trajectory;
define ("DIMENSIONS", 8);
$checkers=new Checkers();
$board=$checkers->getBoard();
$tiles=$board->getAllTiles();
echo $board;
foreach ($tiles as $tile)
{
echo $tile->getRow().'-'.$tile->getColumn()."\n";
$tr1=new Trajectory($tile, 1, 1);
$tr2=new Trajectory($tile, 1, -1);
$tr3=new Trajectory($tile, -1, 1);
$tr4=new Trajectory($tile, -1, -1);
echo "Starting Tile:".$tile->getCoordinate()."\n";
echo "tr1=".$tr1;
echo "tr2=".$tr2;
echo "tr3=".$tr3;
echo "tr4=".$tr4;
}