turtle-graphics

    1熱度

    1回答

    我正在製作一個程序,它需要使用pymouse的鼠標座標,然後使用烏龜在該點上創建一個點。 但是烏龜座標系和pymouse座標系有很大的不同:在烏龜座標系中,左邊是0,右邊是1920(對我來說),頂部是0和底部是1040(對我來說),但是在烏龜座標系左邊是-480,右邊是480,中心是0,頂部是400,底部是-400,中心是0. 我使用python 3.6.2,我的操作系統是Windows 10 3

    0熱度

    2回答

    我想這篇日誌基地2圖: if wave_type == "log": emily.up() emily.goto(0,1) emily.down() for x in range(100): y = math.log(x)/math.log(2) elaine.goto(x, y) ,但沒有奏效。請幫忙

    -1熱度

    3回答

    我需要使用遞歸和烏龜圖形繪製形狀。 我更喜歡循環,很少使用遞歸,所以這裏的一些幫助會很好。甚至不知道從哪裏開始。 形狀只是需要冷靜看。

    0熱度

    2回答

    當我運行這段代碼 import turtle import time def show_poly(): try: win = turtle.Screen() tess = turtle.Turtle() n = int(input("How many sides do you want in your polygon?")) angl

    1熱度

    1回答

    我想用烏龜畫這張照片。 這是我得到的ATM: import turtle def animal(): turtle.speed(1) turtle.pencolor('black') turtle.up() turtle.goto(-180, -180) turtle.down() turtle.lt(180)

    1熱度

    3回答

    這是我已經有的代碼,但它是說我需要定義我知道我需要的'多邊形',但不完全確定我有多少種不同的方式一直在試圖給我錯誤。 import turtle import math apple=turtle.Turtle() def draw_circle(t, r): circumference = 2 * math.pi * r n = 50 length = ci

    0熱度

    1回答

    我是新來的蟒蛇與龜,並會感謝一些幫助。 我正在嘗試創建一個程序,該程序需要對多個邊進行輸入,然後用該邊的數量繪製正多邊形。但是,它可能會產生TimeLimitError,或者只是繪製一條直線。 以下是我有: sides = int(input("How many sides would you like? ")) angle = sides/360 import turtle for co

    0熱度

    1回答

    我一直在試圖改變這種運行我的代碼的時候打開的窗口的大小。 我檢查,看到人們一直在使用: screen.setup (width=x_val, height=y_val, startx=start_x, starty=start_y) 當我試圖在自己的代碼中使用它,它甚至不顯示作爲一個選項:

    -1熱度

    1回答

    我正在嘗試使用Turtle打印30個六角形,這些六角形是螺旋狀的,並且顏色從紅色變爲黑色。 爲了改變(r,b,g)中的設定值,我在乘以for循環i,所以在某些時候它會超過r = 255。我包括if聲明擁有它不會超過這一點,但它給我的錯誤: File "<ipython-input-4-35d45ac44fdd>", line 20 if r > '255' ^ Synta

    0熱度

    2回答

    def main(): square(0,0,50,'red') def square(x,y,width,color): turtle.penup() turtle.goto(0,0) turtle.fillcolor(color) turtle.pendown() turtle.begin_fill() for n