Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questiondim v (93) as integer dim plein as boolean dim g as integer for i = 1 to 93 v(i) = 0 ' charge à RAZ next i genere: ' g = GENERATION DU NOMBRE ENTIER 1 A 93 ICI ' plein = true for i = 1 to 93 if v(i) = 0 then plein = false exit for end if next i if plein = true then goto fin ' tableau terminé for i = 1 to 93 if v(i) = g then ' existe then goto genere next i for i = 1 to 93 ' attribue if v(i) = 0 then v(i) = g goto genere end if next i fin: ' On utilise ensuite le tableau v(i) ...
Dim hasard As Integer bis: Randomize hasard = Int((93 - 1 + 1) * Rnd + 1)
Dim h As Integer Dim alternat as boolean = false bis: alternat = not alternat if alternat true then h now.second + 1 ' 1 à 60 if alternat false then h now.second + 31 ' 31 à 90 ' ? goto bis ' ? if ? goto fin ' ? fin:
Dim rand As New Random() Dim i As Integer For ctr As Integer = 0 To 4 i = rand.Next(93) + 1 If InStr(TextBox1.Text, i.ToString, CompareMethod.Text) > 0 Then ctr -= 1 Else TextBox1.Text &= i & " " End If Next
Public Function GetAleatoire() as Integer() Dim rand As New Random() Dim i As Integer Dim lLstNb as List(Of Integer)=new List(Of Integer) dim lResult as List(Of Integer)=new List(Of Integer) For i=1 to 93 lLstNb.Add(i) next i Do while lLstNb.Count>1 i=rand.Next(lLstNb.Count-1) lResult.Add(lLstNb(i) lLstNb.RemoveAt(i) Loop lResult.Add(lLntNb(0) Return lResult.ToArray() End Function
Dim rand As New Random() Dim i As Integer For ctr As Integer = 0 To 4 i = rand.Next(93) + 1 If InStr(TextBox1.Text, i.ToString, CompareMethod.Text) > 0 Then ctr -= 1 Else TextBox1.Text &= i & " " End If Next