Click here to Skip to main content
15,890,947 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: VB.net 2010 form positioning Pin
NotPolitcallyCorrect19-May-13 10:51
NotPolitcallyCorrect19-May-13 10:51 
AnswerRe: VB.net 2010 form positioning Pin
claudiotronic19-May-13 20:37
claudiotronic19-May-13 20:37 
Questionneed VBA code!!! Pin
ssrd217-May-13 0:05
ssrd217-May-13 0:05 
AnswerRe: need VBA code!!! Pin
Richard MacCutchan17-May-13 1:09
mveRichard MacCutchan17-May-13 1:09 
QuestionHow To Print the Contents of a datagridview Pin
Evord16-May-13 2:12
professionalEvord16-May-13 2:12 
AnswerRe: How To Print the Contents of a datagridview Pin
Richard MacCutchan16-May-13 2:59
mveRichard MacCutchan16-May-13 2:59 
AnswerRe: How To Print the Contents of a datagridview Pin
Eddy Vluggen16-May-13 3:01
professionalEddy Vluggen16-May-13 3:01 
QuestionFinding Duplicate numbers Pin
CowlitzTroy13-May-13 21:29
CowlitzTroy13-May-13 21:29 
My class is now over. I had an issue with the the assignment. I couldn't get the program to find and display the duplicate random numbers. I've looked for almost two weeks for an answer and I'm hoping that someone here can help me.

This was the assignment:
Present the following report – (you will modify this based on user input and the actual rolls.

Number of dice:2
Number of sides:6
Number of rolls:2
Dice 1 Roll 1 = 5
Dice 2 Roll 1 = 6
Dice 1 Roll 2 = 1
Dice 2 Roll 2 = 1
Number of rolls where all dice were the same: 1

I got everything but the number of rolls where all the dice were the same. Can someone please advise me as to how this should have been done?

Here is a snippet of what I did:
'Start the randomization process
Dim RandomClass As New Random() 'Our random number generator

Dim vRoll() As Integer 'User entered variable for the array
ReDim vRoll(nDice) 'dynamic number entered by the user

Dim cntDice As Integer = 0

Dim myArray As New List(Of Integer)
Dim temp As Integer

myArray.Clear()

'Get the number of rolls and the number of dice and then randomize the rolls.
For i As Integer = 1 To rRoll
   For j As Integer = 1 To nDice
      temp = RandomClass.Next(1, dSize + 1)
      LST_Items.Items.Add("Dice " & j & " Roll " & i & " = " & temp.ToString)
      If Not myArray.Contains(temp) Then
        cntDice += 1
        LBL_Same.Text = cntDice
      Else
        LBL_Same.Text = "0"
      End If
  Next
Next

So if anyone is willing to give me advice I would greatly appreciate it.

Thanks!
Troy E Bouchard

AnswerRe: Finding Duplicate numbers Pin
Dave Kreskowiak14-May-13 4:38
mveDave Kreskowiak14-May-13 4:38 
AnswerRe: Finding Duplicate numbers Pin
MicroVirus17-May-13 1:39
MicroVirus17-May-13 1:39 
GeneralRe: Finding Duplicate numbers Pin
Dave Kreskowiak17-May-13 2:19
mveDave Kreskowiak17-May-13 2:19 
QuestionLists of objects without losing class Intelli-sense Pin
Purge1t13-May-13 18:24
Purge1t13-May-13 18:24 
AnswerRe: Lists of objects without losing class Intelli-sense Pin
Dave Kreskowiak13-May-13 18:51
mveDave Kreskowiak13-May-13 18:51 
GeneralRe: Lists of objects without losing class Intelli-sense Pin
Purge1t13-May-13 19:21
Purge1t13-May-13 19:21 
GeneralRe: Lists of objects without losing class Intelli-sense Pin
Dave Kreskowiak14-May-13 3:44
mveDave Kreskowiak14-May-13 3:44 
GeneralRe: Lists of objects without losing class Intelli-sense Pin
Purge1t14-May-13 11:55
Purge1t14-May-13 11:55 
GeneralRe: Lists of objects without losing class Intelli-sense Pin
Dave Kreskowiak14-May-13 13:33
mveDave Kreskowiak14-May-13 13:33 
QuestionTryParse String from InputBox to Integer Pin
Member 1004983713-May-13 16:06
Member 1004983713-May-13 16:06 
AnswerRe: TryParse String from InputBox to Integer Pin
PIEBALDconsult13-May-13 17:30
mvePIEBALDconsult13-May-13 17:30 
QuestionHow to get values from listview and display it to textbox using sql database ? Pin
Member 1001708312-May-13 4:58
professionalMember 1001708312-May-13 4:58 
AnswerRe: How to get values from listview and display it to textbox using sql database ? Pin
Eddy Vluggen13-May-13 7:23
professionalEddy Vluggen13-May-13 7:23 
QuestionTreeView Find Starting from Some Child Node Pin
treddie11-May-13 21:20
treddie11-May-13 21:20 
AnswerRe: TreeView Find Starting from Some Child Node Pin
Eddy Vluggen11-May-13 22:18
professionalEddy Vluggen11-May-13 22:18 
GeneralRe: TreeView Find Starting from Some Child Node Pin
treddie11-May-13 23:50
treddie11-May-13 23:50 
GeneralRe: TreeView Find Starting from Some Child Node Pin
Eddy Vluggen12-May-13 1:16
professionalEddy Vluggen12-May-13 1:16 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.