{"id":400,"date":"2019-12-18T09:35:35","date_gmt":"2019-12-18T01:35:35","guid":{"rendered":"http:\/\/cnliutz.uicp.io\/wordpress\/?p=400"},"modified":"2019-12-18T09:40:42","modified_gmt":"2019-12-18T01:40:42","slug":"turtle%e9%9a%8f%e6%9c%ba%e5%bd%a2%e7%8a%b6","status":"publish","type":"post","link":"http:\/\/g1n29wqq.ipyingshe.net:5347\/?p=400","title":{"rendered":"Turtle\u968f\u673a\u5f62\u72b6"},"content":{"rendered":"<p>from turtle import *<br \/>\nfrom random import *<br \/>\nimport time<\/p>\n<p>getscreen().colormode(255)<br \/>\nshape(&#8220;turtle&#8221;)<br \/>\nspeed(0)<\/p>\n<p>def randomcolour():<br \/>\n    red=randint(0,255)<br \/>\n    green=randint(0,255)<br \/>\n    blue=randint(0,255)<br \/>\n    color(red,green,blue)<\/p>\n<p>def randomplace():<br \/>\n    penup()<br \/>\n    x=randint(-200,200)<br \/>\n    y=randint(-200,200)<br \/>\n    goto(x,y)<br \/>\n    pendown()<\/p>\n<p>def randomheading():<br \/>\n    setheading(randint(1,360))<\/p>\n<p>def drawrectangle():<br \/>\n    hideturtle()<br \/>\n    lenght=randint(10,100)<br \/>\n    height=randint(10,100)<br \/>\n    begin_fill()<br \/>\n    forward(lenght)<br \/>\n    right(90)<br \/>\n    forward(height)<br \/>\n    right(90)<br \/>\n    forward(lenght)<br \/>\n    right(90)<br \/>\n    forward(height)<br \/>\n    right(90)<br \/>\n    end_fill()<br \/>\ndef drawcircle():<br \/>\n    dot(randint(20,100))<\/p>\n<p>def drawfivestar():<br \/>\n    circle(randint(5,100),steps=5)<\/p>\n<p>def five():<br \/>\n    begin_fill()<br \/>\n    x=randint(50,200)<br \/>\n    for i in range(5):<br \/>\n        forward(x)<br \/>\n        right(144)<br \/>\n    end_fill()<br \/>\n    hideturtle()<\/p>\n<p>for i in range(30):<br \/>\n    randomcolour()<br \/>\n    randomplace()<br \/>\n    stamp()<\/p>\n<p>clear()<br \/>\nsetheading(0)<br \/>\ntime.sleep(3)  <\/p>\n<p>for i in range(20):<br \/>\n    randomcolour()<br \/>\n    randomplace()<br \/>\n    drawrectangle()<\/p>\n<p>clear()<br \/>\nsetheading(0)<br \/>\ntime.sleep(3)  <\/p>\n<p>for i in range(20):<br \/>\n    randomcolour()<br \/>\n    randomplace()<br \/>\n    drawcircle()<\/p>\n<p>clear()<br \/>\nsetheading(0)<br \/>\ntime.sleep(3)  <\/p>\n<p>for i in range(20):<br \/>\n    randomcolour()<br \/>\n    randomplace()<br \/>\n    drawfivestar()<\/p>\n<p>clear()<br \/>\nsetheading(0)<br \/>\ntime.sleep(3)  <\/p>\n<p>for i in range(20):<br \/>\n    randomcolour()<br \/>\n    randomplace()<br \/>\n    five()<\/p>\n<p>turtle.done()<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,10],"tags":[],"class_list":["post-400","post","type-post","status-publish","format-standard","hentry","category-2","category-python"],"_links":{"self":[{"href":"http:\/\/g1n29wqq.ipyingshe.net:5347\/index.php?rest_route=\/wp\/v2\/posts\/400","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/g1n29wqq.ipyingshe.net:5347\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/g1n29wqq.ipyingshe.net:5347\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/g1n29wqq.ipyingshe.net:5347\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/g1n29wqq.ipyingshe.net:5347\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=400"}],"version-history":[{"count":4,"href":"http:\/\/g1n29wqq.ipyingshe.net:5347\/index.php?rest_route=\/wp\/v2\/posts\/400\/revisions"}],"predecessor-version":[{"id":404,"href":"http:\/\/g1n29wqq.ipyingshe.net:5347\/index.php?rest_route=\/wp\/v2\/posts\/400\/revisions\/404"}],"wp:attachment":[{"href":"http:\/\/g1n29wqq.ipyingshe.net:5347\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=400"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/g1n29wqq.ipyingshe.net:5347\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=400"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/g1n29wqq.ipyingshe.net:5347\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=400"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}