{"id":188,"date":"2017-05-28T03:58:00","date_gmt":"2017-05-27T18:58:00","guid":{"rendered":"https:\/\/do-gugan.com\/swift\/?p=188"},"modified":"2019-12-27T04:05:50","modified_gmt":"2019-12-26T19:05:50","slug":"%e9%96%a2%e6%95%b0-2-%e6%96%b0%e3%81%97%e3%81%84%e9%96%a2%e6%95%b0%e3%82%92%e4%bd%9c%e3%82%8b","status":"publish","type":"post","link":"https:\/\/do-gugan.com\/swift\/?p=188","title":{"rendered":"\u95a2\u6570 2. \u65b0\u3057\u3044\u95a2\u6570\u3092\u4f5c\u308b"},"content":{"rendered":"<p>\u524d\u30b9\u30c6\u30fc\u30b8\u3067\u3001turnLeft()\u30923\u56de\u9023\u7d9a\u3067\u4f7f\u3046\u306890\u00b0x3=270\u00b0\u56de\u3063\u3066\u7d50\u679c\u7684\u306b\u53f3\u5411\u304d\u306b\u306a\u308c\u308b\u3053\u3068\u304c\u308f\u304b\u308a\u307e\u3057\u305f\u304c\u3001\u305d\u308c\u3092\u6bce\u56de\u6253\u3064\u3068\u30b3\u30fc\u30c9\u304c\u9577\u304f\u306a\u3063\u3066\u898b\u3065\u3089\u304f\u306a\u3063\u3066\u3057\u307e\u3044\u307e\u3059\u3002<br \/>\n\u305d\u3053\u3067\u767b\u5834\u3059\u308b\u306e\u304cfunc\u30b3\u30de\u30f3\u30c9\u3067\u3059\u3002\u3042\u308b\u30b3\u30de\u30f3\u30c9\u306e\u30bb\u30c3\u30c8\u3092\u30d1\u30c3\u30af\u306b\u3057\u3066\u540d\u524d\u3092\u4ed8\u3051\u3066\u3001\u305d\u306e\u540d\u524d\u3092\u30b3\u30de\u30f3\u30c9\u3068\u3057\u3066\u547c\u3073\u51fa\u305b\u3070\u3001\u30bb\u30c3\u30c8\u306e\u4e2d\u8eab\u3092\u9023\u7d9a\u3057\u3066\u5b9f\u884c\u3057\u3066\u304f\u308c\u308b\u3068\u3044\u3046\u3082\u306e\u3067\u3059\u3002\u3053\u306e\u30bb\u30c3\u30c8\u306e\u3053\u3068\u3092\u95a2\u6570\u3068\u547c\u3073\u307e\u3059\u3002\u6570\u5b66\u306e\u8a00\u8449\u306a\u306e\u3067\u3084\u3084\u99b4\u67d3\u307f\u3065\u3089\u3044\u3067\u3059\u304c\u3001\u82f1\u8a9e\u306efunction\u3092\u8a33\u3057\u305f\u3082\u306e\u3067\u3001\u30b3\u30de\u30f3\u30c9\u540d\u306efunc\u306f\u305d\u308c\u3092\u7565\u3057\u305f\u3082\u306e\u3067\u3059\u3002<br \/>\n\u4f7f\u3044\u65b9\u306f\u3001<\/p>\n<pre class=\"lang:swift decode:true \">func \u95a2\u6570\u306e\u540d\u524d() {\n    \u30bb\u30c3\u30c8\u3067\u5b9f\u884c\u3057\u305f\u3044\u30b3\u30de\u30f3\u30c91\n    \u30bb\u30c3\u30c8\u3067\u5b9f\u884c\u3057\u305f\u3044\u30b3\u30de\u30f3\u30c92\n    \u30bb\u30c3\u30c8\u3067\u5b9f\u884c\u3057\u305f\u3044\u30b3\u30de\u30f3\u30c93\n    ....\n}<\/pre>\n<p>\u3068\u3044\u3046\u611f\u3058\u3067\u3059\u3002\u95a2\u6570\u306e\u540d\u524d\u306f\u81ea\u5206\u3067\u597d\u304d\u306b\u6c7a\u3081\u3089\u308c\u307e\u3059\u3002\u305d\u306e\u5f8c\u306b()\u3092\u3064\u3051\u307e\u3059\uff08\u610f\u5473\u306f\u8ffd\u3005\u308f\u304b\u308a\u307e\u3059\uff09\u3002\u6b21\u306b{\u3092\u66f8\u3044\u3066\u6700\u521d\u306e\u884c\u306f\u7d42\u308f\u308a\u3067\u3059\u3002\u6b21\u306e\u884c\u304b\u3089\u30bb\u30c3\u30c8\u3067\u5b9f\u884c\u3057\u305f\u3044\u30b3\u30de\u30f3\u30c9\u3092\u9806\u306b\u66f8\u3044\u3066\u3044\u304d\u307e\u3059\u3002\u4f55\u884c\u3067\u3082\u69cb\u3044\u307e\u305b\u3093\u3002\u305d\u3057\u3066\u6700\u5f8c\u306e\u30b3\u30de\u30f3\u30c9\u3092\u66f8\u3044\u305f\u3089\u3082\u3046\u4e00\u5ea6\u6539\u884c\u3057\u3066\u6700\u5f8c\u306b}\u3092\u66f8\u304d\u307e\u3059\u3002{\u3068}\u3067\u306f\u3055\u307e\u308c\u305f\u884c\u304c\u30bb\u30c3\u30c8\u5185\u5bb9\u3068\u3044\u3046\u3053\u3068\u3067\u3059\u3002<\/p>\n<p>\u3067\u306f\u3055\u3063\u305d\u304ffunc\u3092\u4f7f\u3063\u3066\u3001turnRight()\u3068\u3059\u308b\u3068turnLeft()\u304c3\u56de\u9023\u7d9a\u3067\u5b9f\u884c\u3055\u308c\u308b\u95a2\u6570\u3092\u4f5c\u308a\u3001\u305d\u308c\u3092\u4f7f\u3063\u3066\u30b9\u30c6\u30fc\u30b8\u3092\u30af\u30ea\u30a2\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre class=\"lang:swift decode:true \">\/\/turnLeft()\u30b3\u30de\u30f3\u30c9 3\u56de\u3092\u30d1\u30c3\u30af\u306b\u3057\u3066turnRight()\u30b3\u30de\u30f3\u30c9\u3092\u4f5c\u308b\nfunc turnRight() {\n    turnLeft()\n    turnLeft()\n    turnLeft()\n}\n\/\/func\u306e{}\u306e\u4e2d\u306b\u66f8\u3044\u305f\u30b3\u30de\u30f3\u30c9\u306f\u95a2\u6570\u540d\u3067\u547c\u3073\u51fa\u3055\u308c\u306a\u3044\u9650\u308a\u5b9f\u884c\u3055\u308c\u307e\u305b\u3093\u3002\n\/\/\u3064\u307e\u308a\u3053\u3053\u307e\u3067\u306e\u6642\u70b9\u3067\u306f\u898b\u305f\u76ee\u4f55\u3082\u8d77\u304d\u307e\u305b\u3093\u3002\n\/\/\u2193\u3053\u3053\u304b\u3089\u304c\u672c\u7de8\nmoveForward()\nturnLeft()\nmoveForward()\nturnRight()  \/\/func\u3067\u4f5c\u3063\u305f\u30aa\u30ea\u30b8\u30ca\u30eb\u95a2\u6570\u306e\u547c\u3073\u51fa\u3057\nmoveForward()\nturnRight()  \/\/func\u3067\u4f5c\u3063\u305f\u30aa\u30ea\u30b8\u30ca\u30eb\u95a2\u6570\u306e\u547c\u3073\u51fa\u3057\nmoveForward()\nturnRight()  \/\/func\u3067\u4f5c\u3063\u305f\u30aa\u30ea\u30b8\u30ca\u30eb\u95a2\u6570\u306e\u547c\u3073\u51fa\u3057\nmoveForward()\nturnLeft()\nmoveForward()\ntoggleSwitch()\n<\/pre>\n<p>\u5fc5\u9808\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u304c\u3001{\u3068}\u306e\u9593\u306b\u3042\u308b\u884c\u306f\u3001\u5148\u982d\u306b\u7a7a\u767d\u30924\u3064\u5165\u308c\u3066\u53f3\u306b\u30ba\u30e9\u3057\u3066\u304a\u304f\u3068\u3001\u30b3\u30fc\u30c9\u3092\u773a\u3081\u305f\u6642\u306b\u3069\u3053\u304b\u3089\u3069\u3053\u304c\u95a2\u6570\u306e\u5185\u5bb9\u306a\u306e\u304b\u898b\u3084\u3059\u304f\u306a\u308a\u307e\u3059\u3002\u30a2\u30d7\u30ea\u304c\u81ea\u52d5\u3067\u3084\u3063\u3066\u304f\u308c\u308b\u5834\u5408\u3082\u3042\u308a\u307e\u3059\u3002<\/p>\n<script type=\"text\/javascript\">amzn_assoc_ad_type =\"responsive_search_widget\"; amzn_assoc_tracking_id =\"doguganprojec-22\"; amzn_assoc_marketplace =\"amazon\"; amzn_assoc_region =\"JP\"; amzn_assoc_placement =\"\"; amzn_assoc_search_type = \"search_widget\";amzn_assoc_width =\"500\"; amzn_assoc_height =\"400\"; amzn_assoc_default_search_category =\"\"; amzn_assoc_default_search_key =\"iPad\";amzn_assoc_theme =\"light\"; amzn_assoc_bg_color =\"FFFFFF\"; <\/script><script src=\"\/\/z-fe.amazon-adsystem.com\/widgets\/q?ServiceVersion=20070822&Operation=GetScript&ID=OneJS&WS=1&Marketplace=JP\"><\/script>","protected":false},"excerpt":{"rendered":"<p>\u524d\u30b9\u30c6\u30fc\u30b8\u3067\u3001turnLeft()\u30923\u56de\u9023\u7d9a\u3067\u4f7f\u3046\u306890\u00b0x3=270\u00b0\u56de\u3063\u3066\u7d50\u679c\u7684\u306b\u53f3\u5411\u304d\u306b\u306a\u308c\u308b\u3053\u3068\u304c\u308f\u304b\u308a\u307e\u3057\u305f\u304c\u3001\u305d\u308c\u3092\u6bce\u56de\u6253\u3064\u3068\u30b3\u30fc\u30c9\u304c\u9577\u304f\u306a\u3063\u3066\u898b\u3065\u3089\u304f\u306a\u3063\u3066\u3057\u307e\u3044\u307e\u3059\u3002 \u305d\u3053\u3067\u767b\u5834\u3059\u308b\u306e\u304cfunc\u30b3\u30de\u30f3\u30c9\u3067 &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/do-gugan.com\/swift\/?p=188\" class=\"more-link\"><span class=\"screen-reader-text\">&#8220;\u95a2\u6570 2. \u65b0\u3057\u3044\u95a2\u6570\u3092\u4f5c\u308b&#8221; \u306e<\/span>\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[19,2,6],"tags":[],"class_list":["post-188","post","type-post","status-publish","format-standard","hentry","category-swift51","category-learncode1","category-function"],"_links":{"self":[{"href":"https:\/\/do-gugan.com\/swift\/index.php?rest_route=\/wp\/v2\/posts\/188","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/do-gugan.com\/swift\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/do-gugan.com\/swift\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/do-gugan.com\/swift\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/do-gugan.com\/swift\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=188"}],"version-history":[{"count":4,"href":"https:\/\/do-gugan.com\/swift\/index.php?rest_route=\/wp\/v2\/posts\/188\/revisions"}],"predecessor-version":[{"id":513,"href":"https:\/\/do-gugan.com\/swift\/index.php?rest_route=\/wp\/v2\/posts\/188\/revisions\/513"}],"wp:attachment":[{"href":"https:\/\/do-gugan.com\/swift\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=188"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/do-gugan.com\/swift\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=188"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/do-gugan.com\/swift\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=188"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}