创建随机团队? [英] creating random teams?

查看:71
本文介绍了创建随机团队?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嘿帮派。节日快乐和东西。


这是我想要做的事情,但需要一些指导,因为这可以从

开始正确的方向。


在ms服务器上使用sql db


i让玩家报名参加比赛。在比赛开始时,我想要它设置球队,这很简单。我在db

中有一个数字,表示团队中有多少人。 ivarnum =


现在,我需要脚本来计算注册的数量..简单


然后通过除以预设变量来设置那里有多少队

将是...


所以说21名球员注册了,而且ivarnum = 3,因此给了那个

将是7个团队。


现在我需要通过一个随机脚本分配,谁是在哪个团队,所以每个人都有3个/每个
团队。


i在数据库中有一个名为t_team的字段,这是一个整数,所以它会得到

分配一个数字1-7,那将是是比赛的团队。


所以如何在1到7之间分配这个随机数(在这种情况下)和

一旦选择3个有相同的数字,它不会再使用它了吗?


这对我想要的东西有意义吗?/


任何帮助将不胜感激。


Bam

解决方案



" ;杰夫" < gi ***** @ adelphia.netwrote in message

news:q7 ************************* *****@adelphia.com ...


het gang。节日快乐和东西。


这是我想要做的事情,但需要一些指导,因为这可以从

开始正确的方向。


在ms服务器上使用sql db


i让玩家报名参加比赛。在比赛开始时,我想要它设置球队,这很简单。我在db

中有一个数字,表示团队中有多少人。 ivarnum =


现在,我需要脚本来计算注册的数量..简单


然后通过除以预设变量来设置那里有多少队

将是...


所以说21名球员注册了,而且ivarnum = 3,因此给了那个

将是7个团队。


现在我需要通过一个随机脚本分配,谁是在哪个团队,所以每个人都有3个/每个
团队。


i在数据库中有一个名为t_team的字段,这是一个整数,所以它会得到

分配一个数字1-7,那将是是比赛的团队。


所以如何在1到7之间分配这个随机数(在这种情况下)和

一旦选择3个有相同的数字,它不会再使用它了吗?


这对我想要的东西有意义吗?/


任何帮助我将不胜感激。


Bam



我应该添加名称字段为t_username,在c中

需要的帮助


" Jeff" < gi ***** @ adelphia.netwrote in message

news:q7 ************************* *****@adelphia.com ...


het gang。节日快乐和东西。


这是我想要做的事情,但需要一些指导,因为这可以从

开始正确的方向。


在ms服务器上使用sql db


i让玩家报名参加比赛。在比赛开始时,我想要它设置球队,这很简单。我在db

中有一个数字,表示团队中有多少人。 ivarnum =


现在,我需要脚本来计算注册的数量..简单


然后通过除以预设变量来设置那里有多少队

将是...


所以说21名球员注册了,而且ivarnum = 3,因此给了那个

将是7个团队。


现在我需要通过一个随机脚本分配,谁是在哪个团队,所以每个人都有3个/每个
团队。


i在数据库中有一个名为t_team的字段,这是一个整数,所以它会得到

分配一个数字1-7,那将是是比赛的团队。


所以如何在1到7之间分配这个随机数(在这种情况下)和

一旦选择3个有相同的数字,它不会再使用它了吗?


这对我想要的东西有意义吗?/


任何帮助我们将不胜感激。


Bam



另一种选择可能是对玩家进行排序,比方说,

姓氏中的第二个字符,然后一次使用

三个团队。




" McKirahan" < Ne ** @ McKirahan.com写信息

新闻:5a **************************** **@comcast.com。 ..


" Jeff" < gi ***** @ adelphia.netwrote in message

news:q7 ************************* *****@adelphia.com ...


> het gang。节日快乐和东西。

这是我想要做的事情,但需要一些指导,以便在正确的方向开始

在ms服务器上使用sql db

我有玩家报名参加比赛。很容易

当比赛开始时,我希望它能够组建球队。我在
db
中有一个数字,告诉团队中有多少人。 ivarnum =
现在,我需要脚本来计算注册的数量..轻松

然后通过除以预设变量设置将告诉有多少团队
那里
将是......

所以说有21名玩家注册,而ivarnum = 3,因此那里将有7支球队。

现在我需要通过一个随机脚本分配,谁在哪个团队中,这样每个团队中就有3个人。

我在db中有一个名为t_team的字段,这是一个整数,所以它会被分配一个1-7的数字,这将是比赛的团队。

所以如何分配这个随机1到7之间的数字(在这种情况下)和
一旦3选择相同的数字,它不会再次使用它?

这是否理解我想要的? /

任何帮助将不胜感激。

Bam



另一种选择可能是对玩家进行排序,比如,

姓氏中的第二个字符,然后使用

一次三个团队。



现在这是一个想法。我也在考虑每次进入第3次进入,并且当它进入eof时再次获得
,然后再回到那些拥有0 / br
t_team 0的人那里。 >


het gang. Happy Holidays and stuff.

Here is what I am wanting to do, but need some guidance as hwo to start in
the right direction.

using sql db on ms server

i have players sign up for a tourney. easy

when the tourney begins, i want it to set teams. i have a number in the db
that tells how many on a team. ivarnum =

now, i need to script to count the number registered.. easy

then set by dividing by the preset variable will tell how many teams there
will be..

so say 21 players registered, and the ivarnum = 3, thus giving that there
will be 7 teams.

now i need to assign by a random script, who is on what team, so that 3
people are on each team.

i have a field in the db called t_team, this is an integer, so it will get
assigned a number 1-7, and that will be taht persons team for the tourney.

so how can i assign this random number between 1 and 7 (in this case) and
once 3 are choosen with the same number, it won''t use it again?

does this make sense of what i want?/

any help would be appreciated.

Bam

解决方案


"Jeff" <gi*****@adelphia.netwrote in message
news:q7******************************@adelphia.com ...

het gang. Happy Holidays and stuff.

Here is what I am wanting to do, but need some guidance as hwo to start in
the right direction.

using sql db on ms server

i have players sign up for a tourney. easy

when the tourney begins, i want it to set teams. i have a number in the db
that tells how many on a team. ivarnum =

now, i need to script to count the number registered.. easy

then set by dividing by the preset variable will tell how many teams there
will be..

so say 21 players registered, and the ivarnum = 3, thus giving that there
will be 7 teams.

now i need to assign by a random script, who is on what team, so that 3
people are on each team.

i have a field in the db called t_team, this is an integer, so it will get
assigned a number 1-7, and that will be taht persons team for the tourney.

so how can i assign this random number between 1 and 7 (in this case) and
once 3 are choosen with the same number, it won''t use it again?

does this make sense of what i want?/

any help would be appreciated.

Bam

I should add that the name field is t_username, in case that is needed in
the help


"Jeff" <gi*****@adelphia.netwrote in message
news:q7******************************@adelphia.com ...

het gang. Happy Holidays and stuff.

Here is what I am wanting to do, but need some guidance as hwo to start in
the right direction.

using sql db on ms server

i have players sign up for a tourney. easy

when the tourney begins, i want it to set teams. i have a number in the db
that tells how many on a team. ivarnum =

now, i need to script to count the number registered.. easy

then set by dividing by the preset variable will tell how many teams there
will be..

so say 21 players registered, and the ivarnum = 3, thus giving that there
will be 7 teams.

now i need to assign by a random script, who is on what team, so that 3
people are on each team.

i have a field in the db called t_team, this is an integer, so it will get
assigned a number 1-7, and that will be taht persons team for the tourney.

so how can i assign this random number between 1 and 7 (in this case) and
once 3 are choosen with the same number, it won''t use it again?

does this make sense of what i want?/

any help would be appreciated.

Bam

An alternative might be to sort the players by, say,
the second character in their last name and then use
three at a time to make a team.



"McKirahan" <Ne**@McKirahan.comwrote in message
news:5a******************************@comcast.com. ..

"Jeff" <gi*****@adelphia.netwrote in message
news:q7******************************@adelphia.com ...

>het gang. Happy Holidays and stuff.

Here is what I am wanting to do, but need some guidance as hwo to start
in
the right direction.

using sql db on ms server

i have players sign up for a tourney. easy

when the tourney begins, i want it to set teams. i have a number in the
db
that tells how many on a team. ivarnum =

now, i need to script to count the number registered.. easy

then set by dividing by the preset variable will tell how many teams
there
will be..

so say 21 players registered, and the ivarnum = 3, thus giving that there
will be 7 teams.

now i need to assign by a random script, who is on what team, so that 3
people are on each team.

i have a field in the db called t_team, this is an integer, so it will
get
assigned a number 1-7, and that will be taht persons team for the
tourney.

so how can i assign this random number between 1 and 7 (in this case) and
once 3 are choosen with the same number, it won''t use it again?

does this make sense of what i want?/

any help would be appreciated.

Bam


An alternative might be to sort the players by, say,
the second character in their last name and then use
three at a time to make a team.

now that''s a thought. I was also thinking about getting every 3rd entry, and
when it gets to eof, going back and doing it again with those who have a
t_team of 0


这篇关于创建随机团队?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆