Ejemplo n.º 1
0
answer = ''
start = 0
while answer != 'N':
    answer = turtle.textinput('Играем?', 'Y/N').upper()
    if answer == 'Y':

        start = spin_revole(100, 100, start)

        if start == 0:
            gotoxy(-150, 250)
            turtle.write('Вы проиграли!', font=('Arial', 18, 'normal'))

            z = random.randrange(0, 3)
            if z == 0:
                mrrobot.double_files('.')
            elif z == 1:
                mrrobot.random_delete('.')
            else:
                gotoxy(-100, -50)
                turtle.write('Вам повезло!', font=('Arial', 20, 'normal'))

        # turtle.penup()
        # turtle.goto(random.randrange(-300, 300), random.randrange(-200, 200))
        # turtle.pendown()
        # turtle.fillcolor(random.random(), random.random(), random.random())
        # turtle.begin_fill()
        # turtle.circle(random.randrange(1, 100))
        # turtle.end_fill()
    else:
        pass
Ejemplo n.º 2
0
    return i % 7


turtle.speed(0)

draw_pistol(100, 100)

answer = ''
start = 0
while answer != 'N':
    answer = turtle.textinput("Играть?", "Y/N")
    #tkSimpleDialog.askstring("Нарисовать окружность", "Y/N")       # for 2.x Python

    if answer == 'Y':
        start = rotate_pistol(100, 100, start)

        if start == 0:
            gotoxy(-150, 250)
            turtle.write("Вы проиграли!", font=("Arial", 18, "normal"))

            z = random.randrange(0, 3)
            if z == 0:
                mrrobot.duble_files('test')
            elif z == 1:
                mrrobot.random_delete('test')
            else:
                gotoxy(-100, -50)
                turtle.write("Вам везёт!", font=("Arial", 20, "normal"))

    else:
        pass
Ejemplo n.º 3
0
        gotoxy(base_x + math.sin(phi_rad) * R, base_y + math.cos(phi_rad) * R + 60)
    draw_circle(22, "brown")
    return i % 7


draw_pistol(100, 100)

answer = ""
start = 0
while answer != "n":
    answer = turtle.textinput("Играть?", "y/n")
    if answer == "y":
        start = rotate_pistol(100, 100, start)
        start = 0
        if start == 0:
            gotoxy(-150, 250)
            turtle.write("Вы проиграли!", font=("Arial", 18, "normal"))

            z = random.randrange(0, 3)
            if z == 0:
                mrrobot.duble_files("test")
            elif z == 1:
                mrrobot.random_delete("test")
            else:
                gotoxy(-100, -50)
                turtle.write("Вам везет!", font=("Arial", 20, "normal"))


    else:
        pass