SpielErstellen() entfernt

This commit is contained in:
artem.didytschuk
2020-09-03 19:10:35 +02:00
parent cf39ef981c
commit 822f6d8cf5
5 changed files with 37 additions and 27 deletions

Binary file not shown.

View File

@@ -3,21 +3,25 @@ comment0.target=Spieler
comment1.params=pName comment1.params=pName
comment1.target=Spieler(java.lang.String) comment1.target=Spieler(java.lang.String)
comment10.params= comment10.params=
comment10.target=int\ getRundenAnzahl() comment10.target=int\ getSiege()
comment11.params=
comment11.target=int\ getNiederlagen()
comment12.params=
comment12.target=int\ getRundenAnzahl()
comment2.params= comment2.params=
comment2.target=int[]\ spielzug() comment2.target=int[]\ spielzug()
comment3.params= comment3.params=
comment3.target=double\ siegesrateBestimmen() comment3.target=double\ siegesrateBestimmen()
comment4.params=pSiege comment4.params=
comment4.target=void\ setSiege(int) comment4.target=void\ sieg()
comment5.params=pNiederlagen comment5.params=
comment5.target=void\ setNiederlagen(int) comment5.target=void\ niederlage()
comment6.params=pRundenAnzahl comment6.params=pSiege
comment6.target=void\ setRundenAnzahl(int) comment6.target=void\ setSiege(int)
comment7.params= comment7.params=pNiederlagen
comment7.target=java.lang.String\ getName() comment7.target=void\ setNiederlagen(int)
comment8.params= comment8.params=pRundenAnzahl
comment8.target=int\ getSiege() comment8.target=void\ setRundenAnzahl(int)
comment9.params= comment9.params=
comment9.target=int\ getNiederlagen() comment9.target=java.lang.String\ getName()
numComments=11 numComments=13

Binary file not shown.

View File

@@ -1,11 +1,11 @@
#BlueJ class context #BlueJ class context
comment0.target=TicTacToe comment0.target=TicTacToe
comment1.params= comment1.params=sp1name\ sp2name
comment1.target=TicTacToe() comment1.target=TicTacToe(java.lang.String,\ java.lang.String)
comment2.params=sp1name\ sp2name comment2.params=
comment2.target=void\ spielErstellen(java.lang.String,\ java.lang.String) comment2.target=void\ druckeSpielfeld()
comment3.params= comment3.params=
comment3.target=void\ druckeSpielfeld() comment3.target=void\ spielStarten()
comment4.params= comment4.params=
comment4.target=void\ spielStarten() comment4.target=boolean\ spielVorbei()
numComments=5 numComments=5

View File

@@ -8,16 +8,14 @@ public class TicTacToe {
Random rand = new Random(); Random rand = new Random();
Spieler spieler1; Spieler spieler1;
Spieler spieler2; Spieler spieler2;
public TicTacToe() { public TicTacToe(String sp1name, String sp2name) {
spielfeld = new String[3][3]; spielfeld = new String[3][3];
running = false; running = false;
spieler1 = new Spieler(sp1name);
spieler2 = new Spieler(sp2name);
} }
public void spielErstellen(String sp1name,String sp2name){
Spieler spieler1 = new Spieler(sp1name);
Spieler spieler2 = new Spieler(sp2name);
}
public void druckeSpielfeld(){ public void druckeSpielfeld(){
System.out.println (" "); System.out.println (" ");
@@ -62,14 +60,22 @@ public class TicTacToe {
System.out.println("Tippe zuerst X Koordinate, dann Y Koordinate von unten links!"); System.out.println("Tippe zuerst X Koordinate, dann Y Koordinate von unten links!");
kord=spieler2.spielzug(); kord=spieler2.spielzug();
spielfeld[kord[0]-1][kord[1]-1]="X"; spielfeld[kord[0]-1][kord[1]-1]="X";
spielVorbei(); if(spielVorbei()){
spieler1.sieg();
spieler2.niederlage();
return;
}
//Spieler1 am Zug //Spieler1 am Zug
druckeSpielfeld(); druckeSpielfeld();
System.out.println(spieler1.getName()+" ist an der Reihe!"); System.out.println(spieler1.getName()+" ist an der Reihe!");
System.out.println("Tippe zuerst X Koordinate, dann Y Koordinate von unten links!"); System.out.println("Tippe zuerst X Koordinate, dann Y Koordinate von unten links!");
kord=spieler1.spielzug(); kord=spieler1.spielzug();
spielfeld[kord[0]-1][kord[1]-1]="O"; spielfeld[kord[0]-1][kord[1]-1]="O";
spielVorbei(); if(spielVorbei()){
spieler2.sieg();
spieler1.niederlage();
return;
}
} }
} }