• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python turtle.ht函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中turtle.ht函数的典型用法代码示例。如果您正苦于以下问题:Python ht函数的具体用法?Python ht怎么用?Python ht使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了ht函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: ejes

def ejes():
    ####################################
    # Ejes Coordenados                 #
    # los ejes x e y van de -150 a 150 #
    ####################################
    turtle.delay(0)
    turtle.ht()
    turtle.speed(0)
    turtle.pencolor('red')
    turtle.down()
    turtle.fd(301)
    turtle.rt(90)
    turtle.fd(1)
    turtle.rt(90)
    turtle.fd(300)
    turtle.lt(90)
    turtle.fd(300)
    turtle.rt(90)
    turtle.fd(1)
    turtle.rt(90)
    turtle.fd(300)
    turtle.lt(90)
    turtle.fd(300)
    turtle.rt(90)
    turtle.fd(1)
    turtle.rt(90)
    turtle.fd(300)
    turtle.lt(90)
    turtle.fd(300)
    turtle.rt(90)
    turtle.fd(1)
    turtle.rt(90)
    turtle.fd(300)
    turtle.up()
    turtle.pencolor('blue')
开发者ID:AlvaroSacari,项目名称:primitivas-CAD,代码行数:35,代码来源:ventana.py


示例2: display

    def display( self, text ):
        """Display the finished graphic until the window is closed.

        Might be better to display until key click or mouse click.
        """
        turtle.title( text )
        turtle.ht()
开发者ID:slott56,项目名称:HamCalc-2.1,代码行数:7,代码来源:gwgraphics.py


示例3: draw_l

def draw_l(word):
    turtle.up()
    turtle.clear()
    turtle.setposition(0, 0)
    turtle.setheading(0)
    turtle.bk(INITIAL_POS[0])
    turtle.down()
    turtle.st()
    stack = []
    for char in word:
        if char == '0':
            turtle.fd(SIZE[0])
        if char == '1':
            turtle.fd(SIZE[0])
        if char == '[':
            stack.append((turtle.position(), turtle.heading()))
            turtle.lt(45)
        if char == ']':
            position, heading = stack.pop()
            turtle.up()
            turtle.setposition(position)
            turtle.setheading(heading)
            turtle.rt(45)
            turtle.down()
    turtle.ht()
开发者ID:RichardBarrell,项目名称:snippets,代码行数:25,代码来源:draw_l.py


示例4: drawBoard

def drawBoard():
    global b
    #actually draw the board :D
    turtle.ht()
    turtle.width(5)
    turtle.up()
    turtle.goto(-3*b/2.0,b/2.0)
    turtle.down()
    turtle.seth(0)
    turtle.forward(3*b)
    turtle.up()
    turtle.goto(-3*b/2.0,-b/2.0)
    turtle.down()
    turtle.seth(0)
    turtle.forward(3*b)
    turtle.up()
    turtle.goto(-b/2.0,3*b/2.0)
    turtle.down()
    turtle.seth(270)
    turtle.forward(3*b)
    turtle.up()
    turtle.goto(b/2.0,3*b/2.0)
    turtle.down()
    turtle.seth(270)
    turtle.forward(3*b)
开发者ID:mosest,项目名称:11th-Python,代码行数:25,代码来源:24+-+TicTacToe+Ultimate.py


示例5: turtle_init

def turtle_init():
	turtle.ht()
	turtle.up()
	turtle.speed(0)
	turtle.left(90)
	turtle.backward(350)
	turtle.down()
开发者ID:TravisWhitaker,项目名称:lsystems,代码行数:7,代码来源:stupid_tree.py


示例6: init_turtle

def init_turtle():
    turtle.ht()
    turtle.up()
    turtle.speed(0)
    turtle.setpos(-500, -300)
    turtle.left(60)
    turtle.colormode(255)
    turtle.pencolor((150, 150, 0))
    turtle.down()
开发者ID:TravisWhitaker,项目名称:lsystems,代码行数:9,代码来源:fractal_wheat.py


示例7: ready

def ready(rad):
    turtle.speed(0)
    turtle.ht()
    turtle.up()
    turtle.goto(0,-rad)
    turtle.down()
    turtle.colormode(1)
    turtle.bgcolor('black')
    turtle.pensize(1.1)
开发者ID:hehe3301,项目名称:Recursion_Training,代码行数:9,代码来源:recCircle.py


示例8: pintar

def pintar(x, y):
    ##################################
    # Función para Encender un Pixel #
    ##################################
    turtle.delay(0)
    turtle.speed(0)
    turtle.ht()
    turtle.up()
    turtle.goto(2 * int(x), 2 * int(y))
    turtle.down()
    turtle.fd(0)
    turtle.up()
开发者ID:AlvaroSacari,项目名称:primitivas-CAD,代码行数:12,代码来源:pixel.py


示例9: init_engine

def init_engine(delay=_ENGINEDELAY):
	'''
	(Re)initializes the game engine.  Only one game engine may exist
	at any one time.  The optional parameter specifies a delay added
	to each game time step, in seconds; the value may be a floating
	point number.
	'''
	global _e
	_e = _E(delay)

	turtle.pu()
	turtle.ht()
	turtle.clear()
开发者ID:sbihel,项目名称:retrogames,代码行数:13,代码来源:engine.py


示例10: __main__

def __main__():
    turtle.ht()
    nodes = []
    while True:
        numberOfNodes = int(raw_input("Number of nodes (Max = 8): "))
        if numberOfNodes > 8 or numberOfNodes <= 1:
            print "The amount of nodes must be a number between 2 and 8."
        else:
            drawCircles(numberOfNodes)
            i = 1
            while i <= numberOfNodes:
                nodes = nodes + ["Q" + str(i)]
                i += 1
            break
    labelNodes(numberOfNodes)
    while True:
        startingNode = str(raw_input("Starting node: "))
        if startingNode in nodes:
            entrance([-400 + 80 * nodes.index(startingNode), 20])
            break
        else:
            print "That node does not exist please choose a node between Q1 and Q" + str(numberOfNodes) + "."
    while True:
        endingNodes = str(
            raw_input("Accepting state (Enter all accepting states put a comma between them ex. Q1,Q3): ")
        )
        endingNodes = endingNodes.split(",")
        valid = True
        for x in endingNodes:
            if x not in nodes:
                valid = False
                break
        if valid == True:
            for x in endingNodes:
                final([-400 + 80 * nodes.index(x), 20])
            break
        else:
            print "One of those nodes does not exist please try again"
    addT = "Jonathan"
    print "Transitions(Enter one transtion then press enter. After the last transition press enter twice. Format (StartingNode,Letter)=EndingNode *No spaces*)"
    while True:
        addT = str(raw_input())
        if addT == "":
            break
        else:
            new = transitions(addT)
            if new[0] in nodes and new[2] in nodes:
                addLine(nodes.index(new[0]), nodes.index(new[2]), new[1])
            else:
                print "Looks like their was an error with your format. Please try again."
    saveImg()
开发者ID:JonSchwarz23,项目名称:Automaton,代码行数:51,代码来源:NoSaveAutomaton.py


示例11: disp

def disp(A, cellsize = 1 / 10.5):
    turtle.clear()
    turtle.shape("square")
    turtle.penup()
    turtle.speed(0)
    turtle.shapesize(0.5, 0.5, 1)
    turtle.ht()
    top = len(A) / cellsize
    left = -len(A[0]) / cellsize
    for r in range(len(A)):
        for c in range(len(A[r])):
            if A[r][c]: 
                turtle.goto(c * 10.5 + left, top - r * 10.5)
                turtle.stamp()
开发者ID:Arvykins,项目名称:61a-sp14-website,代码行数:14,代码来源:13.py


示例12: __init__

 def __init__(self,pseudo,adv,*,x=600,y=400):
     super().__init__(pseudo,adversaire = adv)
     turtle.Screen().onkey(self.pleindre,'p')
     turtle.Screen().onkey(self.rule,'j')
     self.coord1 = None
     self.coord2 = None
     turtle.ht() 
     turtle.penup() 
     turtle.bgpic("interface.gif") #charge le fond d'écran
     turtle.setup (width=x, height=y, startx=0, starty=0)
     turtle.Screen().onkey(self.help,'m')
     turtle.goto(-170,115)
     turtle.write(self.adv,align="center",font=("Arial",25, "normal"))
     turtle.goto(140,115)
     turtle.write(pseudo,align="center", font=("Arial",25, "normal"))
开发者ID:etiennedub,项目名称:battleship,代码行数:15,代码来源:interface.py


示例13: hold

	def hold(self):
		""" holds the screen open until the user clicks or types 'q' """
	
		# have the turtle listen for events
		turtle.listen()

		# hide the turtle and update the screen
		turtle.ht()
		turtle.update()

		# have the turtle listen for 'q'
		turtle.onkey( turtle.bye, 'q' )
		# have the turtle listen for a click
		turtle.onscreenclick( lambda x,y: turtle.bye() )

		# start the main loop until an event happens, then exit
		turtle.mainloop()
		exit()
开发者ID:akaralekas,项目名称:cs151-colby,代码行数:18,代码来源:turtle_interpreter.py


示例14: Sierpinsmod

def Sierpinsmod(size,mod,alto=1024,ancho=700,dx=4):
    r=1.0*dx  
    pp=dx  # Grueso de los puntos
    turtle.colormode(1)
    turtle.ht()
   
    turtle.speed("fastest")
    turtle.tracer(False)
    turtle.penup()
    turtle.home()
    ox = -(turtle.window_width()/2)+2*dx
    oy = (turtle.window_height()/2)-2*dx
 
    P=Pascal(size,mod)

    turtle.setpos(ox,oy)
   
    turtle.dot(pp,clr(P[0][0],mod))
    turtle.seth(90)
   
    for d in range(1,2*size-1):
        print("iniciando diagonal ",d),
        if d< size:
            initx=0  # Posiciones iniciales
            inity=d
        else:
            initx = d-size+1
            inity = size-1
       
        turtle.setpos(ox+initx*dx-dx,oy-inity*dx-dx)
 
        for k in range(initx,inity+1):  
            # Recorremos la diagonal de suma d
            # Los puntos corresponden a (k, d-k)
            turtle.right(90)
            turtle.forward(dx)
            turtle.left(90)
            turtle.forward(dx)
            t=P[k][d-k]
            if t > 0:
                turtle.dot(pp, clr(t,mod))
        if d % 20 ==0: turtle.update()        
开发者ID:drinifmat,项目名称:chucherias,代码行数:42,代码来源:sierpinmod.py


示例15: illustrate

    def illustrate(self, color="red"):

        # if the tree is empty, exit program
        if self.is_empty():
            print("Empty")
            return

        # set turtle settings
        turtle.ht()
        turtle.pu()
        turtle.speed(0)

        # move turtle to near top of string
        turtle.goto(0, 250)

        # set color of the numbers on the nodes
        self.color = color

        # begin drawing the tree
        self.help_illustrate(self.root, turtle)
开发者ID:cmaxcy,项目名称:structs-algos,代码行数:20,代码来源:VisualBST.py


示例16: drawFrame

 def drawFrame(self, i, j, colour=None):
     if colour is not None:
         turtle.color("red")
     else:
         turtle.color("black")
     turtle.ht()
     turtle.up()
     turtle.tracer(10000,0)
     x = self.index_to_pixel(i, "x")
     y = self.index_to_pixel(j, "y")
     print("going to " + str(x) + " " + str(y))
     turtle.setx(x)
     turtle.sety(y)
     turtle.down()
     turtle.forward(self.xside_box)
     turtle.left(90)
     turtle.forward(self.yside_box)
     turtle.left(90)
     turtle.forward(self.xside_box)
     turtle.left(90)
     turtle.forward(self.yside_box)
     turtle.left(90)
     turtle.update()
开发者ID:ElliotGluck,项目名称:ponyge,代码行数:23,代码来源:gui.py


示例17: stamp

def stamp(x,y):
    turtle.ht()
    turtle.penup()
    turtle.goto(x,y)
    turtle.pendown()
    turtle.stamp()
开发者ID:guy16-meet,项目名称:MEET-YL1,代码行数:6,代码来源:paintprogram.py


示例18: print

import turtle
turtle.ht()
turtle.speed(0)
print("welcome to the paint progaram,")
print("when you will click on the screen, a shape will appear.")
print("to change the shape press on --->")
print("Up - Circle, Down - Square, Left - Triangle, Right - Turtle.")
print("to change the color of the shape press on --->")
print("B - Blue, R - Red, G - Green, Y - Yellow, O - Orange, S - Black, W - White (eraser).")
print("to change the size of the shape press on --->")
print("size 1 - 1, size 2 - 2, size 3 - 3, size 4 - 4, size 5 - 5.")
print("to clear the screen press - C.")
print("ENJOY!")

def size_1():    
    turtle.shapesize(1,1,1)
    
turtle.getscreen().onkeypress(size_1,"1")
turtle.getscreen().listen()

def size_2():    
    turtle.shapesize(2,2,2)
    
turtle.getscreen().onkeypress(size_2,"2")
turtle.getscreen().listen()

def size_3():    
    turtle.shapesize(3,3,3)
    
turtle.getscreen().onkeypress(size_3,"3")
turtle.getscreen().listen()
开发者ID:guy16-meet,项目名称:MEET-YL1,代码行数:31,代码来源:paintprogram.py


示例19: f

def f(length, depth, anti):
    if depth == 0:
        t.pd()          # pendown
        t.fd(length)    # forward
        t.pu()          # penup
        return

    for angle in [60, -120, 60, 0]:
        f(length/3, depth-1, anti)
        t.lt(angle * anti)


# main
t.reset()
t.speed(0)          # fast++
t.ht()              # hideturtle
t.pu()              # penup
screen = t.getscreen()
screen.bgcolor("black")
sleep(1)

for i in range(n):
    screen.tracer(49152, 0) # i
    # a b/w version
    cl = float(i+2) / float(n+2)
    t.color((cl, cl, cl))

    t.fill(True)        # 
    snowflake(sz, 5, 1) # i+2
    sz = sz - (sz / 8)  #
    t.fill(False)       #
开发者ID:cr,项目名称:BrokenDimensions,代码行数:31,代码来源:snowflake.py


示例20: init_turtle

def init_turtle():
    turtle.ht()
    turtle.up()
    turtle.speed(0)
    turtle.setpos(-500, 0)
    turtle.down()
开发者ID:TravisWhitaker,项目名称:lsystems,代码行数:6,代码来源:koch_island.py



注:本文中的turtle.ht函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python turtle.left函数代码示例发布时间:2022-05-27
下一篇:
Python turtle.home函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap