-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtestBoard.py
77 lines (46 loc) · 1.28 KB
/
testBoard.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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
from board import Board
from piece.torre import Torre
from piece.alfil import Alfil
from piece.caballo import Caballo
from piece.reina import Reina
from piece.rey import Rey
from piece.peon import Peon
from coord import Coord
from rich.console import Console
from rich.text import Text
console = Console()
texto = Text("ddfdffddf", style="bold red")
tablero = Board()
p1 = Peon(1)
p1.clase = "a"
p1.console_color = "blue"
p2 = Torre()
p2.clase = "b"
p2.console_color = "green"
tablero.set_ficha(p1, Coord(4, 4))
tablero.set_ficha(p2, Coord(5, 2))
p1.spread_influence(tablero)
p2.spread_influence(tablero)
space = tablero.get_ficha(Coord(5, 4))
console.print(tablero.view)
'''
print(p1)
print(p2)
print("+++++++++++++++++++++++++++++++++++++++++++++++")
p1.make_mov(space, tablero)
print(tablero)
print(p1)
print(str(p2))
'''
'''
def max_value_off_string(data: str) -> int:
max_value: int = 0
len_data: int = len(data)
for index in range(len_data):
n_count_left: int = data.count("0", 0, index)
n_count_right: int = data.count("1", index, len_data)
value_actual: int = n_count_left + n_count_right
max_value = max(max_value, value_actual)
return max_value
entrada: str = "011101"
print(max_value_off_string(entrada))'''