VB练习之-双色球模拟
模拟双色球算法,随机+开奖+兑奖功能(由于开奖规则较多,只模拟了巨奖...)
感兴趣的小伙伴可以在源码基础上进一步完善和优化!
双色球开奖模拟软件.zip
(621.86 KB)
Sub Shuffle(ByRef a) Dim t, j, n n = UBound(a): Randomize For i = n To 1 Step -1 j = Int(Rnd * (i + 1)) t = a(j): a(j) = a(i): a(i) = t Next End Sub Private Sub Form_Load() Me.Hide 'Author: Demon 'Website: http://demon.tw 'Date: 2011/12/16 a = Array("卒", "卒", "卒", "卒", "卒", "炮", "炮", "马", "马", "车", "车", "士", "士", "象", "象") MsgBox Join(a) '洗牌前 Shuffle a MsgBox Join(a) '洗牌后 End Sub