Generate random numbers with an upper bound specified
Imports System
Imports Microsoft.VisualBasic
Module RandomNextDemo
Sub UpperBoundRandoms( seed As Integer, upper As Integer )
Dim randObj As New Random( seed )
Dim j As Integer
For j = 0 To 5
Console.Write( "{0,11} ", randObj.Next( upper ) )
Next j
End Sub
Sub Main( )
UpperBoundRandoms( 2, Int32.MaxValue )
End Sub
End Module
Related examples in the same category