Torna al Thread

Imports System Imports System.Collections Imports System.Collections.Generic Public Class Generator Private lenght As Integer Private values As Integer = 9 Public Sub New(ByVal lenght As Integer) Me.charSet = charSet Me.lenght = lenght End Sub Dim arrCombination As Integer() = New Integer(lenght) {} Public Sub fill() For i As Integer = 0 To arrCombination.Length - 1 Step 1 arrCombination(i) = 0 Next End Sub Public Sub countNext() Do Until (arrCombination(0) = 9) arrCombination(arrCombination.Length - 1) = arrCombination(arrCombination.Length - 1) + 1 For i As Integer = arrCombination.Length - 1 To 3 Step 1 If (arrCombination(i) = 9) Then arrCombination(i) = 0 ' arrCombination(i - 1) = arrCombination(i - 1) + 1 Else End If Next Loop For i As Integer = 0 To arrCombination.Length - 1 Step 1 Console.Write(arrCombination(i)) Next End Sub End Class
Copyright © dotNetHell.it 2002-2025
Running on Windows Server 2008 R2 Standard, SQL Server 2012 & ASP.NET 3.5