This time it was quite easy!
I made a boolean array for at which position a light ray is and the first line gave me my “starting position”
The learn ada website had the exact example I needed to get all instances of “^” See: Standard library: Strings - learn.adacore.com
For each output position I check if in that column has a beam and changed it accordingly.
And I really like this line in part2. Told it to a friend without context.
(Still have to do part 2 tho…)
Apply the many-worlds interpretation of quantum tachyon splitting to your manifold diagram.
2 Likes
Very cool and simple solution!
I overthought part 1 and used dfs but it’s clearly not the right way to do this.
1 Like
Today was fun! At first I thought it would be breadth-first search, so I overengineered both parts to use sets, vectors, etc.; i.e., I was tracking paths in some detail I hit a combinatorial explosion in Part 2 and crashed my computer (ssd started thrashing (?) because I hit too many timelines: my answer is greater than 10^15!!!
) so I worked through the example by hand a couple of times until I eventually hit upon the same solution as @wutka.
2 Likes
Quick update: porting the solution to HAC, which lacks Ada’s containers, forced me to re-think my answer to Part 1. The resulting algorithm is much cleaner.
1 Like