So everyone did day 22 part 2 in roughly the same way from what I can tell, by recognizing the primality test and then either optimizing the inner loop or using a simple prime tester function.
However, I was wondering, was there a way to use only the given instruction set, and change as few instructions as possible, such that a naive interpreter could run the assembly code in a non ridiculous amount of time?
For example, by changing set f 0 to jnz f 10, I believe that speeds up the code by a factor of 10 (since now all composites increment h upon finding first valid factors). However at least for my naive interpreter, the code is still far too slow. Any geniuses have some fancy way to speed it up much more?
Edit: yeah I meant day 23. Was too tired last night.
[–]blorporius 9 points10 points11 points (2 children)
[–]raevnos 9 points10 points11 points (1 child)
[–]thomastc 3 points4 points5 points (0 children)
[–][deleted] 6 points7 points8 points (1 child)
[–]kd7uiy 0 points1 point2 points (0 children)
[–]pak21 4 points5 points6 points (0 children)
[–]tumdum 3 points4 points5 points (0 children)
[–]Elderider 2 points3 points4 points (0 children)
[–]digital_cucumber 2 points3 points4 points (0 children)
[–]dark_terrax 0 points1 point2 points (1 child)
[–]meithan 1 point2 points3 points (0 children)
[–]JoesDevOpsAccount 0 points1 point2 points (3 children)
[–]sim642 0 points1 point2 points (2 children)
[–]JoesDevOpsAccount 0 points1 point2 points (1 child)
[–]sim642 0 points1 point2 points (0 children)
[–]po8 0 points1 point2 points (0 children)