-
Notifications
You must be signed in to change notification settings - Fork 0
/
testtest.py
27 lines (18 loc) · 951 Bytes
/
testtest.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
from pieces import *
from copy import deepcopy
boardWithObjects = [[Empty(), Empty()], 1]
boardDeepCopy = deepcopy(boardWithObjects)
boardNormalCopy = boardWithObjects.copy()
print(f"normal[0] is original[0]: {boardNormalCopy[0] is boardWithObjects[0]}")
print(f"normal[1] is original[1]: {boardNormalCopy[1] is boardWithObjects[1]}")
print(f"deep[0] is original[0]: {boardDeepCopy[0] is boardWithObjects[0]}")
print(f"deep[1] is original[1]: {boardDeepCopy[1] is boardWithObjects[1]}")
boardWithObjects[0][0] = 4
boardWithObjects[1] = 5
print("")
print(f"normal[0] is original[0]: {boardNormalCopy[0] is boardWithObjects[0]}")
print(f"normal[1] is original[1]: {boardNormalCopy[1] is boardWithObjects[1]}")
print(f"deep[0] is original[0]: {boardDeepCopy[0] is boardWithObjects[0]}")
print(f"deep[1] is original[1]: {boardDeepCopy[1] is boardWithObjects[1]}")
#print(f"deep copy = {boardDeepCopy}")
#print(f"shallow copy = {boardNormalCopy}")