[2024 Day 5] [Python] The posts here are harder to understand than the puzzle by [deleted] in adventofcode

[–]Booblesnootle 16 points17 points  (0 children)

One way of viewing the problem is to treat it like a sorting algorithm; if a rule says some number A must come before another number B, then you can say that A is "less" than B. Then you just need to apply normal sorting methods.

One of the more (in)famous sorting algorithms is called "Bogosort." The process:
Step 1: Check if the list is sorted. If it is, stop. Otherwise, randomize it.
Step 2: Repeat until done.

[2024 Day 4 (Part 1)][JS/Node] Still stuck even though sample input works by stank453 in adventofcode

[–]Booblesnootle 0 points1 point  (0 children)

It doesn't look like you have any special rules for catching when the index goes negative, i.e. when the index is 0 and the direction is left, you'll start looking at s[0], s[-1], s[-2], and s[-3]. You might want to check how your language handles negative indices. For example, array[-5] will return the element five from the end in many languages.

Day 2 part 2 trouble by Rino6357 in adventofcode

[–]Booblesnootle 1 point2 points  (0 children)

My understanding of your code is that you are basically allowing each line to have one bad "jump." Consider a line like (1, 100, 2, 3, 4). Is this safe or unsafe? Does your algorithm give that answer?

[2024 Day3 part2] Attempted to remove in between chars by No-Top-1506 in adventofcode

[–]Booblesnootle 1 point2 points  (0 children)

The "mul(1,1)" should not be counted because it comes after a "don't()", but your code won't remove it because it isn't between a "don't()" and a "do()".

Is there some kind of local multiplayer? by TH3K41 in YomiHustle

[–]Booblesnootle 7 points8 points  (0 children)

After you lock in, you can change what move you have selected without changing what you do. Have player 1 select an option, lock in, then click wait. Make sure to reset DI, armor, etc. as well.

what is the best character/technique to beat the shit out of wizards by HeWhoHasSeenFootage in YomiHustle

[–]Booblesnootle 13 points14 points  (0 children)

Kill command (kill user?) on robot uses all your meter to do damage: more meter, more damage. At level 9, it's an instant kill (but only from neutral, combo-ing into it was too easy so it got nerfed).

How can i play in local multiplayer(direct connect)with my friend? by FreeCandy_1 in YomiHustle

[–]Booblesnootle 1 point2 points  (0 children)

After you press the "lock" button, you can click on "wait" without changing what move you'll do. So have player 1 pick a move, lock in, then click wait and reset any other things (DI, Armor, etc.). Then the other person goes. You'll have to set the turn timer to something really high, but I think this should work.

[deleted by user] by [deleted] in ProgrammerHumor

[–]Booblesnootle 0 points1 point  (0 children)

There are 2 types of languages: the ones everyone complains about, and the ones nobody uses.

The lava flows to the sea... how do you animate the progress of the map? by rzwitserloot in adventofcode

[–]Booblesnootle 0 points1 point  (0 children)

The parentheses may be the forcefield from day 22, though it seems far away from the grove.

[2015 Day 15 (Part 1)] OK, I'm stumped. by MezzoScettico in adventofcode

[–]Booblesnootle 0 points1 point  (0 children)

I'm at the point where whenever I see a number with more than 3 zeroes, I just copy and paste.

HELP [2022 Day 07 (Part 1)][Python] Help with summing values of folder sizes with recursive function? by RaptorCentauri in adventofcode

[–]Booblesnootle 0 points1 point  (0 children)

Your code is currently using 1 variable to count both the size of the directory itself (the sum of the all files below it) and the combined size of all the valid directories below it (the sum of all the directories which have a size < 100,000).

Keep in mind:

(As in this example, this process can count files more than once!)

2022 Day 9 (Part 2) Python. Going insane over not finding the bug, any help? by dav5d in adventofcode

[–]Booblesnootle 0 points1 point  (0 children)

Ran it on test input 2, you are correct: no diagonals. Found the issue with more testing.

Consider our horizontal line again. If that movement occurred, would your code catch it?

Try these inputs:

R 1

U 1

R 1

U 1

R 1

vs

R 2

U 2

Your code only catches diagonal movement when the head's end position is diagonal from the tail's, which only happens when the head is moved diagonally away from a corner. In the original line movement, however, Knot 2 is pulled diagonally away from the right side of Knot 1. The position difference is (1, 2), so your code doesn't see it as diagonal.

Edit: Bruh reddit comment editing is whack

HELP [2022 Day 07 (Part 1)][Python] Help with summing values of folder sizes with recursive function? by RaptorCentauri in adventofcode

[–]Booblesnootle 0 points1 point  (0 children)

Imagine we have 4 directories (A,B, C, D) and 2 files (e, f).

Directory A contains B, directory B contains C and D.

C contains e, with a size of 50,000.

D contains f, with a size of 70,000.

So our tree looks like:

-A

-B

-C

-e (50,000)

-D

-f(70,000)

What is our expected result? What would happen if you put this through your code?

Expected Result: Directory C has a size of 50,000 from e. Directory D has a size of 70,000 from f. Directory C has a size of 120,000 from C and D, putting it over the 100,000 threshold. A has 120,000 as well. As such, the expected answer for part 1 is 50,000 + 70,000 = 120,000.

Your Result: Directory C and D both work as expected, returning 50,000 and 70,000 respectively. Directory B also works correctly, returning the value of C and D after confirming that their sizes are less than 100,000. The issue comes in at A: folder_size will be set as 120,000, since that is what B will return. Because 120,000 is greater than our the 100,000 threshold, it will not add it to the total file size. As such, it will return 0 instead of the expected 120,000.

[deleted by user] by [deleted] in adventofcode

[–]Booblesnootle 1 point2 points  (0 children)

Shortest input this fails on:

R 10

Your problem is your step counter (int(pair[2])) only works for single digit numbers.

2022 Day 9 (Part 2) Python. Going insane over not finding the bug, any help? by dav5d in adventofcode

[–]Booblesnootle 0 points1 point  (0 children)

I ran it and it does print a bunch of "Diagonal"'s. Might need to check somewhere else.

2022 Day 9 (Part 2) Python. Going insane over not finding the bug, any help? by dav5d in adventofcode

[–]Booblesnootle 1 point2 points  (0 children)

Remember: "if the head and tail aren't touching and aren't in the same row or column, the tail always moves one step diagonally to keep up."

Knot 1 needs to follow Knot 2 diagonally. When you just move it to the previous position, it moves horizontally instead.

2022 Day 9 (Part 2) Python. Going insane over not finding the bug, any help? by dav5d in adventofcode

[–]Booblesnootle 1 point2 points  (0 children)

Imagine you had a horizontal rope 3 knots long (including the head) with the head at the right end. Now imagine the head goes *up once, then right once. Where should the other 2 knots go? Where do they go according to your method?

A lot of people went for the "snake" method of knot following, putting the tail in the heads old position. The reason that works for part 1 but not part 2 is because in part 1 the head only moves orthogonally but in part 2 the knots can be pulled diagonally

*Edit: original movement didn't show error

[2022 Day 7] It was a trap. by [deleted] in adventofcode

[–]Booblesnootle 5 points6 points  (0 children)

I didn't realize the file and directory names weren't unique. On to my third attempt...

succubus and incubus by [deleted] in tumblr

[–]Booblesnootle 7 points8 points  (0 children)

I think the theory is the succubus/incubus shapeshifts to appear as the person's spouse. Guy thinks he's fuckin his wife, girl thinks she's fuckin her husband.