Start of day 3.
This commit is contained in:
parent
3f2ac3a266
commit
4ad017f909
@ -4,6 +4,7 @@ require_once __DIR__ . '/vendor/autoload.php';
|
|||||||
|
|
||||||
use Aoc2025\Days\Day1;
|
use Aoc2025\Days\Day1;
|
||||||
use Aoc2025\Days\Day2;
|
use Aoc2025\Days\Day2;
|
||||||
|
use Aoc2025\Days\Day3;
|
||||||
use Aoc2025\Services\Template;
|
use Aoc2025\Services\Template;
|
||||||
|
|
||||||
|
|
||||||
@ -43,6 +44,9 @@ $day_1_answer = $day_1->run();
|
|||||||
$day_2 = new Day2();
|
$day_2 = new Day2();
|
||||||
$day_2_answer = $day_2->run();
|
$day_2_answer = $day_2->run();
|
||||||
|
|
||||||
|
// Day 3.
|
||||||
|
$day_3 = new Day3();
|
||||||
|
$day_3_answer = $day_3->run();
|
||||||
|
|
||||||
// Render the template.
|
// Render the template.
|
||||||
$template = new Template('main.html');
|
$template = new Template('main.html');
|
||||||
@ -51,6 +55,8 @@ $substitutions = [
|
|||||||
'day_1_answer_2' => $day_1_answer['part_2'],
|
'day_1_answer_2' => $day_1_answer['part_2'],
|
||||||
'day_2_answer' => $day_2_answer['part_1'],
|
'day_2_answer' => $day_2_answer['part_1'],
|
||||||
'day_2_answer_2' => $day_2_answer['part_2'],
|
'day_2_answer_2' => $day_2_answer['part_2'],
|
||||||
|
'day_3_answer' => $day_3_answer['part_1'],
|
||||||
|
'day_3_answer_2' => $day_3_answer['part_2'],
|
||||||
];
|
];
|
||||||
$response = $template->render($substitutions);
|
$response = $template->render($substitutions);
|
||||||
|
|
||||||
|
|||||||
4
2025/inputs/day_3_input.txt
Normal file
4
2025/inputs/day_3_input.txt
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
987654321111111
|
||||||
|
811111111111119
|
||||||
|
234234234234278
|
||||||
|
818181911112111
|
||||||
@ -1,5 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace Aoc2025\Days;
|
namespace Aoc2025\Days;
|
||||||
|
|
||||||
use Aoc2025\Day;
|
use Aoc2025\Day;
|
||||||
|
|
||||||
class Day2 extends Day {
|
class Day2 extends Day {
|
||||||
|
|||||||
17
2025/src/Days/Day3.php
Normal file
17
2025/src/Days/Day3.php
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Aoc2025\Days;
|
||||||
|
|
||||||
|
use Aoc2025\Day;
|
||||||
|
|
||||||
|
class Day3 extends Day {
|
||||||
|
|
||||||
|
public function run() {
|
||||||
|
$input = $this->getInputFile('day_3_input.txt');
|
||||||
|
|
||||||
|
return [
|
||||||
|
'part_1' => 'tes',
|
||||||
|
'part_2' => 'hello',
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -34,8 +34,8 @@
|
|||||||
<h2 class="bitcount fs-1">Day 3</h2>
|
<h2 class="bitcount fs-1">Day 3</h2>
|
||||||
</div>
|
</div>
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<p class="bold">Part 1:</p>
|
<p class="bold">Part 1: {{ day_3_answer }}</p>
|
||||||
<p class="bold">Part 2:</p>
|
<p class="bold">Part 2: {{ day_3_answer_2 }}</p>
|
||||||
<button>View Code</button>
|
<button>View Code</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user