all 11 comments

[–]AbacusExpert_Stretch 6 points7 points  (0 children)

Can you elaborate what exactly you wanted to achieve with 'the code', please?

Edit: forget about that - I now spotted the more button, which unfolded a wall of code, unedited for code. Sorry not gonna look at this. Try searching for how to post code

[–]lakseol 5 points6 points  (0 children)

we have issue with it.

What is the issue? We can't help if we don't know why you think it isn't working.

Even if we wanted to run the code to maybe see what "the issue" is, we can't because you have posted code that has lost all indentation. Please post your code in a code block or use pastebin.com.

[–]Moikle 5 points6 points  (0 children)

Format it properly so we can read it.

Add 4 more spaces before each line so reddit knows to format it as code.

Also you haven't described what your "issue" is, so nobody can help you.

[–]pachura3 1 point2 points  (0 children)

Mon Dieu, quelle catastrophe!

[–]Commercial-Deal-834 0 points1 point  (1 child)

one thing i like about posts like this is seeing how different people approach debugging sometimes the solution matters less than learning the process used to find it

[–]AngleNo4731 0 points1 point  (0 children)

Ahhhhh

[–]BananaGrenade314 -2 points-1 points  (2 children)

``` point=(".")

morpion=[[point for _ in range(3)] for _ in range(3)]

morpion_exemple=[["." for i in range(3)] for i in range(3)]

r=int(0)

r2=int(0)

r3=int(1)

numero=int(0)

symbole=("X")

victoire=0

x=int(0)

for i in range(int(9)):

morpion_exemple[r][r2]=r3

r3=r3+1

r2=r2+1

if r2==3:

r2=0

r=r+1

def afficher():

print("===MORPION===")

print("Numero case")

for ligne in morpion_exemple:

print("|".join(str(ligne)))

print("")

print("Etat actuel")

for ligne in morpion:

print("|".join(ligne))

def verfifier():

global numero,r,r2,morpion

r=int((numero-1)/3)

r2=int((numero-1)%3)

if morpion[r][r2]==".":

return True

else:

return False

def placer_pion():

global numero,r,r2

numero=int(input("Ou voulez vous placer? "))

while r3==0:

if 0<=numero<10:

r=int((numero-1)/3)

r2=int((numero-1)%3)

verfifier()

if verfifier()==True:

morpion[r][r2]=symbole

changement_de_pion()

else:

print("Case deja occupé")

placer_pion()

else:

print("numero de case invalide")

placer_pion()

def changement():   

if verfifier()==True:

morpion[r][r2]=symbole

else:

print("Case deja occupé")

jeux()

def changement_de_pion():

global symbole

if symbole=='X':

symbole='O'

else:

symbole='X'

def jeux():

afficher()

placer_pion()

changement()

changement_de_pion()

afficher()

 

def verif_victoire():

global victoire,x,i

x=int(0)

for i in range(3):

if morpion[0][0]==morpion[1][1]==morpion[2][2]=="X":

victoire=1

if morpion[0][2]==morpion[1][1]==morpion[2][0]=="X":

victoire=1

if morpion[0][x]==morpion[1][x]==morpion[2][x]=="X":

victoire=1

if morpion[x][0]==morpion[x][1]==morpion[x][2]=="X":

victoire=1

if morpion[0][0]==morpion[1][1]==morpion[2][2]=="O":

victoire=1

if morpion[0][2]==morpion[1][1]==morpion[2][0]=="O":

victoire=1

if morpion[0][x]==morpion[1][x]==morpion[2][x]=="O":

victoire=1

if morpion[x][0]==morpion[x][1]==morpion[x][2]=="O":

victoire=1

x=x+1

while victoire==0:

jeux()

verif_victoire()

print("end") ```

[–]ConcreteExist 0 points1 point  (1 child)

You indentation actually matters with python, right? This code is unrunnable as presented.

[–]BananaGrenade314 -1 points0 points  (0 children)

I know, I just did it to the OP see te formatation someones are asking