aichaos / rivescript-go

A RiveScript interpreter for Go. RiveScript is a scripting language for chatterbots.
https://www.rivescript.com/
MIT License
60 stars 16 forks source link

random select incorrect #21

Closed pepelazz closed 7 years ago

pepelazz commented 7 years ago

i don't know how correct push PR but in file brain.go need add random seed from time now

image

kirsle commented 7 years ago

Good catch. I'm used to other programming languages that automatically seed the random number generator in such a way that the programmer doesn't need to seed it manually (cuz they'd in all likelihood pick a less random seed than the default anyway).

I should probably instance my own random number generator from rand.New() so as not to potentially re-seed the global one and step on a programmer's toes.