[Community Puzzle] CGFunge Prime

Nice! That’s very interesting.

My solution is also fully deterministic and passes 100% of the test cases. I also rely on two different mathematical operations.

What really caught my attention is the probabilistic angle you mentioned - I’m genuinely curious: how would you even introduce randomness into this puzzle in a meaningful way?

@bamilan

1 Like

@Zylo

With some probability (lets say 2%) output a solution that just prints “prime”, otherwise (in the remaining 98%) print your standard solution.

1 Like

Thanks, but I have to confirm to you that I’m definitely not doing better math than you or @bamilan in this puzzle, I only use comparisons in my solution. I’m genuinely curious about what you’ve done to get a 3.9K solution with 100%:thinking:

So yes, there is something I know that you don’t, yet :sweat_smile: (the 3rd step I named long ago)

And the reverse is true. I may try to come up with some of those automated searches of solutions in the future, I have some simple optimization codes but mostly to find local improvements with specific calculations, and in my 100% solution I only had place for 1 of those math tricks that would improve my solution, but that was still at 4616 steps with 100%…

There is some “art” to optimizing luck too but it’s also a totally different game, in theory you could get the absolute minimum by randomly printing either option, but that’s impossible in practice. In my case, I was once close to getting less than 2.4K (I think), but I stopped trying long ago…

1 Like

Once upon a time, I was first on this puzzle …. it seems so far away :grinning_face_with_smiling_eyes:

Still have no idea about how you can do that.