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.target=Spieler(java.lang.String)
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.target=int[]\ spielzug()
comment3.params=
comment3.target=double\ siegesrateBestimmen()
comment4.params=pSiege
comment4.target=void\ setSiege(int)
comment5.params=pNiederlagen
comment5.target=void\ setNiederlagen(int)
comment6.params=pRundenAnzahl
comment6.target=void\ setRundenAnzahl(int)
comment7.params=
comment7.target=java.lang.String\ getName()
comment8.params=
comment8.target=int\ getSiege()
comment4.params=
comment4.target=void\ sieg()
comment5.params=
comment5.target=void\ niederlage()
comment6.params=pSiege
comment6.target=void\ setSiege(int)
comment7.params=pNiederlagen
comment7.target=void\ setNiederlagen(int)
comment8.params=pRundenAnzahl
comment8.target=void\ setRundenAnzahl(int)
comment9.params=
comment9.target=int\ getNiederlagen()
numComments=11
comment9.target=java.lang.String\ getName()
numComments=13

Binary file not shown.

View File

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

View File

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