part1

#!/usr/bin/env php
<?php
/** Day 16 Part 1 & 2
 * 
 */

require(__DIR__.'/functions.php');

if (@$argv[1] == 'sample'){
    $input = file_get_contents(__DIR__.'/sample.txt');
} else if (@$argv[1] == 'sample2'){
    $input = file_get_contents(__DIR__.'/sample2.txt');
}  else if (@$argv[1] == 'sample3'){
    $input = file_get_contents(__DIR__.'/sample3.txt');
}  else if (@$argv[1] == 'sample4'){
    $input = file_get_contents(__DIR__.'/sample4.txt');
} else {
    $input = file_get_contents(__DIR__.'/input.txt');
}

$heat_loss_map = explode("\n", trim($input));
$heat_loss_map = array_map('trim', $lines);

$max_y = count($lines) - 1;
$max_x = count($lines[0]) - 1;

$pather = new \CruciblePather();


$start_x = 0;
$start_y = 0;

$pather->play($heat_loss_map, $start_x, $start_y, $max_x, $max_y);