tomtheisen / stax

Stax Golfing Language
Other
41 stars 2 forks source link

Random function #35

Closed razetime closed 3 years ago

razetime commented 3 years ago

Stax really needs a random number generating function.

tomtheisen commented 3 years ago

I don't really like non-determinism in golfing. Probabilistic solutions always have the chance of not working. And if you only need a chance of working, then you could use a language that has no instructions and just produces random output, for zero program size every time.

On the other hand, some golf challenges explicitly require "random" output. I don't really like those, since there seems (to me) to invite philosophical debates on the nature of randomness, which doesn't interest me.

On the other hand, maybe I missed something. What do you want to use it for?

razetime commented 3 years ago

I just found a few challenges where generating random numbers/ doing certain things with probability x was a thing. I don't mind if it's not there, however. There's a lot of challenges out there. Just would be convenient to have a random function.

razetime commented 3 years ago

Deterministic "random" function added in https://github.com/tomtheisen/stax/commit/ed08cb8dbbc0b9bd9aa02a47a0cee4b43bde3688.