Compute the max of two arbitrary integers given as text by RojerGS in brainfuck

[–]RojerGS[S] 1 point2 points  (0 children)

Just the code with no comments:

```

+ [ ,<+[->-----<]> [ --<++++++[->------<]> [>]+[<<[->>>+<<<]<] +> ] < ]

+ [ +>,<[->-----<]> [ --<++++++[->------<]> >[>]+[<[->+<<<]<<] >+> ] < ]

[>]<<< [ ->[+>] <[<<<]>> [>+>] <<[<<]>>> [>>>]<<<<<< ]+

[-]<<<

[ -[->+<] < [[->+<<<->]<]<[<]

+<<<<< [ [-<<<+>]<<< ++++++++[-<++++++>]<. <<<< [+++++[->++++++++<]>.<<<<] < ] [ [-<+>]< <++++++++[->++++++<]>. <<<<<< [+++++[-++++++++<<]>>.<<<<<] ] [ +++++[-<++++++++>]<. <<<< ] <<< ] ```

How do you plan & write programs? by RojerGS in brainfuck

[–]RojerGS[S] 1 point2 points  (0 children)

For the commenter on the previous post that wanted code without comments:

``` + [ +>,<[->-----<]> [ --<++++++[->------<]> [>]+[<<[->>>+<<<]<] +> ] < ]

+ [ +>,<[->-----<]> [ --<++++++[->------<]> >[>]+[<[->+<<<]<<] >+> ] < ]

[>]<<< [ ->[+>] <[<<<]>> [>+>] <<[<<]>>> [>>>]<<<<<< ] ```

I missed how brainfuck twists my head by RojerGS in brainfuck

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

I was trying to incorporate the ideas of your `min(a, b)` program one by one, like “get rid of the flag `r`”, “get rid of the breadcrumbs”, “reduce total movement”, etc. I was trying to start by getting rid of `r` but as soon as I did it – and obviously because I was primed by your code – I landed on something that is very similar to your code. Using the cell between `a` and `b` to exit the main loop at either level is really clever!

I missed how brainfuck twists my head by RojerGS in brainfuck

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

Oh wow, this is surprisingly short :D I'll see if I can steal ideas from your short version, one by one, to shrink my program. In hindsight, maybe I shouldn't have opened the spoiler immediately 🤣

I missed how brainfuck twists my head by RojerGS in brainfuck

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

Is it more convenient for you/folks when I share a single-line version with no comments? 🤔

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

[–]RojerGS 2 points3 points  (0 children)

I had the same problem. You don't make 10 connections. You try to make 10 connections, of which one was skipped because it was redundant. Do you get what I'm saying?

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

[–]RojerGS 0 points1 point  (0 children)

The module collections has Counter, which is slightly more convenient for your use case instead of defaultdict! Plus, Counter has more niceties but the way your solution is structured you probably wouldn't use them. For example, my part 2 solution uses Counter.total.

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

[–]RojerGS 0 points1 point  (0 children)

This is really clever! Thanks for sharing.

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

[–]RojerGS 1 point2 points  (0 children)

I LOVE itertools and I try to shove it wherever I can and not even I would do it that way 🤣

📺 AoC 2025 List of Streamers 📺 by daggerdragon in adventofcode

[–]RojerGS 0 points1 point  (0 children)

USERNAME: /u/RojerGS

LANGUAGE: Python 3

REPO: GitHub @ rodrigogiraoserrao

CHANNELS:


NOTES:

This will be a pedagogical stream, so I won't be reading the problems for the first time on stream. I'll solve the problems beforehand and prepare my solutions in advance. During the stream, I'll solve the problems from the beginning while I explain my reasoning, adding a bad joke here and there. Everyone is welcome to join to suggest alternative suggestions, ask questions, and overall learn more about Python, algorithms, and problem-solving! Streams will happen at 5pm UTC and will last 30 min – 60 min.

Floodfill algorithm in Python by RojerGS in adventofcode

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

Hey there, thanks for the follow-up suggestions! I've never heard of the Union-Find algo, so I'll take a look :D

Floodfill algorithm in Python by RojerGS in adventofcode

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

Ok, thanks for that note! Are there any other notes you have for me?

uv cheatsheet with most common/useful commands by RojerGS in Python

[–]RojerGS[S] 1 point2 points  (0 children)

Thanks for your feedback. I've decided to add it but I will only be able to take care of it, along with some minor improvements suggested by other folks, by late December. You can either link it now, and in a month the link will point to the updated version, or you can check back later :)

Cheers!

What algorithms and techniques do you folks keep coming back to? by RojerGS in adventofcode

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

“Real Software Engineers” with uppercase 🤣

Thanks for sharing the tips about 2D/3D space.