#!/usr/bin/env php
<?php
/**
 * Show errors at least initially
 *
 * `E_ALL` => for hard dev
 * `E_ALL & ~E_STRICT` => for hard dev in PHP5.4 avoiding strict warnings
 * `E_ALL & ~E_NOTICE & ~E_STRICT` => classic setting
 */
@ini_set('display_errors','1'); @error_reporting(E_ALL);
//@ini_set('display_errors','1'); @error_reporting(E_ALL & ~E_STRICT);
//@ini_set('display_errors','1'); @error_reporting(E_ALL & ~E_NOTICE & ~E_STRICT);

/**
 * Set a default timezone to avoid PHP5 warnings
 */
$dtmz = @date_default_timezone_get();
date_default_timezone_set($dtmz?:'Europe/Paris');

// get the Composer autoloader
if (file_exists($a = __DIR__.'/../../../autoload.php')) {
    require_once $a;
} elseif (file_exists($b = __DIR__.'/../vendor/autoload.php')) {
    require_once $b;

// else error, classes can't be found
} else {
    die('You need to run Composer on your project to use this interface!');
}


//echo Maths\Arithmetic\Helper::GCD(1071,1029).PHP_EOL;

//echo \Maths\Arithmetic\Helper::getTriangularNumber(5).PHP_EOL;    // 15
//echo \Maths\Arithmetic\Helper::getTriangularNumber(60).PHP_EOL;   // 1830

$pt = new \Maths\Arithmetic\PascalTriangle();
echo $pt->toString(20);
