Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Public Class Form1
- Dim items(39) As Integer
- Dim g1 As New List(Of Giocatore)
- Dim g2 As New List(Of Giocatore)
- Dim rnd As New Random
- Private Sub RandomizeArray(ByVal items() As Integer)
- For i As Integer = 0 To items.Length - 1
- Dim j As Integer = rnd.Next(0, items.Length - 1)
- Dim c As Integer = items(i)
- items(i) = items(j)
- items(j) = c
- Next
- End Sub
- Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
- ' Make the items array.
- For i As Integer = 0 To items.Length - 1
- items(i) = i
- Next i
- RandomizeArray(items)
- distribuisci()
- For i As Integer = 0 To 9
- g1(i).CaricaImmagine(items(i)) ' here i load the picture with a card image
- g2(i).CaricaImmagine(items(i + 10))' here too
- Next
- End Sub
- public sub distribuisci()
- g1.Add(New Giocatore(items(0), PictureBox1))
- g1.Add(New Giocatore(items(1), PictureBox2))
- g1.Add(New Giocatore(items(2), PictureBox3))
- g1.Add(New Giocatore(items(3), PictureBox4))
- g1.Add(New Giocatore(items(4), PictureBox5))
- g1.Add(New Giocatore(items(5), PictureBox6))
- g1.Add(New Giocatore(items(6), PictureBox7))
- g1.Add(New Giocatore(items(7), PictureBox8))
- g1.Add(New Giocatore(items(8), PictureBox9))
- g1.Add(New Giocatore(items(9), PictureBox10))
- '---------------------
- g2.Add(New Giocatore(items(10), PictureBox11))
- g2.Add(New Giocatore(items(11), PictureBox12))
- g2.Add(New Giocatore(items(12), PictureBox13))
- g2.Add(New Giocatore(items(13), PictureBox14))
- g2.Add(New Giocatore(items(14), PictureBox15))
- g2.Add(New Giocatore(items(15), PictureBox16))
- g2.Add(New Giocatore(items(16), PictureBox17))
- g2.Add(New Giocatore(items(17), PictureBox18))
- g2.Add(New Giocatore(items(18), PictureBox19))
- g2.Add(New Giocatore(items(19), PictureBox20))
- end sub
- end class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement