-
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathmain.py
57 lines (41 loc) · 1.13 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/usr/bin/env python3
########################################################################
# JeffProd Simple Python Chess Program
########################################################################
# AUTHOR : Jean-Francois GAZET
# WEB : http://www.jeffprod.com
# TWITTER : @JeffProd
# MAIL : jeffgazet@gmail.com
# LICENCE : GNU GENERAL PUBLIC LICENSE Version 2, June 1991
########################################################################
# Import object classes
from board import *
from engine import *
b=Board()
e=Engine()
while(True):
b.render()
c=input('>>> ')
if(c=='quit' or c=='exit'):
exit(0)
elif(c=='undomove'):
e.undomove(b)
elif('setboard' in c):
e.setboard(b,c)
elif(c=='getboard'):
e.getboard(b)
elif(c=='go'):
e.search(b)
elif(c=='new'):
e.newgame(b)
elif(c=='bench'):
e.bench(b)
elif('sd ' in c):
e.setDepth(c)
elif('perft ' in c):
e.perft(c,b)
elif(c=='legalmoves'):
e.legalmoves(b)
else:
# coup à jouer ? ex : e2e4
e.usermove(b,c)