File tree 1 file changed +5
-5
lines changed
1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change 4
4
from plugin import plugin
5
5
from stockfish import Stockfish
6
6
7
+
7
8
@plugin ('chess' )
8
9
class Chess ():
9
10
def __call__ (self , jarvis , s ):
10
11
fish = Stockfish ()
11
- while (True ):
12
+ while (True ):
12
13
jarvis .say ("Choose your option:" )
13
14
jarvis .say ("1. Moves" )
14
15
jarvis .say ("2. FEN" )
15
16
option = jarvis .input ("Choice: " )
16
- if (option == '1' ):
17
+ if (option == '1' ):
17
18
moves = jarvis .input ("Moves: " )
18
19
print (moves .split ())
19
20
fish .set_position (moves .split ())
20
21
jarvis .say (fish .get_best_move ())
21
- elif (option == '2' ):
22
+ elif (option == '2' ):
22
23
fen = jarvis .input ("FEN: " )
23
- if (fish .is_fen_valid (fen )):
24
+ if (fish .is_fen_valid (fen )):
24
25
fish .set_fen_position (fen )
25
26
jarvis .say (fish .get_best_move ())
26
27
else :
27
28
jarvis .say ("Invalid option\n " )
28
-
You can’t perform that action at this time.
0 commit comments