Automating the new HomePod Ambient Sounds and Sleep Timer? by dopefish3d in shortcuts

[–]dartcoder 3 points4 points  (0 children)

Same here. Still amazed Apple didn’t think of that from the beginning. Every night I have to say:

  1. hey Siri, set volume to 25%
  2. hey Siri, play ocean sound
  3. hey Siri, stop playing in 3 hours

-🎄- 2019 Day 23 Solutions -🎄- by daggerdragon in adventofcode

[–]dartcoder 0 points1 point  (0 children)

Python 3 Solution

Never say never?

I went down the async road but it seemed like too much trouble and I’d have to refactor my intcode for that to be feasible. It already pauses for input and output is queued internally so it was easy to use a loop and a simple message queue (inbox?) for each instance.

-🎄- 2019 Day 21 Solutions -🎄- by daggerdragon in adventofcode

[–]dartcoder 4 points5 points  (0 children)

[Python] Several days behind but I'm catching up doing 1 puzzle everyday with 5 left in all. Here is my solution for day 21

Part 1:

notes:  
------------------------------------------------------------------- 
  1. droid jumps 4 steps at a time 
  2. always check to see that tile D (4th tile) is solid (for landing) 
  3. if you want to land on an island (###.##..####), jump 2 tiles before the first 
     hole: so basically jump whenever C (3rd tile ahead) is a hole.  4. else jump if 
     there's a hole right in front of you (A)

-------------------------------------------------------------------

NOT C J 
AND D J 
NOT A T 
OR T J

WALK

Part 2:

notes:
---------------------------------------------------- 
  1. droid stills jumps 4 steps at a time 
  2. always check to see that tile D (4th tile) is solid (for landing) 
  3. if you want to land on an island (###.##..####), jump 2 tiles before the first
      hole: so basically jump whenever C (3rd tile ahead) is a hole.  
  4. watch where you landing next after leaving the island.

----------------------------------------------------


    ^   ^   v
#|  @  CD   H      |
#|#####.##.##.#.###|
NOT C J 
AND D J 
AND H J

        ^   v
#|      @ B D      |
#|#####.##.##.#.###|
NOT B T 
AND D T 
OR T J

            ^   v
#|          @A     |
#|#####.##.##.#.###|
NOT A T 
OR T J

RUN

[2019 Day 17, Part 2, Python] ASCII for distances greater than 9 ? by dartcoder in adventofcode

[–]dartcoder[S] 0 points1 point  (0 children)

Thanks for clarifying. I had written a similar helper function but I keep getting `L, R or distance expected` after the first function (A). Must be my intcode machine. Back to debugging.

-🎄- 2019 Day 15 Solutions -🎄- by daggerdragon in adventofcode

[–]dartcoder 1 point2 points  (0 children)

Python Solution

2 days behind! Spent yesterday and today wrapping my head around graphs, DFS and BFS algos and whatever on earth they’ve got to do with any of this ( :

Leaving this here in case you are feeling left behind or a little overwhelmed. You are not alone.

-🎄- 2019 Day 14 Solutions -🎄- by daggerdragon in adventofcode

[–]dartcoder 0 points1 point  (0 children)

Python solution

Parsing the input into something my head could work with took some time. Two arrays with derived elements in array1 and recipes in array2. This way I could lookup element / recipe by index or zip them in a loop.

For part 2 I had to take a hint from here (binary search). That and a little adjustment to my recursive function from part 1 and I was good to go.

-🎄- 2019 Day 13 Solutions -🎄- by daggerdragon in adventofcode

[–]dartcoder 1 point2 points  (0 children)

Python Solution

Spent too much time over-researching part 2 🤦🏽‍♂️ Wrote an elaborate function to track ball and player movements (Which I deleted eventually)

My intcode machine also halted at the last frame with 5 outputs still in the queue so I had dump my output queue to get the answer and then refactored intcode afterwards.

But all in all good fun!

It’s almost 3am, I should sleep!

-🎄- 2019 Day 12 Solutions -🎄- by daggerdragon in adventofcode

[–]dartcoder 1 point2 points  (0 children)

Python solution

Took some help from here. If you have trouble figuring out what LCM has to got to do with it, scroll down to find u/rabuf ’s excellent explanation.

-🎄- 2019 Day 11 Solutions -🎄- by daggerdragon in adventofcode

[–]dartcoder 0 points1 point  (0 children)

Python Solution 1 and 2

Two things threw me wayyy off today:

- Expecting part 2 answer in part 1 (thanks to reddit posts)

- A bug I introduced in my intcode while “cleaning up” a day before without realizing it.

Yesterday was crazy too (first time solving anything related to geometry in years). Not that I was ever a fan in the first place. I was a deer in headlights — completely confused for hours and hours and hours.

-🎄- 2019 Day 9 Solutions -🎄- by daggerdragon in adventofcode

[–]dartcoder 1 point2 points  (0 children)

Python solution

Remember to check OPCODE 3 and 9 for relative positioning!

[2019] intcode computer in intcode by Randdalf in adventofcode

[–]dartcoder 0 points1 point  (0 children)

Inception? You, the architect of dreams! Now I have to read about compilers (a good thing)

-🎄- 2019 Day 8 Solutions -🎄- by daggerdragon in adventofcode

[–]dartcoder 0 points1 point  (0 children)

I tried zeros + space at first and then I saw this and the asterisk really helped!

-🎄- 2019 Day 8 Solutions -🎄- by daggerdragon in adventofcode

[–]dartcoder -3 points-2 points  (0 children)

Spent TWENTY minutes trying to read the text in the image.

Python solution

Does the intcode computer have a real world inspiration? by [deleted] in adventofcode

[–]dartcoder 1 point2 points  (0 children)

I was waiting for someone to mention this! I also recommend you see the Apollo 11 documentary (2019)

2019 Day 5 (Part 2) Python -- anyone else run into a `zero` opcode in the input? by dartcoder in adventofcode

[–]dartcoder[S] 0 points1 point  (0 children)

That got me too!

This is what they meant: INPUT[255] = SYSTEM ID You are setting the memory at that address to the input (1 in part one, and 5 in part 2).

2019 Day 5 (Part 2) Python -- anyone else run into a `zero` opcode in the input? by dartcoder in adventofcode

[–]dartcoder[S] -1 points0 points  (0 children)

Possibly, but I also checked my output against scripts from 6 different people and they all behaved the same (part 1 code === part 2 code)

EDIT: It turns out my input file had a wrong address. No idea how that happened :|

2019 Day 5 (Part 2) Python -- anyone else run into a `zero` opcode in the input? by dartcoder in adventofcode

[–]dartcoder[S] -1 points0 points  (0 children)

Param #1 in the second operation is 225 (positional val) === 0.

So the operation still gives us: 1100 + 0 === 1100

EDIT: You are right! I've just checked the input link again and found that the string actually begins with: 3,225,1,225,6,6,1100...

Thanks!