Verfasst: 31.01.2006 15:48
"Neues Spiel" geht nicht!
"Gewinnen" kann man aber.
"Gewinnen" kann man aber.
Code: Alles auswählen
Dim T(9)
s.s=" ist dran"
t=79
c=190
l=OpenWindow(0,216,0,c,250,$CC<<16,"TicTacToe")
CreateGadgetList(l)
For a=0 To8
ButtonGadget(a,70*a%3,70*(a/3),50,50,"")
SetGadgetFont(a,LoadFont(a,"",24))
Next
TextGadget(9,0,195,c,20,"O"+s,1)
c/2
ButtonGadget(11,0,220,c,30,"Neues Spiel")
ButtonGadget(10,c,220,c,30,"Spiel Beenden")
SetGadgetFont(9,LoadFont(9,"",12))
Repeat
w=WindowEvent()
If w=13100
O=EventwParam()
If O=10
End
ElseIf O=11
For a=0 To9
T(a)=0
SetGadgetText(a,"")
DisableGadget(a,0)
Next
P=0
Else
If T(O)=0
T(O)=P+1
DisableGadget(O,1)
SetGadgetText(O,Chr(t+P*9))
SetGadgetText(9,Chr(t+P!1*9)+s)
j=P+1
For i=0 To2
x=i*3
If T(x)&T(x+1)&T(x+2)=j Or T(i)&T(i+3)&T(i+6)=j Or T(0)&T(4)&T(8)=j Or T(2)&T(4)&T(6)=j
SetGadgetText(9,Chr(t+P*9)+" gewinnt")
For a=0 To8
DisableGadget(a,1)
Next
EndIf
Next
P!1
EndIf
EndIf
EndIf
Until w=16
Code: Alles auswählen
Dim T(9)
s.s=" ist dran"
t=79
c=190
d=220
l=OpenWindow(0,d,0,c,250,$CC<<16,"TicTacToe")
CreateGadgetList(l)
For a=0 To8
ButtonGadget(a,70*a%3,70*(a/3),50,50,"")
SetGadgetFont(a,LoadFont(a,"",24))
Next
TextGadget(9,0,195,c,20,"O"+s,1)
c/2
ButtonGadget(11,0,d,c,30,"Neues Spiel")
ButtonGadget(10,c,d,c,30,"Spiel Beenden")
SetGadgetFont(9,LoadFont(9,"",12))
Repeat
w=WindowEvent()
If w=13100
O=EventwParam()
If O=10
End
ElseIf O=11
For a=0 To9
T(a)=0
SetGadgetText(a,"")
DisableGadget(a,0)
Next
P=0
Else
If T(O)=0
T(O)=P+1
DisableGadget(O,1)
SetGadgetText(O,Chr(t+P*9))
SetGadgetText(9,Chr(t+P!1*9)+s)
j=P+1
For i=0 To2
x=i*3
If T(x)&T(x+1)&T(x+2)=j Or T(i)&T(i+3)&T(i+6)=j Or T(0)&T(4)&T(8)=j Or T(2)&T(4)&T(6)=j
SetGadgetText(9,Chr(t+P*9)+" gewinnt")
For a=0 To8
DisableGadget(a,1)
Next
EndIf
Next
P!1
EndIf
EndIf
EndIf
Until w=16
Code: Alles auswählen
Dim T(9)
s.s=" ist dran"
t=79
c=190
l=OpenWindow(0,0,0,c,250,$C80001,"TicTacToe")
CreateGadgetList(l)
For a=0 To8
ButtonGadget(a,70*a%3,70*(a/3),50,50,"")
SetGadgetFont(a,LoadFont(a,"",24))
Next
TextGadget(9,0,195,c,20,"O"+s,1)
c/2
ButtonGadget(11,0,220,c,30,"Neues Spiel")
ButtonGadget(10,c,220,c,30,"Spiel Beenden")
SetGadgetFont(9,LoadFont(9,"",12))
Repeat
w=WindowEvent()
If w=13100
O=EventwParam()
If O=10
End
ElseIf O=11
For a=0 To9
T(a)=0
SetGadgetText(a,"")
DisableGadget(a,0)
Next
P=0
Else
If T(O)=0
T(O)=P+1
DisableGadget(O,1)
SetGadgetText(O,Chr(t+P*9))
SetGadgetText(9,Chr(t+P!1*9)+s)
j=P+1
For i=0 To2
x=i*3
If T(x)&T(x+1)&T(x+2)=j Or T(i)&T(i+3)&T(i+6)=j Or T(0)&T(4)&T(8)=j Or T(2)&T(4)&T(6)=j
SetGadgetText(9,Chr(t+P*9)+" gewinnt")
For a=0 To8
DisableGadget(a,1)
Next
EndIf
Next
P!1
EndIf
EndIf
EndIf
Until w=16
Nur im englischem Forum, hier nichtNicTheQuick hat geschrieben:Gilt das?
Code: Alles auswählen
Dim T(9)
s.s=" ist dran"
t=79
c=190
l=OpenWindow(0,0,0,c,250,1,"TicTacToe")
CreateGadgetList(l)
For a=0 To8
ButtonGadget(a,70*a%3,70*(a/3),50,50,"")
SetGadgetFont(a,LoadFont(a,"",24))
Next
TextGadget(9,0,195,c,20,"O"+s,1)
c/2
ButtonGadget(11,0,220,c,30,"Neues Spiel")
ButtonGadget(10,c,220,c,30,"Spiel Beenden")
SetGadgetFont(9,LoadFont(9,"",12))
Repeat
w=WindowEvent()
If w=13100
O=EventwParam()
If O=10
End
ElseIf O=11
For a=0 To9
T(a)=0
SetGadgetText(a,"")
DisableGadget(a,0)
Next
P=0
Else
If T(O)=0
T(O)=P+1
DisableGadget(O,1)
SetGadgetText(O,Chr(t+P*9))
SetGadgetText(9,Chr(t+P!1*9)+s)
j=P+1
For i=0 To2
x=i*3
If T(x)&T(x+1)&T(x+2)=j Or T(i)&T(i+3)&T(i+6)=j Or T(0)&T(4)&T(8)=j Or T(2)&T(4)&T(6)=j
SetGadgetText(9,Chr(t+P*9)+" gewinnt")
For a=0 To8
DisableGadget(a,1)
Next
EndIf
Next
P!1
EndIf
EndIf
EndIf
ForEver