2022 in python #4
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "2022-python"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Denna PR löser pussel från 2022 som uppvärmning för AOC2025. Ursprungliga pusslen gav 19 stjärnor med Elixir.
4ce2c59104toc24d74892a68b10a3a73to4dfb12e246Pt 1 was just head and tail. For pt 2 I rewrote the code to instead build the rope (snake) from head to tail by always moving the head first and traverse the body of the snake. Yes, I think of it as a body of a snake - not knots on a rope. Child hood memories are to damn colorful :) For reference, this is my visually debugging code: def dbg(seen, snake): print(snake) for r in range(-4, 1): print("".join([v(r, c, snake) for c in range(0, 7)])) print("") def v(r, c, snake): if (r,c) == snake[0]: return "H" for i, n in enumerate(snake[1:-1], start=1): if (r,c) == n: return str(i) if (r,c) == snake[-1]: return "T" if (r,c) == (0,0): return "s" return "."abc28306b3tof610c96257a8cf7bf5e7to92df810943View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.