Skip to content

Commit

Permalink
removed console logging
Browse files Browse the repository at this point in the history
  • Loading branch information
eeoooue committed Jun 7, 2023
1 parent 3d4619c commit 719b0c8
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 10 deletions.
1 change: 0 additions & 1 deletion docs/PromotionCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ export class PromotionCard {
return card;
}
submitChoice(text) {
console.log(`you chose ${text}`);
this.game.submitPromotionChoice(text);
this.element.remove();
}
Expand Down
4 changes: 0 additions & 4 deletions docs/chessgame.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,16 +201,13 @@ export class ChessGame {
this.checkGameOver();
}
checkGameOver() {
console.log(`there are ${this.possibleMoves} move(s) available`);
if (this.possibleMoves == 0) {
const loser = this.getTurnPlayer();
const king = this.getKingOfColour(loser);
if (king.threatened) {
console.log("that's checkmate!");
this.state = "checkmate";
}
else {
console.log("it's a stalemate.");
this.state = "stalemate";
}
}
Expand All @@ -227,7 +224,6 @@ export class ChessGame {
if (movingPiece instanceof Pawn) {
if (end.i == 0 || end.i == 7) {
this.state = "promotion";
console.log("its promo time");
}
}
}
Expand Down
1 change: 0 additions & 1 deletion src/PromotionCard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ export class PromotionCard {

submitChoice(text: string){

console.log(`you chose ${text}`)
this.game.submitPromotionChoice(text);
this.element.remove();
}
Expand Down
4 changes: 0 additions & 4 deletions src/chessgame.ts
Original file line number Diff line number Diff line change
Expand Up @@ -272,17 +272,14 @@ export class ChessGame implements Subject {

checkGameOver(): void {

console.log(`there are ${this.possibleMoves} move(s) available`)
if (this.possibleMoves == 0) {

const loser = this.getTurnPlayer();
const king = this.getKingOfColour(loser);

if (king.threatened) {
console.log("that's checkmate!")
this.state = "checkmate";
} else {
console.log("it's a stalemate.")
this.state = "stalemate";
}
}
Expand All @@ -305,7 +302,6 @@ export class ChessGame implements Subject {
if (movingPiece instanceof Pawn){
if (end.i == 0 || end.i == 7){
this.state = "promotion";
console.log("its promo time")
}
}

Expand Down

0 comments on commit 719b0c8

Please sign in to comment.