Re: [.NET] 撲克牌發牌~

看板Visual_Basic作者 (怎麼那樣滴麻煩阿~@@")時間19年前 (2006/05/15 02:30), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串3/4 (看更多)
我現在可以發出52張牌了 但是要怎樣發成四份阿?? 還有排序 發成四份我的想法 是 讓他跑0-12一次 13-25依序 這樣的想法可以嗎!? Sub pp(ByVal sender As Object, ByVal e As EventArgs) Dim a, i, j, k As Integer Dim take(51) As Integer Dim c(51) As Object Dim f(51) As Object Randomize() Label1.Text = "" For i = 0 To 51 For j = 0 To i Do While a = take(j) a = Int(Rnd() * 52) + 1 j = 0 Loop Next take(i) = a c(i) = (a Mod 4) f(i) = (a \ 4 + 1) If c(i) = 0 Then Label1.Text &= f(i) & "黑桃" ElseIf c(i) = 1 Then Label1.Text &= f(i) & "紅心" ElseIf c(i) = 2 Then Label1.Text &= f(i) & "方塊" ElseIf c(i) = 3 Then Label1.Text &= f(i) & "梅花" End If Next End Sub -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 61.219.98.180
文章代碼(AID): #14PtT5u2 (Visual_Basic)
文章代碼(AID): #14PtT5u2 (Visual_Basic)