#triky
from turtle import*
speed(40)
pensize(4)
pu()
goto(-200,-200)
write('123\n456\n789',font=("arial",18,"bold"))
goto(-200,200)
pd()
fd(300)
rt(90)
fd(300)
rt(90)
fd(300)
rt(90)
fd(300)
rt(90)
fd(100)
rt(90)
fd(300)
pu()
lt(90)
fd(100)
lt(90)
pd()
fd(300)
pu()
goto(-200,100)
pd()
rt(90)
fd(300)
pu()
goto(-200,0)
pd()
fd(300)
pu()
contador=1
n1=0
n2=0
n3=0
n4=0
n5=0
n6=0
n7=0
n8=0
n9=0
sw=0
while contador <=9:
if contador<10:
n=numinput('','digite el numero donde quiere la x')
if n ==1:
goto(-160,130)
write('x',font = ("arial",30,"bold"))
n1=2
if n ==2:
goto(-60,130)
write('x',font = ("arial",30,"bold"))
n2=2
if n ==3:
goto(40,130)
write('x',font = ("arial",30,"bold"))
n3=2
if n ==4:
goto(-160,30)
write('x',font = ("arial",30,"bold"))
n4=2
if n ==5:
goto(-60,30)
write('x',font = ("arial",30,"bold"))
n5=2
if n ==6:
goto(40,30)
write('x',font = ("arial",30,"bold"))
n6=2
if n ==7:
goto(-160,-70)
write('x',font = ("arial",30,"bold"))
n7=2
if n ==8:
goto(-60,-70)
write('x',font = ("arial",30,"bold"))
n8=2
if n ==9:
goto(40,-70)
write('x',font = ("arial",30,"bold"))
n9=2
contador= contador +1
#####################################33
if n1==2 and n4==2 and n7==2 and sw ==0:
goto(-150,200)
rt(90)
pd()
fd(300)
contador=10
sw=1
write('!!!TRIKI!!!!!',font=('arial',50,'bold'))
if n1==2 and n2==2 and n3==2 and sw ==0:
goto(-200,150)
pd()
fd(300)
contador=10
sw=1
if n1==2 and n5==2 and n9==2 and sw ==0:
goto(-200,200)
pd()
rt(45)
fd(430)
contador =10
sw=1
if n4==2 and n5==2 and n6==2 and sw ==0:
goto(-200,50)
pd()
fd(300)
contador=10
sw=1
if n7==2 and n8==2 and n9==2 and sw ==0:
goto(-200,-50)
pd()
fd(300)
contador=10
sw=1
if n2==2 and n5==2 and n8==2 and sw ==0:
goto(-50,200)
rt(90)
pd()
fd(300)
contador=10
sw=1
if n3==2 and n6==2 and n9==2 and sw ==0:
goto(50,200)
rt(90)
pd()
fd(300)
contador=10
sw=1
if n3==2 and n5==2 and n7==2 and sw ==0:
goto(100,200)
rt(135)
pd()
fd(430)
contador=10
sw=1
########################################################3
if contador <10 :
n=numinput('','digite el numero donde quiere la O')
if n ==1:
goto(-160,130)
write('O',font = ("arial",30,"bold"))
n1=1
if n ==2:
goto(-60,130)
write('O',font = ("arial",30,"bold"))
n2=1
if n ==3:
goto(40,130)
write('O',font = ("arial",30,"bold"))
n3=1
if n ==4:
goto(-160,30)
write('O',font = ("arial",30,"bold"))
n4=1
if n ==5:
goto(-60,30)
write('O',font = ("arial",30,"bold"))
n5=1
if n ==6:
goto(40,30)
write('O',font = ("arial",30,"bold"))
n6=1
if n ==7 :
goto(-160,-70)
write('O',font = ("arial",30,"bold"))
n7=1
if n ==8:
goto(-60,-70)
write('O',font = ("arial",30,"bold"))
n8=1
if n ==9:
goto(40,-70)
write('O',font = ("arial",30,"bold"))
n9=1
contador = contador +1
#########################################3
if n1==1 and n4==1 and n7==1 and sw ==0:
goto(-150,200)
rt(90)
pd()
fd(300)
contador=10
sw=1
if n1==1 and n2==1 and n3==1 and sw ==0:
goto(-200,150)
pd()
fd(300)
contador=10
sw=1
if n1==1 and n5==1 and n9==1 and sw ==0:
goto(-200,200)
pd()
rt(45)
fd(430)
contador =10
sw=1
if n4==1 and n5==1 and n6==1 and sw ==0:
goto(-200,50)
pd()
fd(300)
sw=1
contador=10
if n7==1 and n8==1 and n9==1 and sw ==0:
goto(-200,-50)
pd()
fd(300)
contador=10
sw=1
if n2==1 and n5==1 and n8==1 and sw ==0:
goto(-50,200)
rt(90)
pd()
fd(300)
contador=10
sw=1
if n3==1 and n6==1 and n9==1 and sw ==0:
goto(50,200)
rt(90)
pd()
fd(300)
contador=10
sw=1
if n3==1 and n5==1 and n7==1 and sw ==0:
goto(100,200)
rt(135)
pd()
fd(430)
contador=10
sw=1
done()