First of all, forgive my ignorance if this is my fault and I can't see it.
I'm trying to solve the advent of code with janet and on day 7 my code passes the example input but if I use the full input I get a different result every time.
Janet version: Janet 1.32.1-a0cb7514 mingw/x64/gcc - compiled from master a few days ago with msys2.
First of all, forgive my ignorance if this is my fault and I can't see it.
I'm trying to solve the advent of code with janet and on day 7 my code passes the example input but if I use the full input I get a different result every time.
Janet version: Janet 1.32.1-a0cb7514 mingw/x64/gcc - compiled from master a few days ago with msys2.
Here is my code, criticism is very welcome:
I run it with a file as argument:
But if I use the full input every time it's different:
I didn't know how to get a minimally reproducible example so I pasted my solution to this puzzle.
Edit
I'm dumb, my swapping loop wasn't ordering the full array, also my solution is somehow wrong.