Skip to content

Commit

Permalink
feat(3Girls): add PDF and PNG files for 8 different girls in the 3Gir…
Browse files Browse the repository at this point in the history
…ls folder

feat(AOC2024): update import paths in Day01a, Day02a, Day02b to use utils/utils.js
feat(AOC2024): add Day04b.js with solution for a puzzle and update index.html to use it
  • Loading branch information
annoyingmouse committed Dec 5, 2024
1 parent 716f51b commit 178baff
Show file tree
Hide file tree
Showing 25 changed files with 52 additions and 35 deletions.
Binary file added 000-MISCELLANEOUS/3GIRLS/3Girls/01.pdf
Binary file not shown.
Binary file added 000-MISCELLANEOUS/3GIRLS/3Girls/01.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 000-MISCELLANEOUS/3GIRLS/3Girls/02.pdf
Binary file not shown.
Binary file added 000-MISCELLANEOUS/3GIRLS/3Girls/02.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 000-MISCELLANEOUS/3GIRLS/3Girls/03.pdf
Binary file not shown.
Binary file added 000-MISCELLANEOUS/3GIRLS/3Girls/03.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 000-MISCELLANEOUS/3GIRLS/3Girls/04.pdf
Binary file not shown.
Binary file added 000-MISCELLANEOUS/3GIRLS/3Girls/04.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 000-MISCELLANEOUS/3GIRLS/3Girls/05.pdf
Binary file not shown.
Binary file added 000-MISCELLANEOUS/3GIRLS/3Girls/05.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 000-MISCELLANEOUS/3GIRLS/3Girls/06.pdf
Binary file not shown.
Binary file added 000-MISCELLANEOUS/3GIRLS/3Girls/06.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 000-MISCELLANEOUS/3GIRLS/3Girls/07.pdf
Binary file not shown.
Binary file added 000-MISCELLANEOUS/3GIRLS/3Girls/07.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 000-MISCELLANEOUS/3GIRLS/3Girls/08.pdf
Binary file not shown.
Binary file added 000-MISCELLANEOUS/3GIRLS/3Girls/08.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 000-MISCELLANEOUS/3GIRLS/3Girls/Untitled.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 8 additions & 8 deletions 000-MISCELLANEOUS/3GIRLS/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,14 @@
</head>
<body>
<div class="parallax-wrap">
<span><img src="./3Girls/01.png" /></span>
<span><img src="./3Girls/02.png" /></span>
<span><img src="./3Girls/03.png" /></span>
<span><img src="./3Girls/04.png" /></span>
<span><img src="./3Girls/05.png" /></span>
<span><img src="./3Girls/06.png" /></span>
<span><img src="./3Girls/07.png" /></span>
<span><img src="./3Girls/08.png" /></span>
<span><img src="3Girls/01.png" /></span>
<span><img src="3Girls/02.png" /></span>
<span><img src="3Girls/03.png" /></span>
<span><img src="3Girls/04.png" /></span>
<span><img src="3Girls/05.png" /></span>
<span><img src="3Girls/06.png" /></span>
<span><img src="3Girls/07.png" /></span>
<span><img src="3Girls/08.png" /></span>

</div>
<script>
Expand Down
2 changes: 1 addition & 1 deletion 000-MISCELLANEOUS/AOC2024/Day01a.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { input } from "./inputs/Day01Input.js";
import { diff } from "./utils.js";
import { diff } from "./utils/utils.js";
// const input = `3 4
// 4 3
// 2 5
Expand Down
2 changes: 1 addition & 1 deletion 000-MISCELLANEOUS/AOC2024/Day02a.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { checkSafe } from "./utils.js";
import { checkSafe } from "./utils/utils.js";
import { input } from "./inputs/Day02Input.js";
// const input = `7 6 4 2 1
// 1 2 7 8 9
Expand Down
2 changes: 1 addition & 1 deletion 000-MISCELLANEOUS/AOC2024/Day02b.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
isDescending,
largeJump,
checkSafe,
} from "./utils.js";
} from "./utils/utils.js";
import { input } from "./inputs/Day02Input.js";
// const input = `7 6 4 2 1
// 1 2 7 8 9
Expand Down
23 changes: 1 addition & 22 deletions 000-MISCELLANEOUS/AOC2024/Day03b.js
Original file line number Diff line number Diff line change
@@ -1,28 +1,7 @@
import { input } from "./inputs/Day03Input.js";
// const input = "xmul(2,4)&mul[3,7]!^don't()_mul(5,5)+mul(32,64](mul(11,8)undo()?mul(8,5))";
(() => {
// const starts = [...indexOfSubstrings(input, "do()?")];
// const stops = [...indexOfSubstrings(input, "don't()")];
// console.log("starts", starts)
// console.log("stops", stops)
// let result = 0;
// const regex = /mul\((\d+),(\d+)\)/g;
// const chunks = [input.slice(0, stops[0])];
// console.log(0, stops[0])
// for (let i = 0; i < starts.length; i++) {
// const start = starts[i] + 5
// const end = stops.find(dN => dN > starts[i]);
// console.log(start, end)
// chunks.push(input.slice(start, end));
// }
// chunks.forEach(chunk => {
// console.log(chunk)
// let match;
// while ((match = regex.exec(chunk)) !== null) {
// result += match[1] * match[2];
// }
// })
// console.log(result);
// Not mine: https://github.com/yolocheezwhiz/adventofcode/blob/main/2024/day03.js
const filteredInput = ("do()" + input)
.split("don't()")
.flatMap((elem) => elem.split("do()").slice(1))
Expand Down
37 changes: 37 additions & 0 deletions 000-MISCELLANEOUS/AOC2024/Day04b.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import { input } from "./inputs/Day04Input.js";
// const input = `MMMSXXMASM
// MSAMXMSMSA
// AMXSXMAAMM
// MSAMASMSMX
// XMASAMXAMM
// XXAMMXXAMA
// SMSMSASXSS
// SAXAMASAAA
// MAMMMXMMMM
// MXMXAXMASX`;

(() => {
// Not mine: https://pastebin.com/X4vKGyXs
const grid = input.split("\n").map((x) => x.split(""));
const rows = grid.length;
const cols = grid[0].length;
const part2 = (grid) => {
let count = 0;
for (let x = 1; x < rows - 1; x++) {
for (let y = 1; y < cols - 1; y++) {
if (grid[x][y] === "A") {
const tlbr =
(grid[x - 1][y - 1] === "M" && grid[x + 1][y + 1] === "S") ||
(grid[x - 1][y - 1] === "S" && grid[x + 1][y + 1] === "M");
const trbl =
(grid[x - 1][y + 1] === "M" && grid[x + 1][y - 1] === "S") ||
(grid[x - 1][y + 1] === "S" && grid[x + 1][y - 1] === "M");
if (tlbr && trbl) count++;
}
}
}
return count;
};

console.log(part2(grid));
})();
2 changes: 1 addition & 1 deletion 000-MISCELLANEOUS/AOC2024/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
</style>
</head>
<body>
<script type="module" src="./Day04a.js"></script>
<script type="module" src="./Day04b.js"></script>
</body>
</html>
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,5 @@ Where possible I've used modern JS and native modules.
- [AMI_ALTERED_PATTERN](https://annoyingmouse.js.org/WireFrameJS/000-MISCELLANEOUS/AMI_ALTERED_PATTERN/), Same as above, but with an offset grid.
- [AM_SIMPLE](https://annoyingmouse.js.org/WireFrameJS/000-MISCELLANEOUS/AM_SIMPLE/), Similar to the above, but with just cyan and magenta, and animated.
- [AM_ALTERED_PATTERN](https://annoyingmouse.js.org/WireFrameJS/000-MISCELLANEOUS/AM_ALTERED_PATTERN/), Same as above, but with an offset grid.
- [DISKS](https://annoyingmouse.js.org/WireFrameJS/000-MISCELLANEOUS/DISKS/), More messing about after browsing Pinterest - also an excuse to play with Affinity Designer.
- [DISKS](https://annoyingmouse.js.org/WireFrameJS/000-MISCELLANEOUS/DISKS/), More messing about after browsing Pinterest - also an excuse to play with Affinity Designer.
- [3GIRLS](https://annoyingmouse.js.org/WireFrameJS/000-MISCELLANEOUS/3GIRLS/), Playing with parallax.

0 comments on commit 178baff

Please sign in to comment.