Skip to content

Commit

Permalink
Merge pull request #55 from VincentAuriau/actions/black
Browse files Browse the repository at this point in the history
Format Python code with psf/black push
  • Loading branch information
VincentAuriau authored Nov 19, 2023
2 parents ff5db54 + 74dc6ec commit 9b560aa
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 19 deletions.
7 changes: 6 additions & 1 deletion pyalapin/interface/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,11 @@ def build(self):
"""
Builds the game and the display board along with it.
"""
game = ChessGame(automatic_draw=False, ai=self.play_with_ai, player1=self.w_player, player2=self.b_player)
game = ChessGame(
automatic_draw=False,
ai=self.play_with_ai,
player1=self.w_player,
player2=self.b_player,
)
print("game created")
return BoardInterface(game)
1 change: 0 additions & 1 deletion pyalapin/player/stockfish_player.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,3 @@ def time_to_play(self, board):
move = Move(self, board, board.get_cell(*start), board.get_cell(*end))
print(move, board.get_cell(*start), board.get_cell(*end))
return move

34 changes: 17 additions & 17 deletions tests/stockfish_localtest.py
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
if __name__ == "__main__":
import sys
import sys

sys.path.append("../pyalapin")
import os
import stockfish
sys.path.append("../pyalapin")
import os
import stockfish

from pyalapin.player.stockfish_player import StockfishPlayer
from pyalapin.player.player import Player
from pyalapin.engine import ChessGame
from pyalapin.player.stockfish_player import StockfishPlayer
from pyalapin.player.player import Player
from pyalapin.engine import ChessGame

from settings import settings
from settings import settings

sfp = StockfishPlayer(settings["stockfish_path"], white_side=True)
game = ChessGame()
co1, co2 = sfp.get_move_from_fen(game.to_fen())
game.board.draw()
sfp = StockfishPlayer(settings["stockfish_path"], white_side=True)
game = ChessGame()
co1, co2 = sfp.get_move_from_fen(game.to_fen())
game.board.draw()

# sfp.quit()
from pyalapin.interface import ChessApp
sfp = StockfishPlayer(settings["stockfish_path"], white_side=False)
app = ChessApp(w_player=Player(True), b_player=sfp, play_with_ai=True)
app.run()
# sfp.quit()
from pyalapin.interface import ChessApp

sfp = StockfishPlayer(settings["stockfish_path"], white_side=False)
app = ChessApp(w_player=Player(True), b_player=sfp, play_with_ai=True)
app.run()

0 comments on commit 9b560aa

Please sign in to comment.