diff --git a/src/app/board/board.component.html b/src/app/board/board.component.html
index 569890a..11895d3 100644
--- a/src/app/board/board.component.html
+++ b/src/app/board/board.component.html
@@ -3,6 +3,8 @@
+
+
current player: {{ player }}
Gewinner: {{ winner }}
@@ -10,3 +12,4 @@
+
diff --git a/src/app/board/board.component.ts b/src/app/board/board.component.ts
index 51ca2bb..1104a7f 100644
--- a/src/app/board/board.component.ts
+++ b/src/app/board/board.component.ts
@@ -21,6 +21,29 @@ export class BoardComponent implements OnInit {
this.resetGame();
}
+ trainUp(playerLearn) {
+ console.log('Train Called - to be more like ', playerLearn);
+
+ const AllMoves = this.history.map((board) => {
+ return board.map((v) => {
+ if (v === playerLearn) {
+ return 1;
+ } else if (v === null) {
+ return 0;
+ } else {
+ return -1;
+ }
+ });
+ });
+ console.log(AllMoves);
+ // let ai: AiService;
+ // let games = [];
+ // games.push(AllMoves);
+ // ai = new AiService();
+ // ai.trainOnGames(games, (data)=>{console.log(data)});
+
+ }
+
resetGame() {
this.winner = null;
this.draw = false;
@@ -34,7 +57,7 @@ export class BoardComponent implements OnInit {
}
playerPress(i: number) {
- if(this.winner != null) {
+ if (this.winner != null) {
this.resetGame();
return;
}