Generate random numbers with both bounds specified
Imports System
Imports Microsoft.VisualBasic
Module RandomNextDemo
Sub BothBoundsRandoms(seed As Integer, lower 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( lower, upper ) )
Next j
End Sub
Sub Main( )
BothBoundsRandoms( 234, 0, Int32.MaxValue )
End Sub
End Module
Related examples in the same category