对于一个类,我必须用随机数填充一个数组,但现在我需要为玩家和计算机搜索对、三个同类、四个同类和五个同类,并根据匹配找到获胜者,我不知道该怎么办。这是我到目前为止所写的:
Dim random As New Random()
Dim playerrolls() As Integer = {0, 0, 0, 0, 0, 0}
Dim computerrolls() As Integer = {0, 0, 0, 0, 0, 0}
playerrolls(0) = player.Items.Add(random.Next(1, 7))
playerrolls(1) = player.Items.Add(random.Next(1, 7))
playerrolls(2) = player.Items.Add(random.Next(1, 7))
playerrolls(3) = player.Items.Add(random.Next(1, 7))
playerrolls(4) = player.Items.Add(random.Next(1, 7))
computerrolls(0) = computer.Items.Add(random.Next(1, 7))
computerrolls(1) = computer.Items.Add(random.Next(1, 7))
computerrolls(2) = computer.Items.Add(random.Next(1, 7))
computerrolls(3) = computer.Items.Add(random.Next(1, 7))
computerrolls(4) = computer.Items.Add(random.Next(1, 7))