Visual Basic 中学校 掲示板 投稿の管理
タグのない投稿を抽出
統計
RSS
Visual Basic 中学校
投稿一覧
オリジナルゲーム
この投稿へのリンク
https://keijiban.umayadia.com/ThreadDetail.aspx?ThreadId=15547#CommentId42933
この投稿の削除
削除パスワード
削除する
コメント本文
投稿者
腐女子
 (中学生)
投稿日時
2014/3/27 10:38:38
調べながら作ったソース↓
Public Class Form1
Dim strPic(51) As String
Dim work(51) As Integer
Dim hRandom As New System.Random()
Dim intResult As Integer
Private Sub Form1_Load(sender As Object, e As System.EventArgs) Handles Me.Load
'クローバー
strPic(0) = "c01.gif"
strPic(1) = "c02.gif"
strPic(2) = "c03.gif"
strPic(3) = "c04.gif"
strPic(4) = "c05.gif"
strPic(5) = "c06.gif"
strPic(6) = "c07.gif"
strPic(7) = "c08.gif"
strPic(8) = "c09.gif"
strPic(9) = "c10.gif"
strPic(10) = "c11.gif"
strPic(11) = "c12.gif"
strPic(12) = "c13.gif"
'ダイヤ
strPic(13) = "d01.gif"
strPic(14) = "d02.gif"
strPic(15) = "d03.gif"
strPic(16) = "d04.gif"
strPic(17) = "d05.gif"
strPic(18) = "d06.gif"
strPic(19) = "d07.gif"
strPic(20) = "d08.gif"
strPic(21) = "d09.gif"
strPic(22) = "d10.gif"
strPic(23) = "d11.gif"
strPic(24) = "d12.gif"
strPic(25) = "d13.gif"
'ハート
strPic(26) = "h01.gif"
strPic(27) = "h02.gif"
strPic(28) = "h03.gif"
strPic(29) = "h04.gif"
strPic(30) = "h05.gif"
strPic(31) = "h06.gif"
strPic(32) = "h07.gif"
strPic(33) = "h08.gif"
strPic(34) = "h09.gif"
strPic(35) = "h10.gif"
strPic(36) = "h11.gif"
strPic(37) = "h12.gif"
strPic(38) = "h13.gif"
'スペード
strPic(39) = "s01.gif"
strPic(40) = "s02.gif"
strPic(41) = "s03.gif"
strPic(42) = "s04.gif"
strPic(43) = "s05.gif"
strPic(44) = "s06.gif"
strPic(45) = "s07.gif"
strPic(46) = "s08.gif"
strPic(47) = "s09.gif"
strPic(48) = "s10.gif"
strPic(49) = "s11.gif"
strPic(50) = "s12.gif"
strPic(51) = "s13.gif"
End Sub
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
Dim i As Integer, myNum As Integer
Dim myFlag(51) As Boolean
For i = 0 To 51
Do
Randomize()
myNum = Int(Rnd() * 52)
Loop Until myFlag(myNum) = False
work(i) = myNum
myFlag(myNum) = True
Next
PictureBox1.Image = Image.FromFile(strPic(work(0)))
PictureBox2.Image = Image.FromFile(strPic(work(1)))
PictureBox3.Image = Image.FromFile(strPic(work(2)))
PictureBox4.Image = Image.FromFile(strPic(work(3)))
PictureBox5.Image = Image.FromFile(strPic(work(4)))
End Sub
End Class