ضرب المثل ها

نام و نام خانوادگی:یسنا بهرامی

دوره:کاربردی(پایتون)

 

import turtle
from random import*

turtle.screensize(canvwidth=900, canvheight=900,bg="snow")
answer = 'y'
while answer == 'y':
    level = turtle.textinput("Select a level : ", "1.Easy , 2.Hard (number)")
    n = 3
    if level == '1':
#marhale-1
#level
        t8 = turtle.Turtle()
        t8.speed(10)
        t8.hideturtle()
        t8.penup()
        t8.goto(180,200)
        t8.color("yellowgreen")
        if n == 1:
            t12.clear()
            t6.clear()
        if n == 0:
            t5.clear()
            t11.clear()
        t8.write("Level: ",font = ("Arial" , 22 , "normal"))
        t8.goto(260,200)
        t8.color("violetred4")
        t8.write("1",font = ("Arial" , 22 , "normal"))
#data
        easy = ["اتوبوس","لاکپشت","افسرده"]
#ijade dash va print an
        name = easy[0]
        charNumber = len(easy[0])
        userList=["_"]*charNumber
        t1 = turtle.Turtle()
        t1.speed(10)
        t1.hideturtle()
        t1.penup()
        t1.goto(-350,-200)
        t1.color("cyan4")
        t1.write(userList,font = ("Arial",20,"normal"))   
#print emoji ha    
        t2 = turtle.Turtle()
        t2.speed(10)
        t2.hideturtle()
        t2.penup()
        t2.goto(-150,30)
        t2.color("black")        
        t2.write("O",font=("Arial",50,"normal"))
        t2.goto(-70,30)
        t2.write("\N{victory hand}",font=("Arial",50,"normal"))
        t2.goto(10,30)
        t2.write("\N{kissing face with smiling eyes}",font=("Arial",50,"normal"))
#print chance ha           
        chance1 = 5
        t3 = turtle.Turtle()
        t3.speed(10)
        t3.hideturtle()
        t3.penup()
        t3.color("deeppink")
        t3.goto(-350,200)
        t3.write("Chances: ",font = ("Arial" , 22 , "normal"))
        t4 = turtle.Turtle()
        t4.speed(10)
        t4.hideturtle()
        t4.penup()
        t4.goto(-220,200)
        t4.color("darkgoldenrod")
        t4.write(chance1,font =( "Arial",22,"normal"))   
#barresi vojod dade 
        while userList.count("_")>0:
            guess = turtle.textinput("Level 1 :","guess a character: ")
        
            for i in range(charNumber):
                if guess == name[i]:
                    userList[i]=guess
                
            if name.count(guess) == 0:
                chance1 -= 1
            
                if chance1 == 0:
                    n = 0
                    t5 = turtle.Turtle()
                    t5.hideturtle()
                    t5.penup()
                    t2.clear()
                    t5.goto(-150,30)
                    t5.color("red")
                    t5.speed('slowest')
                    t5.write("Sorry you lost! " , font = ("Arial" , 40 ,"normal"))
                    t5.goto(-100,0)
                    t5.write("Correct answer: ",font = ("Arial" , 20 ,"normal"))
                    t11 = turtle.Turtle()
                    t11.hideturtle()
                    t11.penup()
                    t11.goto(100,0)
                    t11.color("violetred4")
                    t11.speed('slowest')
                    t11.write(name,font=("Arial",20,"normal"))
                    break
                
                t4.clear()
                t4.goto(-220,200)
                t4.write(chance1,font =( "Arial",22,"normal"))
                
            t1.clear()
            t1.write(userList,font=("Arial",16,"normal"))
        
        if chance1 != 0:
            n = 1
            t6 = turtle.Turtle()
            t6.hideturtle()
            t6.penup()
            t2.clear()
            t6.goto(-150,30)
            t6.color("green")
            t6.write("*You win :)* ",font = ("Arial" , 50 ,"normal"))
            t6.goto(-150,0)
            t6.color("springgreen2")
            t6.write( " Your rating from this step : ",font =( "Arial",22,"normal"))
            t12 = turtle.Turtle()
            t12.hideturtle()
            t12.penup()
            t12.color("snow4")
            t12.goto(210,0)
            t12.write(chance1,font =( "Arial",22,"normal"))
#emtyaz
        t7 = turtle.Turtle()
        t7.speed(10)
        t7.hideturtle()
        t7.penup()
        t7.goto(-110,200)
        t7.color("salmon")
        t7.write("Your score: ",font =( "Arial",22,"normal"))
        t9 = turtle.Turtle()
        t9.hideturtle()
        t9.penup()
        t9.goto(50,200)
        t9.color("slateblue2")
        t9.clear()
        t9.write(chance1,font =( "Arial",22,"normal"))
#pak kardan safhe
        t1.clear()
        t2.clear()
        t3.clear()
        t4.clear()
        t8.clear()

#marhale-2
#level
        t8 = turtle.Turtle()
        t8.speed(10)
        t8.hideturtle()
        t8.penup()
        t8.goto(180,200)
        t8.color("yellowgreen")
        if n == 1:
            t12.clear()
            t6.clear()
        else:
            t5.clear()
            t11.clear()
        t8.write("Level: ",font = ("Arial" , 22 , "normal"))
        t8.goto(260,200)
        t8.color("violetred4")
        t8.write("2",font = ("Arial" , 22 , "normal"))
#ijade dash va print an
        name = easy[1]
        charNumber = len(easy[1])
        userList=["_"]*charNumber
        t1 = turtle.Turtle()
        t1.speed(10)
        t1.hideturtle()
        t1.penup()
        t1.goto(-350,-200)
        t1.color("cyan4")
        t1.write(userList,font = ("Arial",20,"normal"))    
#print emoji ha   
        t2 = turtle.Turtle()
        t2.speed(10)
        t2.hideturtle()
        t2.penup()
        t2.goto(-150,30)
        t2.color("black") 
        t2.write("\N{nail polish}",font=("Arial",50,"normal"))
        t2.goto(-70,30)
        t2.write("BACK",font=("Arial",50,"normal"))
#print chance ha 
        chance2 = 5
        t3 = turtle.Turtle()
        t3.speed(10)
        t3.hideturtle()
        t3.penup()
        t3.color("deeppink")
        t3.goto(-350,200)
        t3.write("Chances: ",font = ("Arial" , 22 , "normal"))
        t4 = turtle.Turtle()
        t4.speed(10)
        t4.hideturtle()
        t4.penup()
        t4.goto(-220,200)
        t4.color("darkgoldenrod")
        t4.write(chance2,font =( "Arial",22,"normal")) 
#barresi vojod dade
        while userList.count("_")>0:
            guess = turtle.textinput("Level 2 :","guess a character: ")
        
            for i in range(charNumber):
                if guess == name[i]:
                    userList[i]=guess
                
            if name.count(guess) == 0:
                chance2 -= 1
            
                if chance2 == 0:
                    n = 0
                    t5 = turtle.Turtle()
                    t5.hideturtle()
                    t5.penup()
                    t2.clear()
                    t5.goto(-150,30)
                    t5.color("red")
                    t5.speed('slowest')
                    t5.write("Sorry you lost! " , font = ("Arial" , 40 ,"normal"))
                    t5.goto(-100,0)
                    t5.write("Correct answer: ",font = ("Arial" , 20 ,"normal"))
                    t11 = turtle.Turtle()
                    t11.hideturtle()
                    t11.penup()
                    t11.goto(100,0)
                    t11.color("violetred4")
                    t11.speed('slowest')
                    t11.write(name,font=("Arial",20,"normal"))
                    break
                
                t4.clear()
                t4.goto(-220,200)
                t4.write(chance2,font =( "Arial",22,"normal"))
                
            t1.clear()
            t1.write(userList,font=("Arial",16,"normal"))
        
        if chance2 != 0:
            n = 1
            t6 = turtle.Turtle()
            t6.hideturtle()
            t6.penup()
            t2.clear()
            t6.goto(-150,30)
            t6.color("green")
            t6.write("*You win :)* ",font = ("Arial" , 50 ,"normal"))
            t6.goto(-150,0)
            t6.color("springgreen2")
            t6.write( " Your rating from this step : ",font =( "Arial",22,"normal"))
            t12 = turtle.Turtle()
            t12.hideturtle()
            t12.penup()
            t12.color("snow4")
            t12.goto(210,0)
            t12.write(chance2,font =( "Arial",22,"normal"))
#emtyaz
        t7 = turtle.Turtle()
        t7.speed(10)
        t7.hideturtle()
        t7.penup()
        t7.goto(-110,200)
        t7.color("salmon")
        t7.write("Your score: ",font =( "Arial",22,"normal"))
        t9 = turtle.Turtle()
        t9.speed(10)
        t9.hideturtle()
        t9.penup()
        t9.goto(50,200)
        t9.color("slateblue2")
        chance4 = chance1 + chance2
        t9.write(chance4,font =( "Arial",22,"normal"))
#pak kardan safhe
        t1.clear()
        t2.clear()
        t3.clear()
        t4.clear()
        t8.clear()

#marhale-3
#level
        t8 = turtle.Turtle()
        t8.speed(10)
        t8.hideturtle()
        t8.penup()
        t8.goto(180,200)
        t8.color("yellowgreen")
        if n == 1:
            t12.clear()
            t6.clear()
        else:
            t5.clear()
            t11.clear()
        t8.write("Level: ",font = ("Arial" , 22 , "normal"))
        t8.goto(260,200)
        t8.color("violetred4")
        t8.write("3",font = ("Arial" , 22 , "normal"))
#ijade dash va print an
        name = easy[2]
        charNumber =len(easy[2])
        userList=["_"]*charNumber
        t1 = turtle.Turtle()
        t1.speed(10)
        t1.hideturtle()
        t1.penup()
        t1.goto(-350,-200)
        t1.color("cyan4")
        t1.write(userList,font = ("Arial",20,"normal"))   
#print emoji ha
        t2 = turtle.Turtle()
        t2.speed(10)
        t2.hideturtle()
        t2.penup()
        t2.goto(-150,30)
        t2.color("black") 
        t2.write("\N{police officer}",font=("Arial",50,"normal"))
        t2.goto(-70,30)
        t2.write("10",font=("Arial",50,"normal"))
#print chance ha        
        chance3 = 5
        t3 = turtle.Turtle()
        t3.speed(10)
        t3.hideturtle()
        t3.penup()
        t3.color("deeppink")
        t3.goto(-350,200)
        t3.write("Chances: ",font = ("Arial" , 22 , "normal"))
        t4 = turtle.Turtle()
        t4.speed(10)
        t4.hideturtle()
        t4.penup()
        t4.goto(-220,200)
        t4.color("darkgoldenrod")
        t4.write(chance3,font =( "Arial",22,"normal")) 
#barresi vojod dade
        while userList.count("_")>0:
            guess = turtle.textinput("Level 3 :","guess a character: ")
        
            for i in range(charNumber):
                if guess == name[i]:
                    userList[i]=guess
                
            if name.count(guess) == 0:
                chance3 -= 1
                
                if chance3 == 0:
                    n = 0
                    t5 = turtle.Turtle()
                    t5.hideturtle()
                    t5.penup()
                    t2.clear()
                    t5.goto(-150,30)
                    t5.color("red")
                    t5.speed('slowest')
                    t5.write("Sorry you lost! " , font = ("Arial" , 40 ,"normal"))
                    t5.goto(-100,0)
                    t5.write("Correct answer: ",font = ("Arial" , 20 ,"normal"))
                    t11 = turtle.Turtle()
                    t11.hideturtle()
                    t11.penup()
                    t11.goto(100,0)
                    t11.color("violetred4")
                    t11.speed('slowest')
                    t11.write(name,font=("Arial",20,"normal"))
                    break
                
                t4.clear()
                t4.goto(-220,200)
                t4.write(chance3,font =( "Arial",22,"normal"))
                
            t1.clear()
            t1.write(userList,font=("Arial",16,"normal"))
        
        if chance3 != 0:
            n = 1
            t6 = turtle.Turtle()
            t6.hideturtle()
            t6.penup()
            t2.clear()
            t6.goto(-150,30)
            t6.color("green")
            t6.write("*You win :)* ",font = ("Arial" , 50 ,"normal"))
            t6.goto(-150,0)
            t6.color("springgreen2")
            t6.write( " Your rating from this step : ",font =( "Arial",22,"normal"))
            t12 = turtle.Turtle()
            t12.hideturtle()
            t12.penup()
            t12.color("snow4")
            t12.goto(210,0)
            t12.write(chance3,font =( "Arial",22,"normal"))
#emtyaz
        t9.clear()
        t7 = turtle.Turtle()
        t7.speed(10)
        t7.hideturtle()
        t7.penup()
        t7.goto(-110,200)
        t7.color("salmon")
        t7.write("Your score: ",font =( "Arial",22,"normal"))
        t9 = turtle.Turtle()
        t9.speed(10)
        t9.hideturtle()
        t9.penup()
        t9.goto(50,200)
        t9.color("slateblue2")
        chance4 = chance1 + chance2 + chance3
        t9.write(chance4,font =( "Arial",22,"normal"))
#pak kardan safhe
        t1.clear()
        t2.clear()
        t3.clear()
        t4.clear()
        t8.clear()
        t9.clear()
        if n == 1:
            t12.clear()
            t6.clear()
        else:
            t5.clear()
            t11.clear()
#continue
        answer = turtle.textinput("continue","Do you want to continue?(y/n) ")

    if level == '2':
#marhale-1
#level
        t8 = turtle.Turtle()
        t8.speed(10)
        t8.hideturtle()
        t8.penup()
        t8.goto(180,200)
        t8.color("yellowgreen")
        t8.write("Level: ",font = ("Arial" , 22 , "normal"))
        t8.goto(260,200)
        t8.color("violetred4")
        t8.write("1",font = ("Arial" , 22 , "normal"))
#data
        hard = ["جوينده*يابنده*است","دهنش*بوي*شير*ميده","فيل*و*فنجون","مرغ*همسايه*غاز*است","يک*گوشش*دره*و*يک*گوشش*دروازه*است"]
#ijade dash va print an
        name = hard[0]
        charNumber = len(hard[0])
        userList=["_"]*charNumber
        t1 = turtle.Turtle()
        t1.speed(10)
        t1.hideturtle()
        t1.penup()
        t1.goto(-350,-200)
        t1.color("cyan4")
        t1.write(userList,font = ("Arial",20,"normal"))   
#print emoji ha    
        t2 = turtle.Turtle()
        t2.speed(10)
        t2.hideturtle()
        t2.penup()
        t2.goto(-150,30)
        t2.color("black")
        t2.write("\N{world map}",font=("Arial",50,"normal"))
        t2.goto(-70,30)
        t2.write("\N{pick}",font=("Arial",50,"normal"))
        t2.goto(10,30)
        t2.write("\N{gem stone}",font=("Arial",50,"normal"))
#print chance ha           
        chance1 = 5
        t3 = turtle.Turtle()
        t3.speed(10)
        t3.hideturtle()
        t3.penup()
        t3.color("deeppink")
        t3.goto(-350,200)
        t3.write("Chances: ",font = ("Arial" , 22 , "normal"))
        t4 = turtle.Turtle()
        t4.speed(10)
        t4.hideturtle()
        t4.penup()
        t4.goto(-220,200)
        t4.color("darkgoldenrod")
        t4.write(chance1,font =( "Arial",22,"normal"))
#barresi vojod dade 
        while userList.count("_")>0:
            guess = turtle.textinput("Level 1 :","guess a character: ")
        
            for i in range(charNumber):
                if guess == name[i]:
                    userList[i]=guess
                
            if name.count(guess) == 0:
                chance1 -= 1
            
                if chance1 == 0:
                    n = 0
                    t5 = turtle.Turtle()
                    t5.hideturtle()
                    t5.penup()
                    t2.clear()
                    t5.goto(-150,30)
                    t5.color("red")
                    t5.speed('slowest')
                    t5.write("Sorry you lost! " , font = ("Arial" , 40 ,"normal"))
                    t5.goto(-100,0)
                    t5.write("Correct answer: ",font = ("Arial" , 20 ,"normal"))
                    t11 = turtle.Turtle()
                    t11.speed(1)
                    t11.hideturtle()
                    t11.penup()
                    t11.goto(100,0)
                    t11.color("violetred4")
                    t11.speed('slowest')
                    t11.write(name,font=("Arial",20,"normal"))
                    break
                
                t4.clear()
                t4.goto(-220,200)
                t4.write(chance1,font =( "Arial",22,"normal"))
                
            t1.clear()
            t1.write(userList,font=("Arial",16,"normal"))
        
        if chance1 != 0:
            n = 1
            t6 = turtle.Turtle()
            t6.hideturtle()
            t6.penup()
            t2.clear()
            t6.goto(-150,30)
            t6.color("green")
            t6.write("*You win :)* ",font = ("Arial" , 50 ,"normal"))
            t6.goto(-150,0)
            t6.color("springgreen2")
            t6.write( " Your rating from this step : ",font =( "Arial",22,"normal"))
            t12 = turtle.Turtle()
            t12.speed(1)
            t12.hideturtle()
            t12.penup()
            t12.color("snow4")
            t12.goto(210,0)
            t12.write(chance1,font =( "Arial",22,"normal"))
#emtyaz

        t7 = turtle.Turtle()
        t7.speed(10)
        t7.hideturtle()
        t7.penup()
        t7.goto(-110,200)
        t7.color("salmon")
        t7.write("Your score: ",font =( "Arial",22,"normal"))
        t9 = turtle.Turtle()
        t9.hideturtle()
        t9.penup()
        t9.goto(50,200)
        t9.color("slateblue2")
        t9.clear()
        t9.write(chance1,font =( "Arial",22,"normal"))
#pak kardan safhe
        t1.clear()
        t2.clear()
        t3.clear()
        t4.clear()
        t8.clear()
        
#marhale-2
#level
        t8 = turtle.Turtle()
        t8.speed(10)
        t8.hideturtle()
        t8.penup()
        t8.goto(180,200)
        t8.color("yellowgreen")
        if n == 1:
            t12.clear()
            t6.clear()
        else:
            t5.clear()
            t11.clear()
        t8.write("Level: ",font = ("Arial" , 22 , "normal"))
        t8.goto(260,200)
        t8.color("violetred4")
        t8.write("2",font = ("Arial" , 22 , "normal"))
#ijade dash va print an
        name = hard[1]
        charNumber = len(hard[1])
        userList=["_"]*charNumber
        t1 = turtle.Turtle()
        t1.speed(10)
        t1.hideturtle()
        t1.penup()
        t1.goto(-350,-200)
        t1.color("cyan4")
        t1.write(userList,font = ("Arial",20,"normal"))    
#print emoji ha
        t2 = turtle.Turtle()
        t2.speed(10)
        t2.hideturtle()
        t2.penup()
        t2.goto(-150,30)
        t2.color("black")
        t2.write("\N{mouth}",font=("Arial",50,"normal"))
        t2.goto(-70,30)
        t2.write("\N{nose}",font=("Arial",50,"normal"))
        t2.goto(10,30)
        t2.write("\N{baby bottle}",font=("Arial",50,"normal"))
#print chance ha           
        chance2 = 5
        t3 = turtle.Turtle()
        t3.speed(10)
        t3.hideturtle()
        t3.penup()
        t3.color("deeppink")
        t3.goto(-350,200)
        t3.write("Chances: ",font = ("Arial" , 22 , "normal"))
        t4 = turtle.Turtle()
        t4.speed(10)
        t4.hideturtle()
        t4.penup()
        t4.goto(-220,200)
        t4.color("darkgoldenrod")
        t4.write(chance2,font =( "Arial",22,"normal"))
#barresi vojod dade
        while userList.count("_")>0:
            guess = turtle.textinput("Level 2 :","guess a character: ")
        
            for i in range(charNumber):
                if guess == name[i]:
                    userList[i]=guess
                
            if name.count(guess) == 0:
                chance2 -= 1
            
                if chance2 == 0:
                    n = 0
                    t5 = turtle.Turtle()
                    t5.hideturtle()
                    t5.penup()
                    t2.clear()
                    t5.goto(-150,30)
                    t5.color("red")
                    t5.speed('slowest')
                    t5.write("Sorry you lost! " , font = ("Arial" , 40 ,"normal"))
                    t5.goto(-100,0)
                    t5.write("Correct answer: ",font = ("Arial" , 20 ,"normal"))
                    t11 = turtle.Turtle()
                    t11.speed(1)
                    t11.hideturtle()
                    t11.penup()
                    t11.goto(100,0)
                    t11.color("violetred4")
                    t11.speed('slowest')
                    t11.write(name,font=("Arial",20,"normal"))
                    break
                
                t4.clear()
                t4.goto(-220,200)
                t4.write(chance2,font =( "Arial",22,"normal"))
                
            t1.clear()
            t1.write(userList,font=("Arial",16,"normal"))
        
        if chance2 != 0:
            n = 1
            t6 = turtle.Turtle()
            t6.hideturtle()
            t6.penup()
            t2.clear()
            t6.goto(-150,30)
            t6.color("green")
            t6.write("*You win :)* ",font = ("Arial" , 50 ,"normal"))
            t6.goto(-150,0)
            t6.color("springgreen2")
            t6.write( " Your rating from this step : ",font =( "Arial",22,"normal"))
            t12 = turtle.Turtle()
            t12.speed(1)
            t12.hideturtle()
            t12.penup()
            t12.color("snow4")
            t12.goto(210,0)
            t12.write(chance2,font =( "Arial",22,"normal"))
#emtyaz
        t9.clear()
        t7 = turtle.Turtle()
        t7.speed(10)
        t7.hideturtle()
        t7.penup()
        t7.goto(-110,200)
        t7.color("salmon")
        t7.write("Your score: ",font =( "Arial",22,"normal"))
        t9 = turtle.Turtle()
        t9.speed(10)
        t9.hideturtle()
        t9.penup()
        t9.goto(50,200)
        t9.color("slateblue2")
        chance4 = chance1 + chance2
        t9.clear()
        t9.write(chance4,font =( "Arial",22,"normal"))
#pak kardan safhe
        t1.clear()
        t2.clear()
        t3.clear()
        t4.clear()
        t8.clear()
#marhale-3
#level
        t8 = turtle.Turtle()
        t8.speed(10)
        t8.hideturtle()
        t8.penup()
        t8.goto(180,200)
        t8.color("yellowgreen")
        if n == 1:
            t12.clear()
            t6.clear()
        else:
            t5.clear()
            t11.clear()
        t8.write("Level: ",font = ("Arial" , 22 , "normal"))
        t8.goto(260,200)
        t8.color("violetred4")
        t8.write("3",font = ("Arial" , 22 , "normal"))
#ijade dash va print an
        name = hard[2]
        charNumber =len(hard[2])
        userList=["_"]*charNumber
        t1 = turtle.Turtle()
        t1.speed(10)
        t1.hideturtle()
        t1.penup()
        t1.goto(-350,-200)
        t1.color("cyan4")
        t1.write(userList,font = ("Arial",20,"normal"))
#print emoji ha        
        t2 = turtle.Turtle()
        t2.speed(10)
        t2.hideturtle()
        t2.penup()
        t2.goto(-150,30)
        t2.color("black")
        t2.write("\N{elephant}",font= ("Arial",50,"normal"))
        t2.goto(-70,30)
        t2.write("\N{hot beverage}",font= ("Arial",50,"normal"))
#print chance ha
        chance3 = 5
        t3 = turtle.Turtle()
        t3.speed(10)
        t3.hideturtle()
        t3.penup()
        t3.color("deeppink")
        t3.goto(-350,200)
        t3.write("Chances: ",font = ("Arial" , 22 , "normal"))
        t4 = turtle.Turtle()
        t4.speed(10)
        t4.hideturtle()
        t4.penup()
        t4.goto(-220,200)
        t4.color("darkgoldenrod")
        t4.write(chance3,font =( "Arial",22,"normal"))
#barresi vojod dade
        while userList.count("_")>0:
            guess = turtle.textinput("Level 3 :","guess a character: ")
        
            for i in range(charNumber):
                if guess == name[i]:
                    userList[i]=guess
                
            if name.count(guess) == 0:
                chance3 -= 1
                
                if chance3 == 0:
                    n = 0
                    t5 = turtle.Turtle()
                    t5.hideturtle()
                    t5.penup()
                    t2.clear()
                    t5.goto(-150,30)
                    t5.color("red")
                    t5.speed('slowest')
                    t5.write("Sorry you lost! " , font = ("Arial" , 40 ,"normal"))
                    t5.goto(-100,0)
                    t5.write("Correct answer: ",font = ("Arial" , 20 ,"normal"))
                    t11 = turtle.Turtle()
                    t11.hideturtle()
                    t11.penup()
                    t11.goto(100,0)
                    t11.color("violetred4")
                    t11.speed('slowest')
                    t11.write(name,font=("Arial",20,"normal"))
                    break
                
                t4.clear()
                t4.goto(-220,200)
                t4.write(chance3,font =( "Arial",22,"normal"))
                
            t1.clear()
            t1.write(userList,font=("Arial",16,"normal"))
        
        if chance3 != 0:
            n = 1
            t6 = turtle.Turtle()
            t6.hideturtle()
            t6.penup()
            t2.clear()
            t6.goto(-150,30)
            t6.color("green")
            t6.write("*You win :)* ",font = ("Arial" , 50 ,"normal"))
            t6.goto(-150,0)
            t6.color("springgreen2")
            t6.write( " Your rating from this step : ",font =( "Arial",22,"normal"))
            t12 = turtle.Turtle()
            t12.hideturtle()
            t12.penup()
            t12.color("snow4")
            t12.goto(210,0)
            t12.write(chance3,font =( "Arial",22,"normal"))
#emtyaz
        t9.clear()
        t7 = turtle.Turtle()
        t7.speed(10)
        t7.hideturtle()
        t7.penup()
        t7.goto(-110,200)
        t7.color("salmon")
        t7.write("Your score: ",font =( "Arial",22,"normal"))
        t9 = turtle.Turtle()
        t9.speed(10)
        t9.hideturtle()
        t9.penup()
        t9.goto(50,200)
        t9.color("slateblue2")
        chance4 = chance1 + chance2 + chance3
        t9.clear()
        t9.write(chance4,font =( "Arial",22,"normal"))
#pak kardan safhe
        t1.clear()
        t2.clear()
        t3.clear()
        t4.clear()
        t8.clear()
#marhale-4
#level
        t8 = turtle.Turtle()
        t8.speed(10)
        t8.hideturtle()
        t8.penup()
        t8.goto(180,200)
        t8.color("yellowgreen")
        if n == 1:
            t12.clear()
            t6.clear()
        else:
            t5.clear()
            t11.clear()
        t8.write("Level: ",font = ("Arial" , 22 , "normal"))
        t8.goto(260,200)
        t8.color("violetred4")
        t8.write("4",font = ("Arial" , 22 , "normal"))
#ijade dash va print an
        name = hard[3]
        charNumber =len(hard[3])
        userList=["_"]*charNumber
        t1 = turtle.Turtle()
        t1.speed(10)
        t1.hideturtle()
        t1.penup()
        t1.goto(-350,-200)
        t1.color("cyan4")
        t1.write(userList,font = ("Arial",20,"normal"))
#print emoji ha        
        t2 = turtle.Turtle()
        t2.speed(10)
        t2.hideturtle()
        t2.penup()
        t2.goto(-150,30)
        t2.color("black")
        t2.write("\N{chicken}",font = ("Arial",50,"normal"))
        t2.goto(-70,30)
        t2.write("\N{bust in silhouette}",font = ("Arial",50,"normal"))
        t2.goto(10,30)
        t2.write("\N{duck}",font = ("Arial",50,"normal"))
#print chance ha
        chance5 = 5
        t3 = turtle.Turtle()
        t3.speed(10)
        t3.hideturtle()
        t3.penup()
        t3.color("deeppink")
        t3.goto(-350,200)
        t3.write("Chances: ",font = ("Arial" , 22 , "normal"))
        t4 = turtle.Turtle()
        t4.speed(10)
        t4.hideturtle()
        t4.penup()
        t4.goto(-220,200)
        t4.color("darkgoldenrod")
        t4.write(chance5,font =( "Arial",22,"normal"))
#barresi vojod dade
        while userList.count("_")>0:
            guess = turtle.textinput("Level 3 :","guess a character: ")
        
            for i in range(charNumber):
                if guess == name[i]:
                    userList[i]=guess
                
            if name.count(guess) == 0:
                chance5 -= 1
                
                if chance5 == 0:
                    n = 0
                    t5 = turtle.Turtle()
                    t5.hideturtle()
                    t5.penup()
                    t2.clear()
                    t5.goto(-150,30)
                    t5.color("red")
                    t5.speed('slowest')
                    t5.write("Sorry you lost! " , font = ("Arial" , 40 ,"normal"))
                    t5.goto(-100,0)
                    t5.write("Correct answer: ",font = ("Arial" , 20 ,"normal"))
                    t11 = turtle.Turtle()
                    t11.hideturtle()
                    t11.penup()
                    t11.goto(100,0)
                    t11.color("violetred4")
                    t11.speed('slowest')
                    t11.write(name,font=("Arial",20,"normal"))
                    break
                
                t4.clear()
                t4.goto(-220,200)
                t4.write(chance5,font =( "Arial",22,"normal"))
                
            t1.clear()
            t1.write(userList,font=("Arial",16,"normal"))
        
        if chance5 != 0:
            n = 1
            t6 = turtle.Turtle()
            t6.hideturtle()
            t6.penup()
            t2.clear()
            t6.goto(-150,30)
            t6.color("green")
            t6.write("*You win :)* ",font = ("Arial" , 50 ,"normal"))
            t6.goto(-150,0)
            t6.color("springgreen2")
            t6.write( " Your rating from this step : ",font =( "Arial",22,"normal"))
            t12 = turtle.Turtle()
            t12.hideturtle()
            t12.penup()
            t12.color("snow4")
            t12.goto(210,0)
            t12.write(chance5,font =( "Arial",22,"normal"))
#emtyaz
        t9.clear()
        t7 = turtle.Turtle()
        t7.speed(10)
        t7.hideturtle()
        t7.penup()
        t7.goto(-110,200)
        t7.color("salmon")
        t7.write("Your score: ",font =( "Arial",22,"normal"))
        t9 = turtle.Turtle()
        t9.speed(10)
        t9.hideturtle()
        t9.penup()
        t9.goto(50,200)
        t9.color("slateblue2")
        chance4 = chance1 + chance2 + chance3 + chance5
        t9.write(chance4,font =( "Arial",22,"normal"))
#pak kardan safhe
        t1.clear()
        t2.clear()
        t3.clear()
        t4.clear()
        t8.clear()
        if n == 1:
            t12.clear()
            t6.clear()
        else:
            t5.clear()
            t11.clear()
#marhale-5
#level
        t8 = turtle.Turtle()
        t8.speed(10)
        t8.hideturtle()
        t8.penup()
        t8.goto(180,200)
        t8.color("yellowgreen")
        if n == '1':
            t12.clear()
            t6.clear()
        else:
            t5.clear()
            t11.clear()
        t8.write("Level: ",font = ("Arial" , 22 , "normal"))
        t8.goto(260,200)
        t8.color("violetred4")
        t8.write("5",font = ("Arial" , 22 , "normal"))
#ijade dash va print an
        name = hard[4]
        charNumber =len(hard[4])
        userList=["_"]*charNumber
        t1 = turtle.Turtle()
        t1.speed(10)
        t1.hideturtle()
        t1.penup()
        t1.goto(-350,-200)
        t1.color("cyan4")
        t1.write(userList,font = ("Arial",20,"normal"))
#print emoji ha        
        t2 = turtle.Turtle()
        t2.speed(10)
        t2.hideturtle()
        t2.penup()
        t2.goto(-150,30)
        t2.write("\N{ear}",font=("Arial",50,"normal"))
        t2.goto(-70,30)
        t2.write("\N{door}",font=("Arial",50,"normal"))
        t2.goto(10,30)
        t2.write("\N{ear}",font=("Arial",50,"normal"))
        t2.goto(90,30)
        t2.write("\N{goal net}",font=("Arial",50,"normal"))
        #print chance ha
        chance6 = 5
        t3 = turtle.Turtle()
        t3.speed(10)
        t3.hideturtle()
        t3.penup()
        t3.color("deeppink")
        t3.goto(-350,200)
        t3.write("Chances: ",font = ("Arial" , 22 , "normal"))
        t4 = turtle.Turtle()
        t4.speed(10)
        t4.hideturtle()
        t4.penup()
        t4.goto(-220,200)
        t4.color("darkgoldenrod")
        t4.write(chance6,font =( "Arial",22,"normal"))
#barresi vojod dade
        while userList.count("_")>0:
            guess = turtle.textinput("Level 3 :","guess a character: ")
        
            for i in range(charNumber):
                if guess == name[i]:
                    userList[i]=guess
                
            if name.count(guess) == 0:
                chance6 -= 1
                
                if chance6 == 0:
                    n = 0
                    t5 = turtle.Turtle()
                    t5.hideturtle()
                    t5.penup()
                    t2.clear()
                    t5.goto(-150,30)
                    t5.color("red")
                    t5.speed('slowest')
                    t5.write("Sorry you lost! " , font = ("Arial" , 40 ,"normal"))
                    t5.goto(-100,0)
                    t5.write("Correct answer: ",font = ("Arial" , 20 ,"normal"))
                    t11 = turtle.Turtle()
                    t11.hideturtle()
                    t11.penup()
                    t11.goto(100,0)
                    t11.color("violetred4")
                    t11.speed('slowest')
                    t11.write(name,font=("Arial",20,"normal"))
                    break
                
                t4.clear()
                t4.goto(-220,200)
                t4.write(chance6,font =( "Arial",22,"normal"))
                
            t1.clear()
            t1.write(userList,font=("Arial",16,"normal"))
        
        if chance6 != 0:
            n = 1
            t6 = turtle.Turtle()
            t6.hideturtle()
            t6.penup()
            t2.clear()
            t6.goto(-150,30)
            t6.color("green")
            t6.write("*You win :)* ",font = ("Arial" , 50 ,"normal"))
            t6.goto(-150,0)
            t6.color("springgreen2")
            t6.write( " Your rating from this step : ",font =( "Arial",22,"normal"))
            t12 = turtle.Turtle()
            t12.hideturtle()
            t12.penup()
            t12.color("snow4")
            t12.goto(210,0)
            t12.write(chance6,font =( "Arial",22,"normal"))
#emtyaz
        t9.clear()
        t7 = turtle.Turtle()
        t7.speed(10)
        t7.hideturtle()
        t7.penup()
        t7.goto(-110,200)
        t7.color("salmon")
        t7.write("Your score: ",font =( "Arial",22,"normal"))
        t9 = turtle.Turtle()
        t9.speed(10)
        t9.hideturtle()
        t9.penup()
        t9.goto(50,200)
        t9.color("slateblue2")
        chance4 = chance1 + chance2 + chance3 + chance5 + chance6
        t9.clear()
        t9.write(chance4,font =( "Arial",22,"normal"))
        t9.clear()
#pak kardan safhe
        t1.clear()
        t2.clear()
        t3.clear()
        t4.clear()
        t8.clear()
        if n == 1:
            t12.clear()
            t6.clear()
        else:
            t5.clear()
            t11.clear()
#continue
        answer = turtle.textinput("continue","Do you want to continue?(y/n) ")
[/dm_code_snippet]

نقد و بررسی‌ها

هیچ دیدگاهی برای این محصول نوشته نشده است.

اولین کسی باشید که دیدگاهی می نویسد “ضرب المثل ها”

نشانی ایمیل شما منتشر نخواهد شد. بخش‌های موردنیاز علامت‌گذاری شده‌اند *

اطلاعات فروشنده

  • نام فروشگاه: یسنا بهرامی
  • فروشنده: یسنا بهرامی
  • آدرس:
  • هنوز امتیازی داده نشده است!
هیچ محصولی یافت نشد!
دکمه بازگشت به بالا