# Conflicts:
#	Tic-Tac-Toe/TicTacToe.class
#	Tic-Tac-Toe/TicTacToe.ctxt
This commit is contained in:
artem.didytschuk 2020-09-03 18:41:30 +02:00
commit abdd355e8f
6 changed files with 54 additions and 32 deletions

Binary file not shown.

View File

@ -2,18 +2,22 @@
comment0.target=Spieler
comment1.params=pName
comment1.target=Spieler(java.lang.String)
comment10.params=
comment10.target=int\ getRundenAnzahl()
comment2.params=
comment2.target=int[]\ spielzug()
comment3.params=pSiege
comment3.target=void\ setSiege(int)
comment4.params=pNiederlagen
comment4.target=void\ setNiederlagen(int)
comment5.params=pRundenAnzahl
comment5.target=void\ setRundenAnzahl(int)
comment6.params=
comment6.target=int\ getSiege()
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=int\ getNiederlagen()
comment7.target=java.lang.String\ getName()
comment8.params=
comment8.target=int\ getRundenAnzahl()
numComments=9
comment8.target=int\ getSiege()
comment9.params=
comment9.target=int\ getNiederlagen()
numComments=11

View File

@ -4,8 +4,10 @@ public class Spieler {
int siege;
int niederlagen;
int rundenAnzahl;
double siegesrate;
Scanner konsole = new Scanner(System.in);
public Spieler(String pName) {
public Spieler(String pName)
{
name = pName;
}
@ -16,6 +18,13 @@ public class Spieler {
return new int[] {pXKord, pYKord};
}
public double siegesrateBestimmen()
{
int zwischenergebnis;
zwischenergebnis = 100 / rundenAnzahl;
siegesrate = zwischenergebnis * siege;
return siegesrate;
}
//Set-Methoden
public void setSiege(int pSiege)
{
@ -33,6 +42,11 @@ public class Spieler {
}
//Get-Methoden
public String getName()
{
return name;
}
public int getSiege()
{
return siege;

View File

@ -8,6 +8,4 @@ comment3.params=
comment3.target=void\ druckeSpielfeld()
comment4.params=
comment4.target=void\ spielStarten()
comment5.params=
comment5.target=boolean\ spielVorbei()
numComments=6
numComments=5

View File

@ -16,11 +16,17 @@ public class TicTacToe {
public void spielErstellen(String sp1name,String sp2name){
Spieler spieler1 = new Spieler(sp1name);
Spieler spieler2 = new Spieler(sp2name);
}
private void druckeSpielfeld(){
public void druckeSpielfeld(){
System.out.println (" ");
System.out.println (" " + spielfeld[0][2] + " | " + spielfeld[1][2] + " | "+ spielfeld[2][2] + " ");
System.out.println ("———+———+———");
System.out.println (" " + spielfeld[0][1] + " | " + spielfeld[1][1] + " | "+ spielfeld[2][1] + " ");
System.out.println ("———+———+———");
System.out.println (" " + spielfeld[0][0] + " | " + spielfeld[1][0] + " | "+ spielfeld[2][0] + " ");
System.out.println (" ");
}
public void spielStarten(){

View File

@ -2,18 +2,18 @@
dependency1.from=TicTacToe
dependency1.to=Spieler
dependency1.type=UsesDependency
editor.fx.0.height=738
editor.fx.0.width=816
editor.fx.0.x=232
editor.fx.0.y=82
objectbench.height=93
editor.fx.0.height=1056
editor.fx.0.width=1936
editor.fx.0.x=-8
editor.fx.0.y=-8
objectbench.height=98
objectbench.width=760
package.divider.horizontal=0.6
package.divider.vertical=0.8003992015968064
package.editor.height=394
package.editor.width=636
package.editor.x=282
package.editor.y=204
package.divider.vertical=0.79
package.editor.height=388
package.editor.width=649
package.editor.x=356
package.editor.y=214
package.frame.height=600
package.frame.width=800
package.numDependencies=1
@ -31,12 +31,12 @@ target1.name=TicTacToe
target1.showInterface=false
target1.type=ClassTarget
target1.width=90
target1.x=70
target1.y=10
target1.x=150
target1.y=30
target2.height=50
target2.name=Spieler
target2.showInterface=false
target2.type=ClassTarget
target2.width=80
target2.x=170
target2.y=10
target2.x=500
target2.y=20