Lottozahlen

Transcription

Lottozahlen
Lottozahlen
1
2
OpenConsole()
Global Dim Lotto.w(6)
3
4
5
6
7
8
9
10
11
Procedure test(n.w)
nicht_vorhanden = 1
For k = 1 To n-1
If Lotto(k) = Lotto(n)
nicht_vorhanden = 0
EndIf
Next
ProcedureReturn nicht_vorhanden
EndProcedure
12
13
14
15
16
17
18
19
Procedure wuerfeln()
Lotto(1) = Random(48)+1
For n = 2 To 6
Repeat
Lotto(n) = Random(48)+1
Until test(n)=1
Next
EndProcedure
20
21
22
23
24
25
Procedure Ausgabe()
SortArray(Lotto(), #PB_Sort_Ascending )
For n = 1 To 6
PrintN(Str(Lotto(n)))
Next
EndProcedure
26
27
28
wuerfeln()
Ausgabe()
Input()