{"id":127,"date":"2017-05-25T16:16:41","date_gmt":"2017-05-25T07:16:41","guid":{"rendered":"https:\/\/do-gugan.com\/swift\/?p=127"},"modified":"2017-05-28T01:11:23","modified_gmt":"2017-05-27T16:11:23","slug":"%e3%83%91%e3%83%a9%e3%83%a1%e3%83%bc%e3%82%bf-1-%e3%82%82%e3%81%a3%e3%81%a8%e9%81%a0%e3%81%8f%e3%81%be%e3%81%a7%e9%80%b2%e3%82%80","status":"publish","type":"post","link":"https:\/\/do-gugan.com\/swift\/?p=127","title":{"rendered":"\u30d1\u30e9\u30e1\u30fc\u30bf 1.\u3082\u3063\u3068\u9060\u304f\u307e\u3067\u9032\u3080"},"content":{"rendered":"<p>\u3064\u3044\u306b\u5f15\u6570\u306e\u5c0e\u5165\u3067\u3059\u3002<br \/>\n\u95a2\u6570\u306f\u6c7a\u307e\u3063\u305f\u51e6\u7406\u3092\u3042\u3061\u3053\u3061\u3067\u4f55\u5ea6\u3082\u5b9f\u884c\u3055\u305b\u308b\u306e\u306b\u306f\u4fbf\u5229\u3067\u3059\u304c\u3001\u307b\u3093\u306e\u3061\u3087\u3063\u3068\u3060\u3051\u52d5\u304d\u3092\u5909\u3048\u305f\u3044\u6642\u304c\u3042\u308a\u307e\u3059\u3002\u307b\u307c\u540c\u3058\u5185\u5bb9\u306a\u3093\u3060\u3051\u3069\u3001\u66f2\u304c\u308b\u5411\u304d\u304c\u53f3\u306a\u3082\u306e\u3068\u5de6\u306a\u3082\u306e\u3067\u305d\u308c\u305e\u308c\u306e\u95a2\u6570\u3092\u4f5c\u3063\u3066\u4f7f\u3044\u5206\u3051\u308b\u3001\u3068\u3044\u3046\u306e\u306f\u975e\u52b9\u7387\u3067\u3059\u3002\u305d\u3093\u306a\u6642\u306e\u70ba\u306b\u3001\u95a2\u6570\u547c\u3073\u51fa\u3057\u6642\u306b\u8ffd\u52a0\u6307\u793a\u3092\u52a0\u3048\u308b\u306e\u304c\u5f15\u6570\uff08\u30d1\u30e9\u30e1\u30fc\u30bf\uff09\u3067\u3059\u3002<br \/>\n\u95a2\u6570\u306e\u547c\u3073\u51fa\u3057\u306f\u4f1d\u66f8\u9ce9\u3092\u98db\u3070\u3059\u3088\u3046\u306a\u3082\u306e\u3060\u3068\u601d\u3063\u3066\u304f\u3060\u3055\u3044\u3002\u9ce9\u306f\u81ea\u5206\u306e\u540d\u524d\u306e\u3064\u3044\u305f\u5de3\uff08func\uff09\u3078\u98db\u3093\u3067\u884c\u304d\u3001func\u306e\u756a\u4eba\u306f\u9ce9\u304c\u98db\u3093\u3067\u304d\u305f\u306e\u3092\u5408\u56f3\u306b\u6c7a\u3081\u3089\u308c\u305f\u4ed5\u4e8b\u3092\u958b\u59cb\u3057\u307e\u3059\u3002\u5f15\u6570\u306f\u9ce9\u306e\u8db3\u306b\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u7d50\u3093\u3067\u98db\u3070\u3059\u3088\u3046\u306a\u3082\u306e\u3067\u3059\u3002\u756a\u4eba\u306f\u5358\u306b\u9ce9\u304c\u98db\u3093\u3067\u304d\u305f\u3068\u3044\u3046\u5408\u56f3\u3060\u3051\u3067\u306a\u304f\u3001\u8db3\u306b\u304f\u304f\u308a\u3064\u3051\u3089\u308c\u305f\u4f1d\u8a00\u3092\u307f\u3066\u3001\u4ed5\u4e8b\u306e\u5185\u5bb9\u3092\u8abf\u6574\u3059\u308b\u306e\u3067\u3059\u3002<br \/>\n\u4eca\u307e\u3067\u79c1\u306e\u56de\u7b54\u4f8b\u3067\u4f55\u5ea6\u304b\u3001<\/p>\n<pre class=\"lang:swift decode:true \" >\r\nfunc move3() {\r\n    for i in 1 ... 3 {\r\n        expert.moveForward()\r\n    }\r\n}<\/pre>\n<p>\u306a\u3093\u3066\u95a2\u6570\u3092\u4f5c\u3063\u3066\u304d\u307e\u3057\u305f\u3002\u756a\u4eba\u306f\u9ce9\u304c\u98db\u3093\u3067\u304d\u305f\u3089\u6a5f\u68b0\u7684\u306b\u4e00\u5f8b\u300c3\u6b69\u9032\u3080\u300d\u3068\u3044\u3046\u4ed5\u4e8b\u3092\u3057\u307e\u3059\u3002\u3057\u304b\u3057\u3082\u30572\u6b69\u30844\u6b69\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u3082\u5fc5\u8981\u306b\u306a\u3063\u305f\u3089\u3069\u3046\u3067\u3057\u3087\u3046\uff1f\u3044\u3061\u3044\u3061move2()\u3084move4()\u3092\u4f5c\u308b\u306e\u3067\u3057\u3087\u3046\u304b\uff1f\u305d\u308c\u305e\u308c\u306b\u756a\u4eba\u3092\u96c7\u3063\u3066\u305f\u3089\u4eba\u4ef6\u8cbb\u304c\u5927\u5909\u3067\u3059\u306d(\u7b11)\u3002<br \/>\n\u305d\u3093\u306a\u6642\u306b\u6d3b\u8e8d\u3059\u308b\u306e\u304c\u307e\u3055\u306b\u3053\u306e\u5f15\u6570\u3067\u3059\u3002\u756a\u4eba\u306b\u300c\u6b69\u6570\u306f\u6bce\u56de\u4f1d\u8a00\u3067\u4f1d\u3048\u308b\u304b\u3089\u3001\u305d\u308c\u306b\u3042\u308f\u305b\u3066\u8abf\u6574\u3057\u3066\u304f\u308c\u300d\u3068\u7d04\u675f\u4e8b\u3092\u6c7a\u3081\u308b\u308f\u3051\u3067\u3059\u3002<\/p>\n<pre class=\"lang:swift decode:true \" >\r\nfunc move(distance: Int) {\r\n    for i in 1 ... distance {\r\n        expert.moveForward()\r\n    }\r\n}\r\n<\/pre>\n<p>\u306e\u3088\u3046\u306b\u95a2\u6570\u3092\u4f5c\u3063\u3066\u304a\u304d\u307e\u3059\u3002\u95a2\u6570\u540d\u306e\u5f8c\u308d\u306b\u3044\u3064\u3082\u8b0e\u306e()\u304c\u3064\u3044\u3066\u307e\u3057\u305f\u304c\u3001\u3064\u3044\u306b\u4e2d\u8eab\u304c\u5165\u3063\u305f\u308f\u3051\u3067\u3059\u3002distance\uff08\u8ddd\u96e2\uff09\u3068\u3044\u3046\u540d\u524d\u3067Int\uff08\u6574\u6570\u5024\uff09\u3092()\u306e\u4e2d\u306b\u66f8\u3051\u308b\u3088\u3001\u3068\u5ba3\u8a00\u3057\u3066\u3044\u307e\u3059\u3002\u305d\u3057\u3066\u3001for\u6587\u306e\u7e70\u308a\u8fd4\u3057\u56de\u6570\u3092\u66f8\u3044\u3066\u308b\u3068\u3053\u308d\u306b\u3082distance\u3068\u66f8\u304b\u308c\u3066\u3044\u307e\u3059\u3002<br \/>\n\u305d\u3057\u3066\u547c\u3073\u51fa\u3059\u6642\u306f\u3053\u3046\u3002<\/p>\n<pre class=\"lang:swift decode:true \" >\r\nmove(distance:3)\r\n<\/pre>\n<p>\u3053\u3046\u3059\u308b\u3068\u3001\u547c\u3073\u51fa\u3059\u6642\u306b\u6307\u5b9a\u3057\u305f5\u3068\u3044\u3046\u6570\u5b57\u304c\u3001\u5b9f\u969b\u306b\u95a2\u6570\u306e\u4e2d\u8eab\u304c\u5b9f\u884c\u3055\u308c\u308b\u6642\u3001distance\u3068\u66f8\u3044\u305f\u3068\u3053\u308d\u306b\u304b\u308f\u308a\u306b\u5165\u3063\u3066\u304f\u308c\u307e\u3059\u3002\u306a\u306e\u3067\u3001<\/p>\n<pre class=\"lang:swift decode:true \" >\r\nmove(distance:2)\r\n<\/pre>\n<p>\u306a\u3089for\u6587\u306f2\u56de\u7e70\u308a\u8fd4\u3055\u308c\u307e\u3059\u3057\u3001<\/p>\n<pre class=\"lang:swift decode:true \" >\r\nmove(distance:4)\r\n<\/pre>\n<p>\u306a\u30894\u56de\u306b\u306a\u308a\u307e\u3059\u3002\u6570\u5b57\u9055\u3044\u306efunc\u6587\u3092\u305f\u304f\u3055\u3093\u66f8\u304b\u306a\u304f\u3066\u3088\u304f\u306a\u308b\u308f\u3051\u3067\u3059\u3002\u756a\u4eba\u306f\u4e00\u4eba\u3067\u6e08\u307f\u307e\u3059\uff01<\/p>\n<p>\u3055\u3066\u3001\u3053\u308c\u3092\u8e0f\u307e\u3048\u3066\u56de\u7b54\u4f8b\u3067\u3059\u3002<\/p>\n<pre class=\"lang:swift decode:true \" >\r\n\/\/expert\u541b\u306e\u6e96\u5099\r\nlet expert = Expert()\r\n\r\n\/\/\u5f15\u6570\u3068\u3057\u3066\u79fb\u52d5\u8ddd\u96e2\u3092\u6307\u5b9a\u3067\u304d\u308b\u524d\u9032\u95a2\u6570\r\nfunc move(distance: Int) {\r\n    for i in 1 ... distance {\r\n        expert.moveForward()\r\n    }\r\n}\r\n\r\n\/\/\u3053\u3053\u304b\u3089\u672c\u7de8\u3002move()\u95a2\u6570\u3092\u99c6\u4f7f\u3057\u3066\u30af\u30ea\u30a2\r\nmove(distance: 6)\r\nexpert.turnRight()\r\nmove(distance: 2)\r\nexpert.turnRight()\r\nmove(distance: 5)\r\nexpert.turnLeft()\r\nmove(distance: 5)\r\nexpert.turnLeft()\r\nexpert.turnLockUp()\r\nexpert.turnLeft()\r\nmove(distance: 3)\r\nexpert.turnRight()\r\nmove(distance: 3)\r\nexpert.turnRight()\r\nmove(distance: 4)\r\nexpert.collectGem()<\/pre>\n<p>\u306a\u304a\u4eca\u56de\u306f\u8ddd\u96e2\u3092\u6307\u5b9a\u3059\u308b\u56e0\u6570\u3068\u3044\u3046\u3053\u3068\u3067distance\u3068\u3044\u3046\u8a00\u8449\u3092\u4f7f\u3063\u3066\u3044\u307e\u3059\u304c\u3001\u3053\u3053\u306f\u5358\u306a\u308b\u5909\u6570\u306e\u540d\u524d\u306a\u306e\u3067\u3001\u305d\u306e\u5909\u6570\u306e\u4f7f\u3044\u9053\u3092\u8868\u3057\u305f\u308f\u304b\u308a\u3084\u3059\u3044\u3082\u306e\u3092\u4f7f\u3048\u3070OK\u3067\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>\u3064\u3044\u306b\u5f15\u6570\u306e\u5c0e\u5165\u3067\u3059\u3002 \u95a2\u6570\u306f\u6c7a\u307e\u3063\u305f\u51e6\u7406\u3092\u3042\u3061\u3053\u3061\u3067\u4f55\u5ea6\u3082\u5b9f\u884c\u3055\u305b\u308b\u306e\u306b\u306f\u4fbf\u5229\u3067\u3059\u304c\u3001\u307b\u3093\u306e\u3061\u3087\u3063\u3068\u3060\u3051\u52d5\u304d\u3092\u5909\u3048\u305f\u3044\u6642\u304c\u3042\u308a\u307e\u3059\u3002\u307b\u307c\u540c\u3058\u5185\u5bb9\u306a\u3093\u3060\u3051\u3069\u3001\u66f2\u304c\u308b\u5411\u304d\u304c\u53f3\u306a\u3082\u306e\u3068\u5de6\u306a\u3082\u306e\u3067\u305d\u308c\u305e\u308c\u306e\u95a2\u6570\u3092\u4f5c\u3063\u3066\u4f7f\u3044\u5206\u3051 &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/do-gugan.com\/swift\/?p=127\" class=\"more-link\"><span class=\"screen-reader-text\">&#8220;\u30d1\u30e9\u30e1\u30fc\u30bf 1.\u3082\u3063\u3068\u9060\u304f\u307e\u3067\u9032\u3080&#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":[3,12],"tags":[],"class_list":["post-127","post","type-post","status-publish","format-standard","hentry","category-learncode2","category-parameter"],"_links":{"self":[{"href":"https:\/\/do-gugan.com\/swift\/index.php?rest_route=\/wp\/v2\/posts\/127","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=127"}],"version-history":[{"count":5,"href":"https:\/\/do-gugan.com\/swift\/index.php?rest_route=\/wp\/v2\/posts\/127\/revisions"}],"predecessor-version":[{"id":134,"href":"https:\/\/do-gugan.com\/swift\/index.php?rest_route=\/wp\/v2\/posts\/127\/revisions\/134"}],"wp:attachment":[{"href":"https:\/\/do-gugan.com\/swift\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=127"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/do-gugan.com\/swift\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=127"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/do-gugan.com\/swift\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=127"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}