What is the difference between RandomNumberGenerator and normal random methods?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By MaaaxiKing

Why should I use RandomNumberGenerator instead of randi() or randf() etc.?

:bust_in_silhouette: Reply From: Calinou

Both the procedural (global scope) and object-oriented (RandomNumberGenerator) approaches work the same way. That said, RandomNumberGenerator lets you use different seeds for different instances, therefore giving you more control over determinism (or lack thereof).

There is no “better” approach, but if you don’t care about being able to use different random seeds at the same time in your project, the procedural (global scope) approach will require less code to get things done.