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.

Solution: Marble draw with lists

Solution: Marble draw with lists - Visual Basic Tutorial

From the course: Visual Basic Essential Training

Start my 1-month free trial

Solution: Marble draw with lists

(upbeat music) - [Narrator] Welcome back. How did you make out with that last challenge? I hope you had some success. I'd like to go over my solution. Please remember it might be different than yours. So here's the UI. We want to draw some items out of the golden bucket. So the first time we play the game, we got 23 blue marbles, 29 red marbles. We pulled the golden marble out at position number 53. And the current average is 53. The next time I draw, I use the insert way of adding items to list box, so this is the second drawing. I made 17 blues, 19 reds, the furthest I got was 37, and now my average is 50. So every time I click on this button we play a game to completion. Now I can click on the clear button to clear out those list box. And then I can click on this one to run the simulation 1,000 times. So there's 1,000 items in each of these list boxes. And my average is 50.87. Now my computer with my…

Contents