-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest
More file actions
68 lines (43 loc) · 1.58 KB
/
test
File metadata and controls
68 lines (43 loc) · 1.58 KB
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
def pruebaSolucion(row,size):
matrixMatrix=[]
for i in range(size):
j=0
while j<size:
indiceOtro=0
matrizResult=[]
print(j,"<--j")
if row[i]+j<=size:
print(indiceOtro)
if row[i]+j>row[i]:
for k in range(j):
matrizResult.insert(k,0)
while indiceOtro<row[i]:
matrizResult.append(1)
indiceOtro+=1
newSize=size-j
print(newSize)
while indiceOtro<newSize:
matrizResult.append(0)
indiceOtro+=1
else:
while indiceOtro<row[i]:
matrizResult.insert(indiceOtro,1)
indiceOtro+=1
while indiceOtro<size:
matrizResult.insert(indiceOtro,0)
indiceOtro+=1
matrixMatrix.append(matrizResult)
j+=1
matrixMatrix.append("-")
for k in range(len(matrixMatrix)):
print(matrixMatrix[k])
matricesFinales=[]
for k in range(len(matrixMatrix)):
matrices=[]
input("enter")
""" Tengo que intentar alpicar el metodo de detras para delante, de esta forma debo ir
preguntando uno a uno generando matrices nuevas a partir de lo que tenemos"""
#####MAIN
col = [2,3,4,2,1]
row = [2,3,3,3,1]
pruebaSolucion(row,5)