Random Numbers and Tic Tac Toe with Visual Basic .NET Oklahoma

The holidays are a time for fun. Learn about random numbers from Paul Kimmel's latest Visual Basic Today column from CodeGuru.com. Includes a Tic Tac Toe game!

Local Companies

Amercian Education Corporation
405-840-6031
7506 Broadway Ext
Oklahoma City, OK
Midwest CAM Solutions (GibbsCAM)
763-560-6567
NOW SERVING: OKLAHOMA
Oklahoma City, OK
Dreyer Software Inc
918-838-7638
PO Box 3391
Tulsa, OK
Tah Software Systems
405-478-3962
3400 NE 115th St
Oklahoma City, OK
B Solutions LLC
918-749-9200
5645 S Madison Ave
Tulsa, OK
Anyware Mobile Solutions
918-280-8693
5800 E Skelly DR
Tulsa, OK
Earnest Computer Service
405-732-1233
7005 SE 15th St
Oklahoma City, OK
Axis Integrated Solutions
918-488-1881
2818 E 81st Pl
Tulsa, OK
Software Etc
918-254-9124
Woodland Hills Mall
Tulsa, OK
Griffey & Associates
918-627-6399
5350 E 46th Street Suite 145
Tulsa, OK

provided by: 
Originally published at Internet.com


If you are a little like I am you will be doing something with your computer even during the holidays. (More than likely I will be playing Red Alert 2 with the kids, but I may sneak in a little writing.) For you workaholics, I have included a little holiday fare. This way you will be able to do something constructive, yet be able to tear yourself away when company comes knocking on the door.

Random numbers are commonly employed in applications for a wide variety of reasons. In this week's letter let's take a quick look at the Random class in the Common Language Runtime.

The System Namespace



The System namespace is a root namespace in the Common Language Runtime (CLR). One of the classes in the System namespace is the Random class. (That's right! Random numbers are encapsulated in a class in .NET.) Like VB6 random numbers are based on a mathematical algorithm from a finite set of numbers. The result is that you get pseudo-random numbers, but these numbers are random enough for many practical purposes (just not the lottery).

Random numbers in VB.NET can be initialized with or without a seed value and can be constrained to a range of numbers. If the same seed is used then the generated number sequence will be identical. A good strategy is to seed the random numbers using a unique value like the time. Table 1 describes the members of the Random class and is followed by some code examples demonstrating how to use the Random class. Members of the System.Random class. Member Name Description New() Constructs instance of Random Class. New(ByVal Seed As Integer) Constructs instance of Random class using Seed value. Next() As Integer Returns next integer in the random number sequence. Next(ByVal maxValue As Integer) As Integer Returns a positive integer less than maxValue. Next(ByVal minValue As Integer, ByVal maxValue As Integer) As Integer Returns a number greater than or equal to minValue and less than or maxValue. NextBytes(ByVal buffer() As Byte) Returns an array of random bytes greater than or equal to 0 and less than Byte.MaxValue. NextDouble() As Double Returns a random Double between 0.0 and 1.0...

Read article at Internet.com site

Featured Local Company

Anyware Mobile Solutions

918-280-8693
5800 E Skelly DR
Tulsa, OK

Related Articles
- Custom MSBuild Task Development with Visual C++ Oklahoma
Visual C++ 2010 sees the integration of MSBuild with Visual C++. MSBuild is Microsoft's common build engine and one of its key design goals is the ability to support a high-degree of flexibility in customizing the build process. See how a custom MSBuild task can be built in Visual C++, and how the task can be used to customize the build process of other Visual C++ 2010 projects.
- Visual Basic .NET as a Fully Object-Oriented Language Oklahoma
- Visual Basic .NET Attributes Oklahoma
- Automating Repetitive Tasks in Visual Studio Oklahoma
- Encrypting a File Using .NET Oklahoma
- Microsoft Scripting Runtime in Visual Basic 6 Oklahoma
- Book Review: ASP.NET For Dummies Oklahoma
- MSBuild Features for Visual C++ Oklahoma
- Capturing CommandBar Events in VB Add-Ins Oklahoma
- Adding Standard Deviation to LINQ Oklahoma
Regional Articles
- Random Numbers and Tic Tac Toe with Visual Basic .NET Ada OK
- Random Numbers and Tic Tac Toe with Visual Basic .NET Altus OK
- Random Numbers and Tic Tac Toe with Visual Basic .NET Ardmore OK
- Random Numbers and Tic Tac Toe with Visual Basic .NET Bartlesville OK
- Random Numbers and Tic Tac Toe with Visual Basic .NET Bethany OK
- Random Numbers and Tic Tac Toe with Visual Basic .NET Bixby OK
- Random Numbers and Tic Tac Toe with Visual Basic .NET Broken Arrow OK
- Random Numbers and Tic Tac Toe with Visual Basic .NET Chickasha OK
- Random Numbers and Tic Tac Toe with Visual Basic .NET Choctaw OK
- Random Numbers and Tic Tac Toe with Visual Basic .NET Claremore OK
- Random Numbers and Tic Tac Toe with Visual Basic .NET Duncan OK
- Random Numbers and Tic Tac Toe with Visual Basic .NET Durant OK
- Random Numbers and Tic Tac Toe with Visual Basic .NET Edmond OK
- Random Numbers and Tic Tac Toe with Visual Basic .NET El Reno OK
- Random Numbers and Tic Tac Toe with Visual Basic .NET Enid OK
- Random Numbers and Tic Tac Toe with Visual Basic .NET Guthrie OK
- Random Numbers and Tic Tac Toe with Visual Basic .NET Lawton OK
- Random Numbers and Tic Tac Toe with Visual Basic .NET Mcalester OK
- Random Numbers and Tic Tac Toe with Visual Basic .NET Muskogee OK
- Random Numbers and Tic Tac Toe with Visual Basic .NET Mustang OK
- Random Numbers and Tic Tac Toe with Visual Basic .NET Norman OK
- Random Numbers and Tic Tac Toe with Visual Basic .NET Oklahoma City OK
- Random Numbers and Tic Tac Toe with Visual Basic .NET Okmulgee OK
- Random Numbers and Tic Tac Toe with Visual Basic .NET Owasso OK
- Random Numbers and Tic Tac Toe with Visual Basic .NET Ponca City OK
- Random Numbers and Tic Tac Toe with Visual Basic .NET Pryor OK
- Random Numbers and Tic Tac Toe with Visual Basic .NET Sand Springs OK
- Random Numbers and Tic Tac Toe with Visual Basic .NET Sapulpa OK
- Random Numbers and Tic Tac Toe with Visual Basic .NET Shawnee OK
- Random Numbers and Tic Tac Toe with Visual Basic .NET Stillwater OK
- Random Numbers and Tic Tac Toe with Visual Basic .NET Tahlequah OK
- Random Numbers and Tic Tac Toe with Visual Basic .NET Tulsa OK
- Random Numbers and Tic Tac Toe with Visual Basic .NET Woodward OK
- Random Numbers and Tic Tac Toe with Visual Basic .NET Yukon OK

Topics: 
Architecture & Design Languages & Tools Project Management Web Services
Database Microsoft & .NET Security Wireless
Java Open Source Techniques XML