TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
C M
NA
1
1.5k
Using Random function with "do...until" in VB.NET
Nov 22 2012 4:32 AM
I have to write a small program which will roll 2 dice until both display a 1. Both numbers rolled each time must also be displayed in a list box.
I have this so far:
lboDiceRolls.Items.Clear()
Dim iDice1 As Integer
Dim iDice2 As Integer
Randomize()
Do Until iDice1 = 1 And iDice2 = 1
iDice1 = (Rnd() * 5) + 1
iDice2 = (Rnd() * 5) + 1
lboDiceRolls.Items.Add(iDice1 & iDice2)
Loop
End Sub
It isn't displaying anything, and I have tried many different versions of the above statement using different combinations of things. I know I'm probably missing something really dumb, but I'm very new to using VB so I'm not sure if I'm on the right track.
Reply
Answers (
0
)
READ THE TEXT FILE IN CONSOLE APPLICATION AND LOAD INTO SQL TABLE
Transferring from listview to datagridview