goostengine / goost

A general-purpose, extensible and customizable C++ extension for Godot Engine.
https://goostengine.github.io/
MIT License
481 stars 18 forks source link

adding Random.choices() #178

Closed rusty-tendrils closed 2 years ago

rusty-tendrils commented 2 years ago

One of the features approved in https://github.com/goostengine/goost/issues/7

rusty-tendrils commented 2 years ago

Is returning an Array (instead of a String) a good idea when the input is a String ? I cannot imagine what it could be used for in the context of games.

Xrayez commented 2 years ago

Well, I think String may not be used as often and it's probably specific, but it's a sequence type so better to have support for it. See "Completeness" development philosophy in Goost.

Therefore, having the method return an Array is better in terms of auto-completion and documentation for common cases. Besides, this is what Python does as well it seems:

image

Xrayez commented 2 years ago

Thanks and congrats for your first contribution!

rusty-tendrils commented 2 years ago

Thanks, I learnt a lot.

filipworksdev commented 2 years ago

Nice! I like the cummulative bool approach. I'm still here just migrated all my data to a brand new account (with the same name) :)