Wie könnte ich das kürzen ?
Code: Alles auswählen
Procedure Botspiel()
Shared bot, botzeichnung$,spieler$
If bot = 1
Botposi = 1+Random(9)
If Botposi = 1
nr1$ = GetGadgetText(#Button_0)
If nr1$ = spieler$ Or nr1$ = botzeichen$
Botspiel()
Else
DisableGadget(#Button_0,1)
SetGadgetText(#Button_0,Botzeichen$)
EndIf
EndIf
bot = 0
EndIf
EndProcedure
...
If bot = 1
Botposi = 1+Random(9)
If Botposi = 1
nr1$ = GetGadgetText(#Button_0)
If nr1$ = spieler$ Or nr1$ = botzeichen$
Botspiel()
Else
DisableGadget(#Button_0,1)
SetGadgetText(#Button_0,Botzeichen$)
EndIf
EndIf
bot = 0
EndIf
Ich dachte ja an "For: Next" Schleife , allerdings bekomme ich hin..
Gibt es einen weg das einfacher zu machen ?
Ich kann ja leider nicht einfach
For i = 0 to 5
Buttongadget(#Button_+i, .......)
next
machen ( Beispiel )
Würde mich über eine Hilfe freuen
Mfg