1
嗨大家 我需要更改动作脚本中输出的随机数字。 你会看到我得到5个不同位置的5个随机数字,但它限制了每个位置的数量。我可以在动作脚本中更改我的随机数字
_loc_2 = Math.floor(Math.random() * 4) + 1;
Cone.text = "" + _loc_2;
_loc_3 = Math.floor(Math.random() * 4) + 5;
Ctwo.text = "" + _loc_3;
_loc_4 = Math.floor(Math.random() * 2) + 9;
Cthree.text = "" + _loc_4;
_loc_5 = Math.floor(Math.random() * 2) + 11;
Cfour.text = "" + _loc_5;
_loc_6 = Math.floor(Math.random() * 3) + 13;
Cfive.text = "" + _loc_6;
我需要将其更改此随机1到15,但不必产生重复号码,
_loc_2 = Math.floor(Math.random() * 15) + 1;
Cone.text = "" + _loc_2;
_loc_3 = Math.floor(Math.random() * 15) + 1;
Ctwo.text = "" + _loc_3;
_loc_4 = Math.floor(Math.random() * 15) + 1;
Cthree.text = "" + _loc_4;
_loc_5 = Math.floor(Math.random() * 15) + 1;
Cfour.text = "" + _loc_5;
_loc_6 = Math.floor(Math.random() * 15) + 1;
Cfive.text = "" + _loc_6;
可这个动作脚本来完成?
在此先感谢 戴夫
好吧我会尝试,看起来很有希望 – DaveOh 2011-05-23 20:27:48
并感谢您的快速回复 – DaveOh 2011-05-23 20:28:45