重庆分公司,新征程启航

为企业提供网站建设、域名注册、服务器等服务

vb.net双色球 vb模拟双色球投注

怎么样用VB编写双色球随机开奖号

定义一个数组用来存放抽来的号码.

目前创新互联已为近千家的企业提供了网站建设、域名、网络空间、网站改版维护、企业网站设计、改则网站维护等服务,公司将坚持客户导向、应用为本的策略,正道将秉承"和谐、参与、激情"的文化,与客户和合作伙伴齐心协力一起成长,共同发展。

用RND来产生 红球之间的随机数,如果数组中已经\存在这个号码则再次RND,只到抽完红球号码.

用同样的方法抽蓝球.

将红球排序并用+号连接蓝球

输出结果

用vb 做个双色球摇奖工具

Private Sub Command1_Click()

Randomize

Cls

Dim a

a = GetRndNotRepeat(1, 33, 6)

Print "红球";

For i = 0 To UBound(a)

Print a(i);

Next

Print " 蓝球"; Int(Rnd * (17) + 1)

End Sub

Public Function GetRndNotRepeat(ByVal NumMin As Integer, ByVal NumMax As Integer, ByVal n As Integer)

If n NumMax - NumMin + 1 Then Exit Function

Dim arr()

ReDim arr(n - 1)

Dim b() As Boolean

ReDim b(NumMax - NumMin)

Dim x As Integer, y As Integer

Randomize

For i = 0 To n - 1

Do

x = Int(Rnd * (NumMax - NumMin + 1)) + NumMin

y = x - NumMin

Loop While b(y)

b(y) = True

arr(i) = x

Next i

GetRndNotRepeat = arr

End Function

用VB编写双色球程序,具体要求请看详细。。。

我自己写过一个。也就是选数啦。红球注意不要重复就行了。用随机函数生成。如果想一个个地出的话得用TIMER。最后排一个序就成了。

你可以用个数组来装你选定的这二十个红球。然后随机下标来选。一样的道理。

你的要求就是从指定的二十个红球中随机六个,从指定的七个蓝球中随机一个。并加上动画效果。原理一样是随机数组下标选数,但结果输出动画实现麻烦。

用VB编写双色球程序,要求是以指定数字为尾的数字中随机选择该怎么编写程序

建立两个Command1和2

Dim RedBalls, BullBalls

Private Sub Command1_Click()

'Label1.Caption = ""

rarr = GetRndNotRepeat(0, UBound(RedBalls), 6)

barr = GetRndNotRepeat(0, UBound(BullBalls), 1)

For i = 1 To 6

t = Now

Do

DoEvents

Loop While DateDiff("s", t, Now) 1.5

FillStyle = 0

FillColor = vbRed

Form1.Circle (500 + i * 500, 1000), 200, vbRed

CurrentX = 350 + i * 500

CurrentY = 840

Print Format(RedBalls(rarr(i)), "00")

Next i

t = Now

Do

DoEvents

Loop While DateDiff("s", t, Now) 2

i = 7

FillStyle = 0

FillColor = vbBlue

Form1.Circle (500 + i * 500, 1000), 200, vbBlue

CurrentX = 350 + i * 500

CurrentY = 840

Print Format(BullBalls(barr(1)), "00")

End Sub

Private Sub Command2_Click()

End

End Sub

Private Sub Form_Load()

RedBalls = Array(2, 3, 4, 7, 8, 9, 12, 13, 14, 17, 18, 19, 22, 23, 24, 27, 28, 29, 32, 33)

BullBalls = Array(3, 4, 5, 9, 13, 14, 15)

'Label1.Caption = ""

Command1.Caption = "开始"

Command2.Caption = "退出"

Form1.FontSize = 15

Form1.FontName = "Arial"

Form1.ForeColor = HFFFFFF

End Sub

Public Function GetRndNotRepeat(ByVal NumMin As Integer, ByVal NumMax As Integer, ByVal n As Integer)

Dim arr() As Integer

If n NumMax - NumMin + 1 Then

ReDim arr(0)

arr(0) = 0

Else

ReDim arr(n)

Dim b() As Byte

Dim m As Integer

m = Int((NumMax - NumMin) / 8)

ReDim b(m)

Dim x As Integer, y As Integer

Dim z As Byte

Randomize

arr(0) = 1

For i = 1 To n

Do

x = Int(Rnd * (NumMax - NumMin + 1)) + NumMin

y = x - NumMin

z = 2 ^ (y Mod 8)

y = y \ 8

Loop While b(y) And z

b(y) = b(y) Or z

arr(i) = x

Next i

End If

GetRndNotRepeat = arr

End Function

已经运行过。

vb编写彩票选号器的问题,请高手进来

Private Sub Command1_Click()

Dim i, a(34), b(7)

Randomize: Cls

For i = 1 To 7

b(i) = Int(Rnd * 34 + 1)

If a(b(i)) Then i = i - 1 Else a(b(i)) = 1

Next

Print "34 选 7组 福利彩票系统,中奖号码:"

For i = 1 To 7

Print b(i)

Next

End Sub

请不要发违规广告,是违法行为


网页题目:vb.net双色球 vb模拟双色球投注
转载来源:http://cqcxhl.com/article/dodhehd.html

其他资讯

在线咨询
服务热线
服务热线:028-86922220
TOP