Daniellyu / go-tour

Automatically exported from code.google.com/p/go-tour
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

random number is always 1 for me. Without knowing anything about go, I'd have kinda expected some... #148

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
https://feedback.corp.google.com/#/Report/1128291826

Description:
random number is always 1 for me. Without knowing anything about go, I'd have 
kinda expected something between 1 and 10?

UI language: en
Detected language: en

Original issue reported on code.google.com by feedback...@gmail.com on 16 Aug 2013 at 12:43

GoogleCodeExporter commented 8 years ago
I think the playground has been updated to include an explanation for this 
behavior:

http://tour.golang.org/#4
"Note: the environment in which these programs are executed is deterministic, 
so rand.Intn will always return the same number.

(To see a different number, seed the number generator; see rand.Seed.)"

Original comment by fresh.gr...@gmail.com on 4 Jul 2014 at 6:25

GoogleCodeExporter commented 8 years ago

Original comment by a...@golang.org on 6 Jul 2014 at 9:01