随机抽签绘制功能 [英] random lottery draw funciton
问题描述
我已经用PHP编写了一个抽奖项目,每周选出10名获奖者
来自大约18,000股。
我遇到的问题是,一周内有十位获奖者同一份额
号码是在下周绘制的,相邻的份额是
下周(恰好是由同一个成员拥有)
该程序现在被怀疑地看待。
随机的主要核心draw简单地将所有当前的份额
数字放入一个数组($ currWinner)中,使用
rand函数在1和股数之间绘制一个随机数($ lottshares )和
返回分享ID号。
我所用程序的随机元素:
$ currWinner = rand(1,$ lottShares);
这个随机吗?或者它是否可能需要播种(虽然
我不完全理解播种?
任何帮助都将受到赞赏。
谢谢
凯文
Hi,
I''ve written a lottery programme in PHP that selects 10 winners a week
from approximately 18,000 shares.
The problem I have is that of the ten winners one week the same share
number was drawn the next week and an adjacent share number the
following week (that just happened to be owned by the same member)
The program is now being looked at suspisciously.
The main core of the random draw simply puts all the current share
numbers into an array ($currWinner), draws a random number using the
rand function between 1 and the number of shares ($lottshares) and
returns the share id number.
for the random element ofthe program I use:
$currWinner = rand(1,$lottShares);
is this random enough? or is it possible that it needs seeding (although
I don''t totally understand seeding?
Any help will be appreciated.
thanks
Kevin
推荐答案
currWinner),使用
$ b $绘制一个随机数b rand函数在1和股数之间(
currWinner), draws a random number using the
rand function between 1 and the number of shares (
lottshares)和
返回股票ID号。
我所用程序的随机元素:
lottshares) and
returns the share id number.
for the random element ofthe program I use:
currWinner = rand(1,
currWinner = rand(1,
这篇关于随机抽签绘制功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!