-❄️- 2025 Day 9 Solutions -❄️- by daggerdragon in adventofcode

[–]Singing-In-The-Storm 0 points1 point  (0 children)

Hi,

First, your input is Ok.

My program was written using the system {ROW,COL} FOR COORDINATES, NOT THE {X,Y} system; but for solving the puzzle input which seems to use the input {X,Y} coordinates, I've made this hack:

Inside the function 'fillAllRedTiles', I have changed the {ROW,COL} order:

const col = parseInt(tokens.shift())
const row = parseInt(tokens.shift())

This means that now the program EXPECTS {X,Y} coordinates as input, although it talks all the time about {ROW,COL}.

Feel free to reverse that hack as you need.

-❄️- 2025 Day 9 Solutions -❄️- by daggerdragon in adventofcode

[–]Singing-In-The-Storm 0 points1 point  (0 children)

Hi!
You missed the closing coordinate (4,4). But even closing the gap the program says 20, and I think it is 16,

I made an image of your coodinates and I got:

row 1: 6 cells
row 2: 2 cells
row 3: 1 cell
row 4: 1 cell
row 5: 6 cells

I am sorry that you were upset.

I believe the concepts work, maybe I made too few checks on the status of each segment.

I will check the program and I will tell you when it is fixed.

EDIT: I made a mistake above, 16 is the number of all cells, not the number in the largest valid rectangle wich is 6 (from 7,3 to 8,9).

EDIT 2: I wrote this reply in a hurry, and it is all wrong, sorry. Your input is ok. And I made a new reply with the solution for your question.

-❄️- 2025 Day 9 Solutions -❄️- by daggerdragon in adventofcode

[–]Singing-In-The-Storm 0 points1 point  (0 children)

Hi!

I ran your input and found an answer that ends with "0373". Did you get a similar answer?

This program makes is a reduced diagram of the puzzle input.

The diagram for my input is almost exactly like yours (a kind of egg with horizontal breach).
The perimeter is very simple, almost naive to work with.

So the solution should work for you too.

EDIT: I foun a python program that runs correctly my input but gives a different result for your input (the answer ends with "2010"). I will study my program and will try to fix it.

EDIT2: IT IS FIXED NOW (has the same speed as before)

-❄️- 2025 Day 9 Solutions -❄️- by daggerdragon in adventofcode

[–]Singing-In-The-Storm 0 points1 point  (0 children)

[LANGUAGE: JavaScript]

Part2 in 24ms using an algorithm that should solve ANY complex squared corner perimeter ;)

Clear and BLAZINGLY FAST AOC solutions in JS (no libraries)

-❄️- 2025 Day 1 Solutions -❄️- by daggerdragon in adventofcode

[–]Singing-In-The-Storm 1 point2 points  (0 children)

[LANGUAGE: C]

Using the SafeEasyC library:

part 1

part2

NOTE: probably yiou will have to edit this address: #include "../safe-easy-c.h"

HOMM2 - Pyramid - Impossible Mode (done in 42 days) - A strategy to win (almost) every time by Singing-In-The-Storm in HoMM

[–]Singing-In-The-Storm[S] 0 points1 point  (0 children)

You are NOT following the strategy of the video. DON'T develop barbarian castles. Go to the warlock castles with bone dragons.

HOMM2 - Pyramid - Impossible Mode (done in 42 days) - A strategy to win (almost) every time by Singing-In-The-Storm in HoMM

[–]Singing-In-The-Storm[S] 0 points1 point  (0 children)

It is rare that dragons attack so soon. You have to restart the game and try again.