-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
27 lines (17 loc) · 800 Bytes
/
index.php
File metadata and controls
27 lines (17 loc) · 800 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
<?php declare(strict_types=1);
use Hitch\Day1\FrequencyCalculator;
use Hitch\Day1\FrequencyCalibrator;
include 'vendor/autoload.php';
//This file will get split out later
$inputFile = file_get_contents('./input/Day1/input.txt');
$input = array_map('intval', array_filter(explode("\n", $inputFile)));
$solver = new FrequencyCalculator($input, 0);
echo("Day 1, part 1: " . $solver->solve() . "\n");
$solver = new FrequencyCalibrator($input, 0);
echo("Day 1, part 2: " . $solver->solve() . "\n");
$inputFile = file_get_contents('./input/Day2/input.txt');
$input = array_filter(explode("\n", $inputFile));
$solver = new \Hitch\Day2\Checksum($input);
echo("Day 2, part 1: " . $solver->solve() . "\n");
$solver = new \Hitch\Day2\StringDiff($input);
echo("Day 2, part 2: " .$solver->solve()."\n");