4 Gewinnt als Multiplayer.
4Gewinnt
-
Markus -
27. Februar 2006 um 13:11 -
Geschlossen
-
-
Hier die Dateien und der Code:
(Das Skript hab ich vor langer Zeit geschrieben deswegen ist es so schlecht, demnächst kommt die verbesserte version zum online spielen mit schach und chat)C
Alles anzeigen; ---------------------------------------------------------------------------- ; ; AutoIt Version: 3.1.0 ; Author: A.N.Other <myemail@nowhere.com> ; ; Script Function: ; Template AutoIt script. ; ; ---------------------------------------------------------------------------- ; Script Start - Add your code below here #include <GUIConstants.au3> $default1=IniRead("Spieler.ini","Spielernamen","Spieler1","Beim ersten Mal namen eingeben") $default2=IniRead("Spieler.ini","Spielernamen","Spieler2","Beim ersten Mal namen eingeben") $spieler1=InputBox("Spieler 1(gelbe Coins, darf anfangen)","Gib bitte deinen Namen ein",$default1,"",300,150) $spieler2=InputBox("Spieler 2(rote Coins)","Gib bitte deinen Namen ein",$default2,"",300,150) IniWrite("Spieler.ini","Spielernamen","Spieler1",$spieler1) IniWrite("Spieler.ini","Spielernamen","Spieler2",$spieler2) GUICreate("4Gewinnt",740,780) $id_bild_1=GUICtrlCreatePic ( "frei.bmp", 20, 20 , 100 , 100 ) $id_bild_2=GUICtrlCreatePic ( "frei.bmp", 120, 20 , 100 , 100 ) $id_bild_3=GUICtrlCreatePic ( "frei.bmp", 220, 20 , 100 , 100 ) $id_bild_4=GUICtrlCreatePic ( "frei.bmp", 320, 20 , 100 , 100 ) $id_bild_5=GUICtrlCreatePic ( "frei.bmp", 420, 20 , 100 , 100 ) $id_bild_6=GUICtrlCreatePic ( "frei.bmp", 520, 20 , 100 , 100 ) $id_bild_7=GUICtrlCreatePic ( "frei.bmp", 620, 20 , 100 , 100 ) $id_bild_8=GUICtrlCreatePic ( "frei.bmp", 20, 120 , 100 , 100 ) $id_bild_9=GUICtrlCreatePic ( "frei.bmp", 120, 120 , 100 , 100 ) $id_bild_10=GUICtrlCreatePic ( "frei.bmp", 220, 120 , 100 , 100 ) $id_bild_11=GUICtrlCreatePic ( "frei.bmp", 320, 120 , 100 , 100 ) $id_bild_12=GUICtrlCreatePic ( "frei.bmp", 420, 120 , 100 , 100 ) $id_bild_13=GUICtrlCreatePic ( "frei.bmp", 520, 120 , 100 , 100 ) $id_bild_14=GUICtrlCreatePic ( "frei.bmp", 620, 120 , 100 , 100 ) $id_bild_15=GUICtrlCreatePic ( "frei.bmp", 20, 220 , 100 , 100 ) $id_bild_16=GUICtrlCreatePic ( "frei.bmp", 120, 220 , 100 , 100 ) $id_bild_17=GUICtrlCreatePic ( "frei.bmp", 220, 220 , 100 , 100 ) $id_bild_18=GUICtrlCreatePic ( "frei.bmp", 320, 220 , 100 , 100 ) $id_bild_19=GUICtrlCreatePic ( "frei.bmp", 420, 220 , 100 , 100 ) $id_bild_20=GUICtrlCreatePic ( "frei.bmp", 520, 220 , 100 , 100 ) $id_bild_21=GUICtrlCreatePic ( "frei.bmp", 620, 220 , 100 , 100 ) $id_bild_22=GUICtrlCreatePic ( "frei.bmp", 20, 320 , 100 , 100 ) $id_bild_23=GUICtrlCreatePic ( "frei.bmp", 120, 320 , 100 , 100 ) $id_bild_24=GUICtrlCreatePic ( "frei.bmp", 220, 320 , 100 , 100 ) $id_bild_25=GUICtrlCreatePic ( "frei.bmp", 320, 320 , 100 , 100 ) $id_bild_26=GUICtrlCreatePic ( "frei.bmp", 420, 320 , 100 , 100 ) $id_bild_27=GUICtrlCreatePic ( "frei.bmp", 520, 320 , 100 , 100 ) $id_bild_28=GUICtrlCreatePic ( "frei.bmp", 620, 320 , 100 , 100 ) $id_bild_29=GUICtrlCreatePic ( "frei.bmp", 20, 420 , 100 , 100 ) $id_bild_30=GUICtrlCreatePic ( "frei.bmp", 120, 420 , 100 , 100 ) $id_bild_31=GUICtrlCreatePic ( "frei.bmp", 220, 420 , 100 , 100 ) $id_bild_32=GUICtrlCreatePic ( "frei.bmp", 320, 420 , 100 , 100 ) $id_bild_33=GUICtrlCreatePic ( "frei.bmp", 420, 420 , 100 , 100 ) $id_bild_34=GUICtrlCreatePic ( "frei.bmp", 520, 420 , 100 , 100 ) $id_bild_35=GUICtrlCreatePic ( "frei.bmp", 620, 420 , 100 , 100 ) $id_bild_36=GUICtrlCreatePic ( "frei.bmp", 20, 520 , 100 , 100 ) $id_bild_37=GUICtrlCreatePic ( "frei.bmp", 120, 520 , 100 , 100 ) $id_bild_38=GUICtrlCreatePic ( "frei.bmp", 220, 520 , 100 , 100 ) $id_bild_39=GUICtrlCreatePic ( "frei.bmp", 320, 520 , 100 , 100 ) $id_bild_40=GUICtrlCreatePic ( "frei.bmp", 420, 520 , 100 , 100 ) $id_bild_41=GUICtrlCreatePic ( "frei.bmp", 520, 520 , 100 , 100 ) $id_bild_42=GUICtrlCreatePic ( "frei.bmp", 620, 520 , 100 , 100 ) $id_button_spalte_1=GUICtrlCreateButton("Spalte &1",20,640,100,20) $id_button_spalte_2=GUICtrlCreateButton("Spalte &2",120,640,100,20) $id_button_spalte_3=GUICtrlCreateButton("Spalte &3",220,640,100,20) $id_button_spalte_4=GUICtrlCreateButton("Spalte &4",320,640,100,20) $id_button_spalte_5=GUICtrlCreateButton("Spalte &5",420,640,100,20) $id_button_spalte_6=GUICtrlCreateButton("Spalte &6",520,640,100,20) $id_button_spalte_7=GUICtrlCreateButton("Spalte &7",620,640,100,20) If $spieler1="" Then $spieler1="NoNamedPlayer1" If $spieler2="" Then $spieler2="NoNamedPlayer2" $id_spieler1=GUICtrlCreateLabel("Spieler 1 (gelbe Coins):" & @crlf & $spieler1,20,700,160,30,-1,$WS_EX_CLIENTEDGE ) $id_spieler2=GUICtrlCreateLabel("Spieler 2 (rote Coins):" & @crlf & $spieler2,200,700,160,30,-1,$WS_EX_CLIENTEDGE ) $id_wer_ist_dran=GUICtrlCreateLabel("",400,700,160,30,-1,$WS_EX_CLIENTEDGE ) GUISetState(@sw_show) Global $spalte1="1",$spalte2="1",$spalte3="1",$spalte4="1",$spalte5="1",$spalte6="1",$spalte7="1" Global $wer_ist_dran="gelb" Global $farbe[43] Global $egal=2 For $s=0 to 42 $farbe[$s]="" Next While 1 _auswerten() If $wer_ist_dran="gelb" And $egal=2 Then If $wer_ist_dran="gelb" Then GUICtrlSetData ( $id_wer_ist_dran,$spieler1 & " ist an der Reihe") $egal=1 EndIf EndIf If $wer_ist_dran="rot" And $egal=1 Then If $wer_ist_dran="rot" Then GUICtrlSetData ( $id_wer_ist_dran,$spieler2 & " ist an der Reihe") $egal=2 EndIf EndIf $msg=GuiGetMsg() Select Case $msg=$GUI_EVENT_CLOSE Exit Case $msg=$id_button_spalte_1 If $spalte1=1 Then $id_bild=$id_bild_36 If $spalte1=2 Then $id_bild=$id_bild_29 If $spalte1=3 Then $id_bild=$id_bild_22 If $spalte1=4 Then $id_bild=$id_bild_15 If $spalte1=5 Then $id_bild=$id_bild_8 If $spalte1=6 Then $id_bild=$id_bild_1 GUICtrlSetState ( $id_button_spalte_1, $GUI_DISABLE ) EndIf If $wer_ist_dran="gelb" Then GUICtrlSetImage ( $id_bild, "GelberCoin.bmp" ) If $id_bild=$id_bild_1 Then $farbe[1]="gelb" If $id_bild=$id_bild_8 Then $farbe[8]="gelb" If $id_bild=$id_bild_15 Then $farbe[15]="gelb" If $id_bild=$id_bild_22 Then $farbe[22]="gelb" If $id_bild=$id_bild_29 Then $farbe[29]="gelb" If $id_bild=$id_bild_36 Then $farbe[36]="gelb" EndIf If $wer_ist_dran="rot" Then GUICtrlSetImage ( $id_bild, "RoterCoin.bmp" ) If $id_bild=$id_bild_1 Then $farbe[1]="rot" If $id_bild=$id_bild_8 Then $farbe[8]="rot" If $id_bild=$id_bild_15 Then $farbe[15]="rot" If $id_bild=$id_bild_22 Then $farbe[22]="rot" If $id_bild=$id_bild_29 Then $farbe[29]="rot" If $id_bild=$id_bild_36 Then $farbe[36]="rot" EndIf While 1 If $wer_ist_dran="gelb" Then $wer_ist_dran="rot" ExitLoop EndIf If $wer_ist_dran="rot" Then $wer_ist_dran="gelb" ExitLoop EndIf WEnd $spalte1=$spalte1+1 Case $msg=$id_button_spalte_2 If $spalte2=1 Then $id_bild=$id_bild_37 If $spalte2=2 Then $id_bild=$id_bild_30 If $spalte2=3 Then $id_bild=$id_bild_23 If $spalte2=4 Then $id_bild=$id_bild_16 If $spalte2=5 Then $id_bild=$id_bild_9 If $spalte2=6 Then $id_bild=$id_bild_2 GUICtrlSetState ( $id_button_spalte_2, $GUI_DISABLE ) EndIf If $wer_ist_dran="gelb" Then GUICtrlSetImage ( $id_bild, "GelberCoin.bmp" ) If $id_bild=$id_bild_2 Then $farbe[2]="gelb" If $id_bild=$id_bild_9 Then $farbe[9]="gelb" If $id_bild=$id_bild_16 Then $farbe[16]="gelb" If $id_bild=$id_bild_23 Then $farbe[23]="gelb" If $id_bild=$id_bild_30 Then $farbe[30]="gelb" If $id_bild=$id_bild_37 Then $farbe[37]="gelb" EndIf If $wer_ist_dran="rot" Then GUICtrlSetImage ( $id_bild, "RoterCoin.bmp" ) If $id_bild=$id_bild_2 Then $farbe[2]="rot" If $id_bild=$id_bild_9 Then $farbe[9]="rot" If $id_bild=$id_bild_16 Then $farbe[16]="rot" If $id_bild=$id_bild_23 Then $farbe[23]="rot" If $id_bild=$id_bild_30 Then $farbe[30]="rot" If $id_bild=$id_bild_37 Then $farbe[37]="rot" EndIf While 1 If $wer_ist_dran="gelb" Then $wer_ist_dran="rot" ExitLoop EndIf If $wer_ist_dran="rot" Then $wer_ist_dran="gelb" ExitLoop EndIf WEnd $spalte2=$spalte2+1 Case $msg=$id_button_spalte_3 If $spalte3=1 Then $id_bild=$id_bild_38 If $spalte3=2 Then $id_bild=$id_bild_31 If $spalte3=3 Then $id_bild=$id_bild_24 If $spalte3=4 Then $id_bild=$id_bild_17 If $spalte3=5 Then $id_bild=$id_bild_10 If $spalte3=6 Then $id_bild=$id_bild_3 GUICtrlSetState ( $id_button_spalte_3, $GUI_DISABLE ) EndIf If $wer_ist_dran="gelb" Then GUICtrlSetImage ( $id_bild, "GelberCoin.bmp" ) If $id_bild=$id_bild_3 Then $farbe[3]="gelb" If $id_bild=$id_bild_10 Then $farbe[10]="gelb" If $id_bild=$id_bild_17 Then $farbe[17]="gelb" If $id_bild=$id_bild_24 Then $farbe[24]="gelb" If $id_bild=$id_bild_31 Then $farbe[31]="gelb" If $id_bild=$id_bild_38 Then $farbe[38]="gelb" EndIf If $wer_ist_dran="rot" Then GUICtrlSetImage ( $id_bild, "RoterCoin.bmp" ) If $id_bild=$id_bild_3 Then $farbe[3]="rot" If $id_bild=$id_bild_10 Then $farbe[10]="rot" If $id_bild=$id_bild_17 Then $farbe[17]="rot" If $id_bild=$id_bild_24 Then $farbe[24]="rot" If $id_bild=$id_bild_31 Then $farbe[31]="rot" If $id_bild=$id_bild_38 Then $farbe[38]="rot" EndIf While 1 If $wer_ist_dran="gelb" Then $wer_ist_dran="rot" ExitLoop EndIf If $wer_ist_dran="rot" Then $wer_ist_dran="gelb" ExitLoop EndIf WEnd $spalte3=$spalte3+1 Case $msg=$id_button_spalte_4 If $spalte4=1 Then $id_bild=$id_bild_39 If $spalte4=2 Then $id_bild=$id_bild_32 If $spalte4=3 Then $id_bild=$id_bild_25 If $spalte4=4 Then $id_bild=$id_bild_18 If $spalte4=5 Then $id_bild=$id_bild_11 If $spalte4=6 Then $id_bild=$id_bild_4 GUICtrlSetState ( $id_button_spalte_4, $GUI_DISABLE ) EndIf If $wer_ist_dran="gelb" Then GUICtrlSetImage ( $id_bild, "GelberCoin.bmp" ) If $id_bild=$id_bild_4 Then $farbe[4]="gelb" If $id_bild=$id_bild_11 Then $farbe[11]="gelb" If $id_bild=$id_bild_18 Then $farbe[18]="gelb" If $id_bild=$id_bild_25 Then $farbe[25]="gelb" If $id_bild=$id_bild_32 Then $farbe[32]="gelb" If $id_bild=$id_bild_39 Then $farbe[39]="gelb" EndIf If $wer_ist_dran="rot" Then GUICtrlSetImage ( $id_bild, "RoterCoin.bmp" ) If $id_bild=$id_bild_4 Then $farbe[4]="rot" If $id_bild=$id_bild_11 Then $farbe[11]="rot" If $id_bild=$id_bild_18 Then $farbe[18]="rot" If $id_bild=$id_bild_25 Then $farbe[25]="rot" If $id_bild=$id_bild_32 Then $farbe[32]="rot" If $id_bild=$id_bild_39 Then $farbe[39]="rot" EndIf While 1 If $wer_ist_dran="gelb" Then $wer_ist_dran="rot" ExitLoop EndIf If $wer_ist_dran="rot" Then $wer_ist_dran="gelb" ExitLoop EndIf WEnd $spalte4=$spalte4+1 Case $msg=$id_button_spalte_5 If $spalte5=1 Then $id_bild=$id_bild_40 If $spalte5=2 Then $id_bild=$id_bild_33 If $spalte5=3 Then $id_bild=$id_bild_26 If $spalte5=4 Then $id_bild=$id_bild_19 If $spalte5=5 Then $id_bild=$id_bild_12 If $spalte5=6 Then $id_bild=$id_bild_5 GUICtrlSetState ( $id_button_spalte_5, $GUI_DISABLE ) EndIf If $wer_ist_dran="gelb" Then GUICtrlSetImage ( $id_bild, "GelberCoin.bmp" ) If $id_bild=$id_bild_5 Then $farbe[5]="gelb" If $id_bild=$id_bild_12 Then $farbe[12]="gelb" If $id_bild=$id_bild_19 Then $farbe[19]="gelb" If $id_bild=$id_bild_26 Then $farbe[26]="gelb" If $id_bild=$id_bild_33 Then $farbe[33]="gelb" If $id_bild=$id_bild_40 Then $farbe[40]="gelb" EndIf If $wer_ist_dran="rot" Then GUICtrlSetImage ( $id_bild, "RoterCoin.bmp" ) If $id_bild=$id_bild_5 Then $farbe[5]="rot" If $id_bild=$id_bild_12 Then $farbe[12]="rot" If $id_bild=$id_bild_19 Then $farbe[19]="rot" If $id_bild=$id_bild_26 Then $farbe[26]="rot" If $id_bild=$id_bild_33 Then $farbe[33]="rot" If $id_bild=$id_bild_40 Then $farbe[40]="rot" EndIf While 1 If $wer_ist_dran="gelb" Then $wer_ist_dran="rot" ExitLoop EndIf If $wer_ist_dran="rot" Then $wer_ist_dran="gelb" ExitLoop EndIf WEnd $spalte5=$spalte5+1 Case $msg=$id_button_spalte_6 If $spalte6=1 Then $id_bild=$id_bild_41 If $spalte6=2 Then $id_bild=$id_bild_34 If $spalte6=3 Then $id_bild=$id_bild_27 If $spalte6=4 Then $id_bild=$id_bild_20 If $spalte6=5 Then $id_bild=$id_bild_13 If $spalte6=6 Then $id_bild=$id_bild_6 GUICtrlSetState ( $id_button_spalte_6, $GUI_DISABLE ) EndIf If $wer_ist_dran="gelb" Then GUICtrlSetImage ( $id_bild, "GelberCoin.bmp" ) If $id_bild=$id_bild_6 Then $farbe[6]="gelb" If $id_bild=$id_bild_13 Then $farbe[13]="gelb" If $id_bild=$id_bild_20 Then $farbe[20]="gelb" If $id_bild=$id_bild_27 Then $farbe[27]="gelb" If $id_bild=$id_bild_34 Then $farbe[34]="gelb" If $id_bild=$id_bild_41 Then $farbe[41]="gelb" EndIf If $wer_ist_dran="rot" Then GUICtrlSetImage ( $id_bild, "RoterCoin.bmp" ) If $id_bild=$id_bild_6 Then $farbe[6]="rot" If $id_bild=$id_bild_13 Then $farbe[13]="rot" If $id_bild=$id_bild_20 Then $farbe[20]="rot" If $id_bild=$id_bild_27 Then $farbe[27]="rot" If $id_bild=$id_bild_34 Then $farbe[34]="rot" If $id_bild=$id_bild_41 Then $farbe[41]="rot" EndIf While 1 If $wer_ist_dran="gelb" Then $wer_ist_dran="rot" ExitLoop EndIf If $wer_ist_dran="rot" Then $wer_ist_dran="gelb" ExitLoop EndIf WEnd $spalte6=$spalte6+1 Case $msg=$id_button_spalte_7 If $spalte7=1 Then $id_bild=$id_bild_42 If $spalte7=2 Then $id_bild=$id_bild_35 If $spalte7=3 Then $id_bild=$id_bild_28 If $spalte7=4 Then $id_bild=$id_bild_21 If $spalte7=5 Then $id_bild=$id_bild_14 If $spalte7=6 Then $id_bild=$id_bild_7 GUICtrlSetState ( $id_button_spalte_7, $GUI_DISABLE ) EndIf If $wer_ist_dran="gelb" Then GUICtrlSetImage ( $id_bild, "GelberCoin.bmp" ) If $id_bild=$id_bild_7 Then $farbe[7]="gelb" If $id_bild=$id_bild_14 Then $farbe[14]="gelb" If $id_bild=$id_bild_21 Then $farbe[21]="gelb" If $id_bild=$id_bild_28 Then $farbe[28]="gelb" If $id_bild=$id_bild_35 Then $farbe[35]="gelb" If $id_bild=$id_bild_42 Then $farbe[42]="gelb" EndIf If $wer_ist_dran="rot" Then GUICtrlSetImage ( $id_bild, "RoterCoin.bmp" ) If $id_bild=$id_bild_7 Then $farbe[7]="rot" If $id_bild=$id_bild_14 Then $farbe[14]="rot" If $id_bild=$id_bild_21 Then $farbe[21]="rot" If $id_bild=$id_bild_28 Then $farbe[28]="rot" If $id_bild=$id_bild_35 Then $farbe[35]="rot" If $id_bild=$id_bild_42 Then $farbe[42]="rot" EndIf While 1 If $wer_ist_dran="gelb" Then $wer_ist_dran="rot" ExitLoop EndIf If $wer_ist_dran="rot" Then $wer_ist_dran="gelb" ExitLoop EndIf WEnd $spalte7=$spalte7+1 EndSelect WEnd Func _auswerten() ; alle geraden 4er $i=1 While 1 If $farbe[$i]="gelb" And $farbe[$i+7]="gelb" And $farbe[$i+14]="gelb" And $farbe[$i+21]="gelb" Then $neues_game=MsgBox(4,$spieler1 & " hat gewonnen", "Neues Spiel?") If $neues_game=6 Then Run(@ScriptFullPath) Exit EndIf If $i=21 Then ExitLoop $i=$i+1 WEnd ;alle wagerechten 4er in der 1.Reihe $i=1 While 1 If $farbe[$i]="gelb" And $farbe[$i+1]="gelb" And $farbe[$i+2]="gelb" And $farbe[$i+3]="gelb" Then $neues_game=MsgBox(4,$spieler1 & " hat gewonnen", "Neues Spiel?") If $neues_game=6 Then Run(@ScriptFullPath) Exit EndIf If $i=4 Then ExitLoop $i=$i+1 WEnd ;alle wagerechten 4er in der 2.Reihe $i=8 While 1 If $farbe[$i]="gelb" And $farbe[$i+1]="gelb" And $farbe[$i+2]="gelb" And $farbe[$i+3]="gelb" Then $neues_game=MsgBox(4,$spieler1 & " hat gewonnen", "Neues Spiel?") If $neues_game=6 Then Run(@ScriptFullPath) Exit EndIf If $i=11 Then ExitLoop $i=$i+1 WEnd ;alle wagerechten 4er in der 3.Reihe $i=15 While 1 If $farbe[$i]="gelb" And $farbe[$i+1]="gelb" And $farbe[$i+2]="gelb" And $farbe[$i+3]="gelb" Then $neues_game=MsgBox(4,$spieler1 & " hat gewonnen", "Neues Spiel?") If $neues_game=6 Then Run(@ScriptFullPath) Exit EndIf If $i=18 Then ExitLoop $i=$i+1 WEnd ;alle wagerechten 4er in der 4.Reihe $i=22 While 1 If $farbe[$i]="gelb" And $farbe[$i+1]="gelb" And $farbe[$i+2]="gelb" And $farbe[$i+3]="gelb" Then $neues_game=MsgBox(4,$spieler1 & " hat gewonnen", "Neues Spiel?") If $neues_game=6 Then Run(@ScriptFullPath) Exit EndIf If $i=25 Then ExitLoop $i=$i+1 WEnd ;alle wagerechten 4er in der 5.Reihe $i=29 While 1 If $farbe[$i]="gelb" And $farbe[$i+1]="gelb" And $farbe[$i+2]="gelb" And $farbe[$i+3]="gelb" Then $neues_game=MsgBox(4,$spieler1 & " hat gewonnen", "Neues Spiel?") If $neues_game=6 Then Run(@ScriptFullPath) Exit EndIf If $i=32 Then ExitLoop $i=$i+1 WEnd ;alle wagerechten 4er in der 6.Reihe $i=36 While 1 If $farbe[$i]="gelb" And $farbe[$i+1]="gelb" And $farbe[$i+2]="gelb" And $farbe[$i+3]="gelb" Then $neues_game=MsgBox(4,$spieler1 & " hat gewonnen", "Neues Spiel?") If $neues_game=6 Then Run(@ScriptFullPath) Exit EndIf If $i=39 Then ExitLoop $i=$i+1 WEnd ;alle schrägen 4er von der1.Reihe aus nach links unten $i=4 While 1 If $farbe[$i]="gelb" And $farbe[$i+6]="gelb" And $farbe[$i+12]="gelb" And $farbe[$i+18]="gelb" Then $neues_game=MsgBox(4,$spieler1 & " hat gewonnen", "Neues Spiel?") If $neues_game=6 Then Run(@ScriptFullPath) Exit EndIf If $i=7 Then ExitLoop $i=$i+1 WEnd ;alle schrägen 4er von der2.Reihe aus nach links unten $i=11 While 1 If $farbe[$i]="gelb" And $farbe[$i+6]="gelb" And $farbe[$i+12]="gelb" And $farbe[$i+18]="gelb" Then $neues_game=MsgBox(4,$spieler1 & " hat gewonnen", "Neues Spiel?") If $neues_game=6 Then Run(@ScriptFullPath) Exit EndIf If $i=14 Then ExitLoop $i=$i+1 WEnd ;alle schrägen 4er von der3.Reihe aus nach links unten $i=18 While 1 If $farbe[$i]="gelb" And $farbe[$i+6]="gelb" And $farbe[$i+12]="gelb" And $farbe[$i+18]="gelb" Then $neues_game=MsgBox(4,$spieler1 & " hat gewonnen", "Neues Spiel?") If $neues_game=6 Then Run(@ScriptFullPath) Exit EndIf If $i=21 Then ExitLoop $i=$i+1 WEnd ;alle schrägen 4er von der1.Reihe aus nach rechts unten $i=1 While 1 If $farbe[$i]="gelb" And $farbe[$i+8]="gelb" And $farbe[$i+16]="gelb" And $farbe[$i+24]="gelb" Then $neues_game=MsgBox(4,$spieler1 & " hat gewonnen", "Neues Spiel?") If $neues_game=6 Then Run(@ScriptFullPath) Exit EndIf If $i=4 Then ExitLoop $i=$i+1 WEnd ;alle schrägen 4er von der2.Reihe aus nach rechts unten $i=8 While 1 If $farbe[$i]="gelb" And $farbe[$i+8]="gelb" And $farbe[$i+16]="gelb" And $farbe[$i+24]="gelb" Then $neues_game=MsgBox(4,$spieler1 & " hat gewonnen", "Neues Spiel?") If $neues_game=6 Then Run(@ScriptFullPath) Exit EndIf If $i=11 Then ExitLoop $i=$i+1 WEnd ;alle schrägen 4er von der3.Reihe aus nach rechts unten $i=15 While 1 If $farbe[$i]="gelb" And $farbe[$i+8]="gelb" And $farbe[$i+16]="gelb" And $farbe[$i+24]="gelb" Then $neues_game=MsgBox(4,$spieler1 & " hat gewonnen", "Neues Spiel?") If $neues_game=6 Then Run(@ScriptFullPath) Exit EndIf If $i=18 Then ExitLoop $i=$i+1 WEnd ; alle geraden 4er $i=1 While 1 If $farbe[$i]="rot" And $farbe[$i+7]="rot" And $farbe[$i+14]="rot" And $farbe[$i+21]="rot" Then $neues_game=MsgBox(4,$spieler2 & " hat gewonnen", "Neues Spiel?") If $neues_game=6 Then Run(@ScriptFullPath) Exit EndIf If $i=21 Then ExitLoop $i=$i+1 WEnd ;alle wagerechten 4er in der 1.Reihe $i=1 While 1 If $farbe[$i]="rot" And $farbe[$i+1]="rot" And $farbe[$i+2]="rot" And $farbe[$i+3]="rot" Then $neues_game=MsgBox(4,$spieler2 & " hat gewonnen", "Neues Spiel?") If $neues_game=6 Then Run(@ScriptFullPath) Exit EndIf If $i=4 Then ExitLoop $i=$i+1 WEnd ;alle wagerechten 4er in der 2.Reihe $i=8 While 1 If $farbe[$i]="rot" And $farbe[$i+1]="rot" And $farbe[$i+2]="rot" And $farbe[$i+3]="rot" Then $neues_game=MsgBox(4,$spieler2 & " hat gewonnen", "Neues Spiel?") If $neues_game=6 Then Run(@ScriptFullPath) Exit EndIf If $i=11 Then ExitLoop $i=$i+1 WEnd ;alle wagerechten 4er in der 3.Reihe $i=15 While 1 If $farbe[$i]="rot" And $farbe[$i+1]="rot" And $farbe[$i+2]="rot" And $farbe[$i+3]="rot" Then $neues_game=MsgBox(4,$spieler2 & " hat gewonnen", "Neues Spiel?") If $neues_game=6 Then Run(@ScriptFullPath) Exit EndIf If $i=18 Then ExitLoop $i=$i+1 WEnd ;alle wagerechten 4er in der 4.Reihe $i=22 While 1 If $farbe[$i]="rot" And $farbe[$i+1]="rot" And $farbe[$i+2]="rot" And $farbe[$i+3]="rot" Then $neues_game=MsgBox(4,$spieler2 & " hat gewonnen", "Neues Spiel?") If $neues_game=6 Then Run(@ScriptFullPath) Exit EndIf If $i=25 Then ExitLoop $i=$i+1 WEnd ;alle wagerechten 4er in der 5.Reihe $i=29 While 1 If $farbe[$i]="rot" And $farbe[$i+1]="rot" And $farbe[$i+2]="rot" And $farbe[$i+3]="rot" Then $neues_game=MsgBox(4,$spieler2 & " hat gewonnen", "Neues Spiel?") If $neues_game=6 Then Run(@ScriptFullPath) Exit EndIf If $i=32 Then ExitLoop $i=$i+1 WEnd ;alle wagerechten 4er in der 6.Reihe $i=36 While 1 If $farbe[$i]="rot" And $farbe[$i+1]="rot" And $farbe[$i+2]="rot" And $farbe[$i+3]="rot" Then $neues_game=MsgBox(4,$spieler2 & " hat gewonnen", "Neues Spiel?") If $neues_game=6 Then Run(@ScriptFullPath) Exit EndIf If $i=39 Then ExitLoop $i=$i+1 WEnd ;alle schrägen 4er von der1.Reihe aus nach links unten $i=4 While 1 If $farbe[$i]="rot" And $farbe[$i+6]="rot" And $farbe[$i+12]="rot" And $farbe[$i+18]="rot" Then $neues_game=MsgBox(4,$spieler2 & " hat gewonnen", "Neues Spiel?") If $neues_game=6 Then Run(@ScriptFullPath) Exit EndIf If $i=7 Then ExitLoop $i=$i+1 WEnd ;alle schrägen 4er von der2.Reihe aus nach links unten $i=11 While 1 If $farbe[$i]="rot" And $farbe[$i+6]="rot" And $farbe[$i+12]="rot" And $farbe[$i+18]="rot" Then $neues_game=MsgBox(4,$spieler2 & " hat gewonnen", "Neues Spiel?") If $neues_game=6 Then Run(@ScriptFullPath) Exit EndIf If $i=14 Then ExitLoop $i=$i+1 WEnd ;alle schrägen 4er von der3.Reihe aus nach links unten $i=18 While 1 If $farbe[$i]="rot" And $farbe[$i+6]="rot" And $farbe[$i+12]="rot" And $farbe[$i+18]="rot" Then $neues_game=MsgBox(4,$spieler2 & " hat gewonnen", "Neues Spiel?") If $neues_game=6 Then Run(@ScriptFullPath) Exit EndIf If $i=21 Then ExitLoop $i=$i+1 WEnd ;alle schrägen 4er von der1.Reihe aus nach rechts unten $i=1 While 1 If $farbe[$i]="rot" And $farbe[$i+8]="rot" And $farbe[$i+16]="rot" And $farbe[$i+24]="rot" Then $neues_game=MsgBox(4,$spieler2 & " hat gewonnen", "Neues Spiel?") If $neues_game=6 Then Run(@ScriptFullPath) Exit EndIf If $i=4 Then ExitLoop $i=$i+1 WEnd ;alle schrägen 4er von der2.Reihe aus nach rechts unten $i=8 While 1 If $farbe[$i]="rot" And $farbe[$i+8]="rot" And $farbe[$i+16]="rot" And $farbe[$i+24]="rot" Then $neues_game=MsgBox(4,$spieler2 & " hat gewonnen", "Neues Spiel?") If $neues_game=6 Then Run(@ScriptFullPath) Exit EndIf If $i=11 Then ExitLoop $i=$i+1 WEnd ;alle schrägen 4er von der3.Reihe aus nach rechts unten $i=15 While 1 If $farbe[$i]="rot" And $farbe[$i+8]="rot" And $farbe[$i+16]="rot" And $farbe[$i+24]="rot" Then $neues_game=MsgBox(4,$spieler2 & " hat gewonnen", "Neues Spiel?") If $neues_game=6 Then Run(@ScriptFullPath) Exit EndIf If $i=18 Then ExitLoop $i=$i+1 WEnd EndFunc