|
| 1 | +<?php |
| 2 | + |
| 3 | +require __DIR__ . '/../vendor/autoload.php'; |
| 4 | + |
| 5 | +//use adventofcode\Year2024\WordSearch; |
| 6 | + |
| 7 | +/** |
| 8 | + * --- Day 4: Ceres Search --- |
| 9 | + * |
| 10 | + * "Looks like the Chief's not here. Next!" One of The Historians pulls out a device and pushes the only button on it. |
| 11 | + * After a brief flash, you recognize the interior of the Ceres monitoring station! |
| 12 | + * |
| 13 | + * As the search for the Chief continues, a small Elf who lives on the station tugs on your shirt; she'd like to know |
| 14 | + * if you could help her with her word search (your puzzle input). She only has to find one word: XMAS. |
| 15 | + * |
| 16 | + * This word search allows words to be horizontal, vertical, diagonal, written backwards, or even overlapping |
| 17 | + * other words. It's a little unusual, though, as you don't merely need to find one instance of XMAS - you need to |
| 18 | + * find all of them. Here are a few ways XMAS might appear, where irrelevant characters have been replaced with .: |
| 19 | + * |
| 20 | + * ..X... |
| 21 | + * .SAMX. |
| 22 | + * .A..A. |
| 23 | + * XMAS.S |
| 24 | + * .X.... |
| 25 | + * |
| 26 | + * The actual word search will be full of letters instead. For example: |
| 27 | + * |
| 28 | + * MMMSXXMASM |
| 29 | + * MSAMXMSMSA |
| 30 | + * AMXSXMAAMM |
| 31 | + * MSAMASMSMX |
| 32 | + * XMASAMXAMM |
| 33 | + * XXAMMXXAMA |
| 34 | + * SMSMSASXSS |
| 35 | + * SAXAMASAAA |
| 36 | + * MAMMMXMMMM |
| 37 | + * MXMXAXMASX |
| 38 | + * |
| 39 | + * In this word search, XMAS occurs a total of 18 times; here's the same word search again, but where letters |
| 40 | + * not involved in any XMAS have been replaced with .: |
| 41 | + * |
| 42 | + * ....XXMAS. |
| 43 | + * .SAMXMS... |
| 44 | + * ...S..A... |
| 45 | + * ..A.A.MS.X |
| 46 | + * XMASAMX.MM |
| 47 | + * X.....XA.A |
| 48 | + * S.S.S.S.SS |
| 49 | + * .A.A.A.A.A |
| 50 | + * ..M.M.M.MM |
| 51 | + * .X.X.XMASX |
| 52 | + * |
| 53 | + * Take a look at the little Elf's word search. How many times does XMAS appear? |
| 54 | + */ |
| 55 | + |
| 56 | +//$multiplyInstructionParser = new MultiplyInstructionParser(); |
| 57 | +// |
| 58 | +//$lines = file(__DIR__ . '/inputs/day-04.input', FILE_IGNORE_NEW_LINES); |
| 59 | +// |
| 60 | +//$sum = $multiplyInstructionParser->findMultiplyInstructionSum($lines); |
| 61 | +//print('The sum of the multiplier instructions from the given input is ' . $sum . ".\n"); |
| 62 | + |
| 63 | +/** |
| 64 | + * --- Part Two --- |
| 65 | + * |
| 66 | + * |
| 67 | + */ |
| 68 | + |
| 69 | +//$sum = $multiplyInstructionParser->findExtendedMultiplyInstructionSum($lines); |
| 70 | +//print('The sum of the extended multiplier instructions from the given input is ' . $sum . ".\n"); |
0 commit comments