#aoc23

Inferisinferis
2023-12-23

The thing I don't like about AoC is that the example inputs are a bit too simple. In this case, my code works fine for both example inputs, but it fails for the actual input which is so big that it's practically impossible to debug to find out what is going on.

Frank Fischerfifr@kif.rocks
2023-12-21

Day 21 is my favourite puzzle so far. Part 2 has a nice solution by observing that the number f(i) of reachable fields after i iterations is a quadratic function of the number of iterations i for i large enough, i.e. `f(i)=a*i^2+b*i+c`. The coefficients a,b,c can be derived from three values of f obtained by simulation of the process for few iterations.

#AdventOfCode #AOC23 #AOC

Inferisinferis
2023-12-18

AoC23 be like: β€œPart 1 works, I think I did a pretty good job at making this efficient”. Part 2: "Nope”

Inferisinferis
2023-12-17

Found part one of Puzzle 12! Man, what an ordeal. The solution was simple in the end, but we'll have to see if it scales up for part 2.

Flo πŸ‘¨πŸΌβ€πŸ’»flo1804@fosstodon.org
2023-12-11

I benchmarked my code for the first time. This isn't very fast, but that's properly because I am not a rust expert. This is day 8 part 1.

#AOC #AdventOfCode #rust #rustlang #aoc2023 #aoc23

Flo πŸ‘¨πŸΌβ€πŸ’»flo1804@fosstodon.org
2023-12-11

I just completed "Camel Cards" - Day 7 - Advent of Code 2023 #AdventOfCode adventofcode.com/2023/day/7

This took so long πŸ˜‚ But I just finished it in #rustlang

codeberg.org/florianlang/adven

#rust #aoc #aoc2023 #aoc23

Massimo :commodore: :amiga:massimolauria@mastodon.uno
2023-12-11
2023-12-11

@c_discussions πŸ€¦β€β™‚οΈ

And here I was thinking vectors and ranges were overkill for #aoc23 Day 1, Part 1, but little did I know the possibilities.

hachyderm.io/@smurthys/1115193

#cpp #aoc2023 #AdventOfCode

Flo πŸ‘¨πŸΌβ€πŸ’»flo1804@fosstodon.org
2023-12-09

I wondered why my day 7 part 1 code not working. Now I know it. Such a stupid bug. I started writing this code at 11 pm it was properly to late for me to write code πŸ˜‚

#aoc #AdventOfCode #aoc2023 #aoc23 #rust #rustlang

Paul Wilde :dontpanic2: :smeghead: :archlinux: :freebsd:paul@notnull.space
2023-12-09
Flo πŸ‘¨πŸΌβ€πŸ’»flo1804@fosstodon.org
2023-12-08

I have still not finished part 1 of day 7. Probably because I am not so good in #rust

#aoc #aoc23 #AdventOfCode #rustlang

⸘Johnβ€½john@dads.cool
2023-12-06

Once again I learn I will go to incredibly great lengths to avoid solving the quadratic equation.

I've completed "Wait For It" - Day 6 - Advent of Code 2023 #AdventOfCode adventofcode.com/2023/day/6
#aoc #AdventOfCode23 #aoc23 #aoc_cpp

Flo πŸ‘¨πŸΌβ€πŸ’»flo1804@fosstodon.org
2023-12-05

Part2 of todays #AdventOfCode took 3,25 Minutes and need very much RAM.

I optimized it and now its little bit faster, took about 2,75 Minutes and the ram is only at 1,9 MiB.

So now my next job is to minimize the time this took

#aoc #aoc2023 #aoc23 #rust #rustlang

Flo πŸ‘¨πŸΌβ€πŸ’»flo1804@fosstodon.org
2023-12-05

I just finished part 1 of todays #AdventOfCode This was much harder than the other days. For me even more because I done it in #rustlang

#rust #aoc #aoc2023 #aoc23

2023-12-05

I've completed "If You Give A Seed A Fertilizer" - Day 5 - Advent of Code 2023 #AdventOfCode adventofcode.com/2023/day/5
#aoc #aoc23 #AdventOfCode2023 #aoc23_cpp

Flo πŸ‘¨πŸΌβ€πŸ’»flo1804@fosstodon.org
2023-12-05

I am starting with the #AdventOfCode puzzle for today. Today in #rustlang

#AOC #aoc2023 #aoc23

2023-12-04

Before I started #adventofcode this year, I did a "day 0" with a trivial exercise and an excuse to get my test harness and makefiles in order. That was a good decision.

I also decided to do AOC23 in awk, and I think I have relearned enough awk to understand why its best use is the one-liner and where it's increasingly horrible as the programs get bigger and more complex.

So a decision and a poll.

#awk #gawk #python #aoc #aoc23

2023-12-04

Nice to see many #cpp solutions to Advent of Code #aoc23. Seeing many solutions use actual files for input, and either cram lots of test cases into a single file, or use several input files, here's a possible improvement:

Create and reuse std::instringstream for all test data without creating actual files. Plus with this approach you can more easily use online IDEs like Compiler Explorer because no files. πŸ€“

Again just a tip. YMMV. Happy coding. #aoc2023

CE template: sigcpp.godbolt.org/z/TeTzrMcdc

Syntax-highlighted C++ code in a dark theme:

#include <iostream>

//general idea: alter to requirement
int f(std::istream& in)
{
    if (!in) //empty or erred stream
        return -1;

    char c;
    while (in.get(c)) {   //not EOF or error
        if (c == '\n') {  //end of line
            //
        }
        else  {
            //
        }
    }

    return 0; //account for last line if necessary
}Syntax-highlighted C++ code in a dark theme:

//test
#include <cassert> //remove if not using assert
#include <sstream>

int main()
{
    //test 1
    std::istringstream in(
        "line 1 of test 1\n"
        "line 2 of test 1\n"
        "last line of test 1"
    );
    assert(f(in) == 0); //or use another testing means

    //test 2: same as test 1 but Windows line ending
    in.clear();
    in.str(
        "line 1 of test 2\r\n"
        "line 2 of test 2\r\n"
        "last line of test 2"
    );
    assert(f(in) == 0);

    //test 3...n: other test cases

    //test n+1: empty input
    in.clear();
    assert(f(in) == 0);  
}

Client Info

Server: https://mastodon.social
Version: 2025.04
Repository: https://github.com/cyevgeniy/lmst