ChooseIndex returns a randomly chosen, valid index from the standard slice.
(rand *rand.Rand)
| 282 | |
| 283 | // ChooseIndex returns a randomly chosen, valid index from the standard slice. |
| 284 | func (l *TList) ChooseIndex(rand *rand.Rand) int { |
| 285 | if len(l.std) == 0 { |
| 286 | return -1 |
| 287 | } |
| 288 | return rand.Intn(len(l.std)) |
| 289 | } |
| 290 | |
| 291 | // ChooseSliceIndices returns randomly chosen, valid indices for slicing. |
| 292 | func (l *TList) ChooseSliceIndices(rand *rand.Rand) (start, end int) { |