以下代码实现了随机抽3、4、5、6再随机抽1、2不重复。只是希望改善一下。就是1和2改为不随机抽的了,先抽2,再抽1的。求高手帮忙。请发:262826027@qq.com
function mc()
{
if (i < 4)
{
while (nobody1[jv] == undefined)
{
jv = random(4);
} // end while
_root.abc.text = nobody1[jv];
nobody1[jv] = undefined;
jv = -1;
}
else if (i < 6)
{
while (nobody2[jv] == undefined)
{
jv = random(2);
} // end while
_root.abc.text = nobody2[jv];
nobody2[jv] = undefined;
jv = -1;
}
else
{
_root.abc.text = "结束";
} // end else if
++i;
} // End of the function
stop ();
var nobody1 = ["03", "04", "05", "06"];
var nobody2 = ["01", "02"];
i = 0;
求 Flash 抽号代码,希望以下代码能修改到符合要求的。
答案:1 悬赏:30 手机版
解决时间 2021-02-15 16:08
- 提问者网友:人傍凄凉立暮秋
- 2021-02-14 22:03
最佳答案
- 五星知识达人网友:轻熟杀无赦
- 2021-02-14 23:07
stop();
var nobody1:Array = ["03", "04", "05", "06"];
var nobody2:Array = ["02", "01"];
i2 = 0;
i = 0;
function mc() {
if (i<4) {
while (nobody1[jv] == undefined) {
jv = random(4);
}
_root.abc.text = nobody1[jv];
nobody1[jv] = undefined;
jv = -1;
} else if (i<6 and i2<2) {
_root.abc.text = nobody2[i2];
i2++;
} else {
_root.abc.text = "结束";
}
i++;
}
var nobody1:Array = ["03", "04", "05", "06"];
var nobody2:Array = ["02", "01"];
i2 = 0;
i = 0;
function mc() {
if (i<4) {
while (nobody1[jv] == undefined) {
jv = random(4);
}
_root.abc.text = nobody1[jv];
nobody1[jv] = undefined;
jv = -1;
} else if (i<6 and i2<2) {
_root.abc.text = nobody2[i2];
i2++;
} else {
_root.abc.text = "结束";
}
i++;
}
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯