Skip to content

Commit

Permalink
Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
gaganchandan committed Apr 29, 2023
1 parent e233609 commit 91376fc
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions jarviscli/plugins/chess.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,25 @@
from plugin import plugin
from stockfish import Stockfish


@plugin('chess')
class Chess():
def __call__(self, jarvis, s):
fish = Stockfish()
while(True):
while (True):
jarvis.say("Choose your option:")
jarvis.say("1. Moves")
jarvis.say("2. FEN")
option = jarvis.input("Choice: ")
if(option == '1'):
if (option == '1'):
moves = jarvis.input("Moves: ")
print(moves.split())
fish.set_position(moves.split())
jarvis.say(fish.get_best_move())
elif(option == '2'):
elif (option == '2'):
fen = jarvis.input("FEN: ")
if(fish.is_fen_valid(fen)):
if (fish.is_fen_valid(fen)):
fish.set_fen_position(fen)
jarvis.say(fish.get_best_move())
else:
jarvis.say("Invalid option\n")

0 comments on commit 91376fc

Please sign in to comment.