-2
def movinteiros(a):
b=[]
for i in a:
if i=="c":
b.append([-1,0])
elif i=="b":
b.append([1,0])
elif i=="d":
b.append([0,1])
else:
b.append([0,1])
return b
opcao=int(input("Opcao de jogo:"))
n=int(input("Tamanho do tabuleiro:"))
matriz=[int(x) for x in input("Tabuleiro inicial:").split()]
If the entrees are:
1
2
1 2
3 0
ce
the function trocapos
should return:
I advise you to carefully read the community guidelines of how to ask a good question.
– user148754
This entry seems to be insufficient to reproduce the problem. When placing the cited entries the program still asks for "Movements".
– Woss
For that entrance,
matriz
is getting[1, 2, [3, 0]]
. Should she be like this? Or should she be[[1, 2], [3, 0]]
?– Woss
should be [[1, 2], [3, 0]]
– Mateus
If the entries are: 1 2 ce 1 2 3 0
– Mateus
Then you must have realized that the shape you’ve generated
matriz
is not correct.– Woss
Please don’t make more work for other people by vandalizing your posts. By posting on Stack Overflow, you’ve granted a non-revocable right, under the CC BY-SA 3.0 Icense for SO to Distribute that content. By SO policy, any vandalism will be reverted. If you want to know more about deleting a post, Pread more How does deleting work?
– iBooot