MCPcopy Create free account
hub / github.com/candybox2/candybox2.github.io / playTicTacToeSign

Method playTicTacToeSign

code/main/ATree.ts:350–366  ·  view source on GitHub ↗
(xIndex: number, yIndex: number)

Source from the content-addressed store, hash-verified

348 }
349
350 private playTicTacToeSign(xIndex: number, yIndex: number): void{
351 // Add the sign
352 this.ticTacToeBoard[xIndex][yIndex] = ATreeTicTacToeSign.X;
353
354 // Test end game conditions (we only make the squirrel play if nothing happens)
355 if(this.playTicTacToe_testEndGameConditions() == false){
356 // IA
357 var bestPosition: Pos = this.playTicTacToe_minimax(this.ticTacToeBoard, ATreeTicTacToeSign.O).bestPosition;
358 this.ticTacToeBoard[bestPosition.x][bestPosition.y] = ATreeTicTacToeSign.O;
359 // Test end game conditions
360 this.playTicTacToe_testEndGameConditions();
361 }
362
363 // Update
364 this.update();
365 this.getGame().updatePlace();
366 }
367
368 private reward1(): void{
369 this.getGame().getCandies().add(20);

Callers

nothing calls this directly

Calls 5

playTicTacToe_minimaxMethod · 0.95
updateMethod · 0.95
updatePlaceMethod · 0.80
getGameMethod · 0.45

Tested by

no test coverage detected