From the course: Visual Basic Essential Training
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Challenge: Marble draw with lists - Visual Basic Tutorial
From the course: Visual Basic Essential Training
Challenge: Marble draw with lists
(upbeat tempo) - For this challenge, you'll code a classic probability problem. It's the drawing marble contest. On the table are two empty buckets. One painted red and the other painted blue. In the center of the table is a large golden bucket that contains 50 red marbles, 50 blue marbles, and one gold marble. The contestant draws out one marble at a time, and places it in its matching colored bucket. The contest is over when the gold marble is drawn. The later the gold marble is drawn, the better the prize. I've already stubbed in some code for you. I've got this UI here, which has three columns. Blue, red, and farthest. So this would represent the blue bucket, the red bucket, and this represents how far you got before you drew the gold marble. And then over here we have the average. The way this would work, it would look like this. The first time you run it, you draw four blue marbles and five red marbles.…
Contents
-
-
-
-
-
-
-
-
-
-
-
-
-
-
(Locked)
Explore the collection classes5m 44s
-
(Locked)
Create new collections4m 49s
-
(Locked)
Add, remove, and interact with items from list8m 37s
-
(Locked)
Iterate over list5m 39s
-
(Locked)
Interesting list properties4m 42s
-
(Locked)
Work with extension methods2m 40s
-
(Locked)
Use LINQ with lists5m 14s
-
(Locked)
Quick look at other collection classes2m 19s
-
(Locked)
Challenge: Marble draw with lists3m 32s
-
(Locked)
Solution: Marble draw with lists4m 41s
-
(Locked)
-
-