【发布时间】:2012-04-13 00:08:11
【问题描述】:
我的问题是我希望我的程序在 0 到 3 之间的数字范围内做出四个唯一的随机选择程序将是这样的,以使其清楚
my range
0 1 2 3 randomly chosen number 3
0 1 2 randomly chosen number 1
0 2 randomly chosen number 2
0 it will choose 0 and then the program closes
【问题讨论】:
-
请出示你写的代码。
-
您正在从一组 4 个数字中选择 4 个随机数字(无需替换)?你真正想要达到什么目的?你只是想随机化数字 0-3 的顺序吗?
-
它实际上是一个函数而不是整个程序,如果我从数组中选择一个元素,它不会再次选择它,而不是试图随机化我想要的
标签: java random probability