Tag Archives: repetition

Visual Basic – Unconditional Loops

How do we roll 100 dice?

We could put in 100 lines to generate the random number and 100 lines to add it to the list box or we can just make use of a FOR…NEXT loop.

This unconditional loop uses an incrementing counter (called counter in the example program) to control the number of repetitions of the loop. Everything between the FOR and NEXT lines is repeated.

What would happen if we wanted to check that the random number generator was really random? How could we test that the numbers are random? Answer after the jump.

Continue reading Visual Basic – Unconditional Loops