{"id":514,"date":"2009-10-02T17:16:31","date_gmt":"2009-10-02T09:16:31","guid":{"rendered":"http:\/\/test999.eblhost.com\/blog\/?p=514"},"modified":"2009-11-17T11:00:39","modified_gmt":"2009-11-17T03:00:39","slug":"processing%ef%bc%9a%e5%be%aa%e7%8e%af","status":"publish","type":"post","link":"https:\/\/learn.travelchinawith.me\/?p=514","title":{"rendered":"Processing\uff1a\u5faa\u73af"},"content":{"rendered":"<p>1. \u5b66\u4f1a\u4e00\u4e2a\u65b0\u5355\u8bcd\uff1aiteration..<\/p>\n<p>2. \u5faa\u73af\u5171\u6709\u4e09\u79cd\uff1awhile\uff0cdo-while\u548cfor<\/p>\n<p>3. <em><span style=\"color: #888888;\">while()<\/span><\/em>\u5176\u5b9e\u5c31\u662f\uff1a\u4f60\u7ed9while\u4e00\u4e2a\u6761\u4ef6\uff0c\u7b26\u5408\u6761\u4ef6\u7684\u4ed6\u7ee7\u7eed\u5faa\u73af\u5c16\u62ec\u53f7\u5185\u7684\u5185\u5bb9\uff0c\u4e0d\u7b26\u5408\u6761\u4ef6\u4e86\uff0c\u505c\u6b62\uff0c\u6216\u8005\u5e72\u5176\u4ed6\u4e8b\u3002\u4e00\u4e2a\u5178\u578b\u7684\u4f8b\u5b50\uff1a<\/p>\n<figure id=\"attachment_515\" aria-describedby=\"caption-attachment-515\" style=\"width: 294px\" class=\"wp-caption alignright\"><a href=\"https:\/\/learn.travelchinawith.me\/wp-content\/uploads\/2009\/10\/pr6-1.gif\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-515   \" title=\"pr6-1\" src=\"https:\/\/learn.travelchinawith.me\/wp-content\/uploads\/2009\/10\/pr6-1.gif\" alt=\"pr6-1\" width=\"294\" height=\"184\" \/><\/a><figcaption id=\"caption-attachment-515\" class=\"wp-caption-text\">pr6-1<\/figcaption><\/figure>\n<p><span style=\"color: #888888;\"><em>size(100,100);<br \/>\nbackground(40,250,150);<br \/>\nsmooth();<\/em><\/span><\/p>\n<p><span style=\"color: #888888;\"><em> float w = width  ;<br \/>\nwhile (w&gt;0)<br \/>\n{<br \/>\nstroke(0);<br \/>\nfill(13,w+30,50);<br \/>\nellipse(height\/2,width\/2,w,w);<br \/>\nw=w-5;<br \/>\n}<\/em><\/span><\/p>\n<p><em>4<\/em>. \u6709\u4e00\u79cd\u5faa\u73af\u53eb\u505a\u6b7b\u5faa\u73af\u3002\u3002\uff1a<br \/>\n<em><span style=\"color: #888888;\"> int x = 0;<br \/>\nwhile (x &lt; 10) {<br \/>\nprintln(x);<br \/>\nx = x \u2013 1;<br \/>\n}<\/span><\/em><br \/>\n\u5982\u679c\u4f60\u5728pr\u4e2d\u8fd0\u884c\u8fd9\u6bb5\u4ee3\u7801\uff0c\u90a3\u4e48\u5c31\u7b49\u7740\u7a0b\u5e8f\u6b7b\u5427\u3002\u56e0\u4e3a\u5f53x\u5c0f\u4e8e10\u7684\u60c5\u51b5\u4e0b\uff0c\u5219\u65e0\u9650\u5728print\u7a97\u53e3\u5217\u5370\u51fax\u7684\u503c\uff0c\u800c\u8fd9\u91cc\uff0cx\u7684\u503c\u5c06\u6c38\u8fdc\u5c0f\u4e8e10\uff0c\u56e0\u6b64\uff0c\u7a0b\u5e8f\u5c06\u65e0\u9650\u7684\u8fd0\u884c\u4e0b\u53bb\u3002\u5f53\u7136\uff0c\u6b7b \u5f97\u8d8a\u6162\uff0c\u610f\u5473\u7740\u4f60\u7684\u7535\u8111\u6027\u80fd\u8d8a\u597d\u3002\u3002<\/p>\n<p>5. for\u5faa\u73af\u7684\u5e94\u7528\uff1a<br \/>\n\u4ece0\u6570\u52309\uff1a<em><span style=\"color: #888888;\">for (int i=0; i&lt;10; i=i+1)<\/span><\/em><br \/>\n\u4ece0\u4ee510\u7684\u95f4\u9694\u6570\u5230100\uff1a<span style=\"color: #888888;\"><em>for (int i=0; i&lt;101; i=i+10)<\/em><\/span><br \/>\n\u4ece100\u4ee55\u7684\u95f4\u9694\u6570\u52300\uff1a<em><span style=\"color: #888888;\">for (int i=100; i&gt;=0; i=i-5)<\/span><\/em><\/p>\n<figure id=\"attachment_516\" aria-describedby=\"caption-attachment-516\" style=\"width: 355px\" class=\"wp-caption alignright\"><a href=\"https:\/\/learn.travelchinawith.me\/wp-content\/uploads\/2009\/10\/pr6-2.gif\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-516  \" title=\"pr6-2\" src=\"https:\/\/learn.travelchinawith.me\/wp-content\/uploads\/2009\/10\/pr6-2.gif\" alt=\"pr6-2\" width=\"355\" height=\"133\" srcset=\"https:\/\/learn.travelchinawith.me\/wp-content\/uploads\/2009\/10\/pr6-2.gif 355w, https:\/\/learn.travelchinawith.me\/wp-content\/uploads\/2009\/10\/pr6-2-300x112.gif 300w\" sizes=\"auto, (max-width: 355px) 100vw, 355px\" \/><\/a><figcaption id=\"caption-attachment-516\" class=\"wp-caption-text\">pr6-2<\/figcaption><\/figure>\n<p>6.<br \/>\n<em><span style=\"color: #888888;\"> x++\uff1b<\/span><\/em>\u7b49\u4e8e<span style=\"color: #888888;\"><em>x=x+1\uff1b<\/em><\/span><br \/>\n<em><span style=\"color: #888888;\"> x&#8211;\uff1b<\/span><\/em>\u7b49\u4e8e<em><span style=\"color: #888888;\">x=x-1\uff1b<\/span><\/em><br \/>\n<em><span style=\"color: #888888;\"> x+=2\uff1b<\/span><\/em>\u7b49\u4e8e<em><span style=\"color: #888888;\">x=x+2\uff1b<\/span><\/em><br \/>\n<em><span style=\"color: #888888;\"> x*=3\uff1b<\/span><\/em>\u7b49\u4e8e<em><span style=\"color: #888888;\">x=x*3\uff1b<\/span><\/em><\/p>\n<p>7. \u7528for\u6765\u5199\u4e0a\u8fb9\u90a3\u4e2a\u7528while\u6765\u5199\u7684\u4f8b\u5b50\uff1a<br \/>\n<em><span style=\"color: #888888;\"> size(100,100);<br \/>\nbackground(40,250,150);<br \/>\nsmooth();<\/span><\/em><\/p>\n<p><em><span style=\"color: #888888;\"> for (float w=width; w&gt;0; w-=5)<br \/>\n{<br \/>\nstroke(0);<br \/>\nfill(13,w+30,50);<br \/>\nellipse(height\/2,width\/2,w,w);<br \/>\n}<\/span><\/em><\/p>\n<p>8. \u53d8\u91cf\u5206\u4e3a\u5c40\u90e8\u53d8\u91cf\u548c\u5168\u5c40\u53d8\u91cf\u3002\u7531\u540d\u79f0\u53ef\u77e5\uff0c\u5168\u5c40\u53d8\u91cf\u53ef\u4ee5\u5728\u6574\u4e2a\u7a0b\u5e8f\u7684\u4efb\u4f55\u5730\u65b9\u88ab\u8c03\u7528\uff0c\u800c\u5c40\u90e8\u53d8\u91cf\u5219\u4ec5\u80fd\u5728\u4e00\u4e2a\u7a0b\u5e8f\u5757\u4e2d\u88ab\u8c03\u7528\u3002\u5168\u5c40\u53d8\u91cf\u5728\u7a0b\u5e8f\u4e4b\u59cb\u4fbf\u88ab\u7533\u660e\uff0c\u800c\u5c40\u90e8\u53d8\u91cf\u5219\u662f\u5728\u67d0\u4e2a\u7a0b\u5e8f\u5757\u4e2d\u88ab\u7533\u660e\uff0c\u4f8b\u5982\u5728<em><span style=\"color: #888888;\">draw()<\/span><\/em>\u6216<span style=\"color: #888888;\"><em>for<\/em><\/span>\u91cc\u3002\u6bd4\u65b9\u8bf4\u4e0a\u4f8b\u7684\u53d8\u91cfx\u5219\u4ec5\u9002\u7528\u4e8e<span style=\"color: #888888;\"><em>for<\/em><\/span>\u7a0b\u5e8f\u5757\u3002<\/p>\n<p>9. \u7406\u8bba\u4e0a\uff0c\u5168\u5c40\u53d8\u91cf\u4e0e\u5c40\u90e8\u53d8\u91cf\u53ef\u4ee5\u4f7f\u7528\u76f8\u540c\u7684\u540d\u5b57\uff0c\u4f46\u662f\u7528\u5c41\u773c\u60f3\u60f3\u90fd\u77e5\u9053\uff0c\u4e3a\u4e86\u907f\u514d\u5f15\u8d77\u6df7\u4e71\uff0c\u6700\u597d\u8fd8\u662f\u522b\u8fd9\u4e48\u505aba\u3002\u3002<\/p>\n<figure id=\"attachment_517\" aria-describedby=\"caption-attachment-517\" style=\"width: 426px\" class=\"wp-caption alignright\"><a href=\"https:\/\/learn.travelchinawith.me\/wp-content\/uploads\/2009\/10\/pr6-3.gif\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-517   \" title=\"pr6-3\" src=\"https:\/\/learn.travelchinawith.me\/wp-content\/uploads\/2009\/10\/pr6-3.gif\" alt=\"pr6-3\" width=\"426\" height=\"205\" srcset=\"https:\/\/learn.travelchinawith.me\/wp-content\/uploads\/2009\/10\/pr6-3.gif 426w, https:\/\/learn.travelchinawith.me\/wp-content\/uploads\/2009\/10\/pr6-3-300x144.gif 300w\" sizes=\"auto, (max-width: 426px) 100vw, 426px\" \/><\/a><figcaption id=\"caption-attachment-517\" class=\"wp-caption-text\">pr6-3\uff0c\u7531\u4e8e\u8fd9\u91cc\u4f7f\u7528gif\uff0c\u6240\u4ee5\u989c\u8272\u6e10\u53d8\u4e0d\u662f\u5f88\u5e73\u6ed1\uff0c\u4e0d\u8fc7\u4e5f\u61d2\u5f97\u6539\u4e86\uff0c\u770b\u4e2a\u5927\u6982\u5427<\/figcaption><\/figure>\n<p>10. \u4e00\u4e2a\u4f8b\u5b50\u5f88\u597d\uff1a<br \/>\n<span style=\"color: #888888;\"><em> int count=0;<\/em><\/span><\/p>\n<p><span style=\"color: #888888;\"><em>void setup() {<br \/>\nsize(200,200);<br \/>\n}<\/em><\/span><\/p>\n<p><span style=\"color: #888888;\"><em>void draw() {<br \/>\ncount=count+1;<br \/>\nbackground(count);<br \/>\n}<\/em><\/span><em><br \/>\n<\/em> \u8fd0\u884c\u5b83\uff0c\u7136\u540e\u5c06<span style=\"color: #888888;\"><em>int count=0;<\/em><\/span>\u653e\u5165<em><span style=\"color: #888888;\">draw()<\/span><\/em>\u91cc\u7533\u660e\uff0c\u518d\u8fd0\u884c\u770b\u770b\u3002\u662f\u7684\uff0c\u8fd9\u5c31\u662f\u5168\u5c40\u4e0e\u5c40\u90e8\u53d8\u91cf\u7684\u5173\u7cfb\u4e0e\u533a\u522b\u3002<\/p>\n<p>\u672c\u8bfe\u6709\u5f88\u591a\u4f8b\u5b50\u548c\u7ec3\u4e60\uff0cDaniel\u4e00\u4e2a\u5fc5\u51fa\u7684\u7ec3\u4e60\u5c31\u662f\u8ba9\u4f60\u8bd5\u7740\u5c06\u7a0b\u5e8f\u5728<span style=\"color: #888888;\"><em>for<\/em><\/span>\u548c<span style=\"color: #888888;\"><em>while<\/em><\/span>\u4e4b\u95f4\u76f8\u4e92\u8f6c\u6362\uff0c\u4ee5\u719f\u6089\u4e24\u79cd\u5faa\u73af\u7684\u5199\u6cd5\uff0c\u5927\u5bb6\u4e5f\u53ef\u4ee5\u591a\u8bd5\u8bd5\uff0c\u770b\u770b\u54ea\u4e2a\u66f4\u9002\u5408\u4f60\u7684\u601d\u7ef4\u4e60\u60ef\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>1. \u5b66\u4f1a\u4e00\u4e2a\u65b0\u5355\u8bcd\uff1aiteration.. 2. \u5faa\u73af\u5171\u6709\u4e09\u79cd\uff1awhile\uff0cdo-while\u548cfor 3. while()\u5176\u5b9e\u5c31\u662f\uff1a\u4f60\u7ed9while\u4e00\u4e2a\u6761\u4ef6\uff0c\u7b26\u5408\u6761\u4ef6\u7684\u4ed6\u7ee7\u7eed\u5faa\u73af\u5c16\u62ec\u53f7\u5185\u7684\u5185\u5bb9\uff0c\u4e0d\u7b26\u5408\u6761\u4ef6\u4e86\uff0c\u505c\u6b62\uff0c\u6216\u8005\u5e72\u5176\u4ed6\u4e8b\u3002\u4e00\u4e2a\u5178\u578b\u7684\u4f8b\u5b50\uff1a size(100,100); background(40,250,150); smooth(); float w = width ; while (w&gt;0) { stroke(0); fill(13,w+30,50); ellipse(height\/2,width\/2,w,w); w=w-5; } 4. \u6709\u4e00\u79cd\u5faa\u73af\u53eb\u505a\u6b7b\u5faa\u73af\u3002\u3002\uff1a int x = 0; while (x &lt; 10) { println(x); x = x \u2013 1; } \u5982\u679c\u4f60\u5728pr\u4e2d\u8fd0\u884c\u8fd9\u6bb5\u4ee3\u7801\uff0c\u90a3\u4e48\u5c31\u7b49\u7740\u7a0b\u5e8f\u6b7b\u5427\u3002\u56e0\u4e3a\u5f53x\u5c0f\u4e8e10\u7684\u60c5\u51b5\u4e0b\uff0c\u5219\u65e0\u9650\u5728print\u7a97\u53e3\u5217\u5370\u51fax\u7684\u503c\uff0c\u800c\u8fd9\u91cc\uff0cx\u7684\u503c\u5c06\u6c38\u8fdc\u5c0f\u4e8e10\uff0c\u56e0\u6b64\uff0c\u7a0b\u5e8f\u5c06\u65e0\u9650\u7684\u8fd0\u884c\u4e0b\u53bb\u3002\u5f53\u7136\uff0c\u6b7b \u5f97\u8d8a\u6162\uff0c\u610f\u5473\u7740\u4f60\u7684\u7535\u8111\u6027\u80fd\u8d8a\u597d\u3002\u3002 5. for\u5faa\u73af\u7684\u5e94\u7528\uff1a \u4ece0\u6570\u52309\uff1afor (int i=0; i&lt;10; i=i+1) \u4ece0\u4ee510\u7684\u95f4\u9694\u6570\u5230100\uff1afor (int i=0; i&lt;101; i=i+10) \u4ece100\u4ee55\u7684\u95f4\u9694\u6570\u52300\uff1afor [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[57],"tags":[58],"class_list":["post-514","post","type-post","status-publish","format-standard","hentry","category-processing","tag-processing"],"blocksy_meta":[],"_links":{"self":[{"href":"https:\/\/learn.travelchinawith.me\/index.php?rest_route=\/wp\/v2\/posts\/514","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/learn.travelchinawith.me\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/learn.travelchinawith.me\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/learn.travelchinawith.me\/index.php?rest_route=\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/learn.travelchinawith.me\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=514"}],"version-history":[{"count":6,"href":"https:\/\/learn.travelchinawith.me\/index.php?rest_route=\/wp\/v2\/posts\/514\/revisions"}],"predecessor-version":[{"id":765,"href":"https:\/\/learn.travelchinawith.me\/index.php?rest_route=\/wp\/v2\/posts\/514\/revisions\/765"}],"wp:attachment":[{"href":"https:\/\/learn.travelchinawith.me\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=514"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/learn.travelchinawith.me\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=514"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/learn.travelchinawith.me\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=514"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}