-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathchess_engine.py
60 lines (55 loc) · 1.67 KB
/
chess_engine.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
58
59
60
import json
import random
class Piece:
def __init__(self, Unit, Army, StartingPosition):
self.id = str(round(random.random() * (10**6)))
self.unit = Unit
self.army = Army
self.startingPosition = StartingPosition
self.currentPosition = StartingPosition
class Game:
def __init__(self):
self.hasBeenBegun = False
self.hasBeenCompleted = False
self.board = "standard"
self.rules = "standard"
self.moveHistory = []
self.allPieces = [
Piece("pawn", "white", "a2"),
Piece("pawn", "white", "b2"),
Piece("pawn", "white", "c2"),
Piece("pawn", "white", "d2"),
Piece("pawn", "white", "e2"),
Piece("pawn", "white", "f2"),
Piece("pawn", "white", "g2"),
Piece("pawn", "white", "h2"),
Piece("rook", "white", "a1"),
Piece("knight","white", "b1"),
Piece("bishop","white", "c1"),
Piece("queen", "white", "d1"),
Piece("king", "white", "e1"),
Piece("bishop","white", "f1"),
Piece("knight","white", "g1"),
Piece("rook", "white", "h1"),
Piece("pawn", "black", "a7"),
Piece("pawn", "black", "b7"),
Piece("pawn", "black", "c7"),
Piece("pawn", "black", "d7"),
Piece("pawn", "black", "e7"),
Piece("pawn", "black", "f7"),
Piece("pawn", "black", "g7"),
Piece("pawn", "black", "h7"),
Piece("rook", "black", "a8"),
Piece("knight","black", "b8"),
Piece("bishop","black", "c8"),
Piece("queen", "black", "d8"),
Piece("king", "black", "e8"),
Piece("bishop","black", "f8"),
Piece("knight","black", "g8"),
Piece("rook", "black", "h8")
]
print("Checkpoint A.")
input()
g = Game()
print("Checkpoint B.")
input()