To expand a bit further the `rand` procedure updates the global random state 
object. If you still want a random in this case you can use the 
[initRand](https://nim-lang.org/docs/random.html#initRand%2Cint64) to create 
your own random state object and then pass that to `rand` like so: 
[https://play.nim-lang.org/#ix=27DN](https://play.nim-lang.org/#ix=27DN).

Furthermore, like miran pointed out `func` ensures that your procedure can't 
have side-effects. If you want what is (erroneously) called a `function` in 
most other languages you can use `proc`.

Reply via email to