Skip to content

Commit

Permalink
2024 Day 04 setup
Browse files Browse the repository at this point in the history
  • Loading branch information
sprak3000 committed Dec 5, 2024
1 parent 979d662 commit 06598fe
Show file tree
Hide file tree
Showing 4 changed files with 220 additions and 2 deletions.
2 changes: 0 additions & 2 deletions 2024/day-03.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
use adventofcode\Year2024\MultiplyInstructionParser;

/**
* --- Day 3: Mull It Over ---
*
* --- Day 3: Mull It Over ---
*
* "Our computers are having issues, so I have no idea if we have any Chief Historians in stock! You're welcome to
Expand Down
70 changes: 70 additions & 0 deletions 2024/day-04.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
<?php

require __DIR__ . '/../vendor/autoload.php';

//use adventofcode\Year2024\WordSearch;

/**
* --- Day 4: Ceres Search ---
*
* "Looks like the Chief's not here. Next!" One of The Historians pulls out a device and pushes the only button on it.
* After a brief flash, you recognize the interior of the Ceres monitoring station!
*
* As the search for the Chief continues, a small Elf who lives on the station tugs on your shirt; she'd like to know
* if you could help her with her word search (your puzzle input). She only has to find one word: XMAS.
*
* This word search allows words to be horizontal, vertical, diagonal, written backwards, or even overlapping
* other words. It's a little unusual, though, as you don't merely need to find one instance of XMAS - you need to
* find all of them. Here are a few ways XMAS might appear, where irrelevant characters have been replaced with .:
*
* ..X...
* .SAMX.
* .A..A.
* XMAS.S
* .X....
*
* The actual word search will be full of letters instead. For example:
*
* MMMSXXMASM
* MSAMXMSMSA
* AMXSXMAAMM
* MSAMASMSMX
* XMASAMXAMM
* XXAMMXXAMA
* SMSMSASXSS
* SAXAMASAAA
* MAMMMXMMMM
* MXMXAXMASX
*
* In this word search, XMAS occurs a total of 18 times; here's the same word search again, but where letters
* not involved in any XMAS have been replaced with .:
*
* ....XXMAS.
* .SAMXMS...
* ...S..A...
* ..A.A.MS.X
* XMASAMX.MM
* X.....XA.A
* S.S.S.S.SS
* .A.A.A.A.A
* ..M.M.M.MM
* .X.X.XMASX
*
* Take a look at the little Elf's word search. How many times does XMAS appear?
*/

//$multiplyInstructionParser = new MultiplyInstructionParser();
//
//$lines = file(__DIR__ . '/inputs/day-04.input', FILE_IGNORE_NEW_LINES);
//
//$sum = $multiplyInstructionParser->findMultiplyInstructionSum($lines);
//print('The sum of the multiplier instructions from the given input is ' . $sum . ".\n");

/**
* --- Part Two ---
*
*
*/

//$sum = $multiplyInstructionParser->findExtendedMultiplyInstructionSum($lines);
//print('The sum of the extended multiplier instructions from the given input is ' . $sum . ".\n");
10 changes: 10 additions & 0 deletions 2024/inputs/day-04-sample.input
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
MMMSXXMASM
MSAMXMSMSA
AMXSXMAAMM
MSAMASMSMX
XMASAMXAMM
XXAMMXXAMA
SMSMSASXSS
SAXAMASAAA
MAMMMXMMMM
MXMXAXMASX
Loading

0 comments on commit 06598fe

Please sign in to comment.