{"id":279,"date":"2017-06-02T20:59:39","date_gmt":"2017-06-02T11:59:39","guid":{"rendered":"https:\/\/do-gugan.com\/swift\/?p=279"},"modified":"2017-06-02T20:59:39","modified_gmt":"2017-06-02T11:59:39","slug":"%e8%ab%96%e7%90%86%e6%bc%94%e7%ae%97%e5%ad%90-1-not%e6%bc%94%e7%ae%97%e5%ad%90%e3%82%92%e4%bd%bf%e3%81%86","status":"publish","type":"post","link":"https:\/\/do-gugan.com\/swift\/?p=279","title":{"rendered":"\u8ad6\u7406\u6f14\u7b97\u5b50 1. NOT\u6f14\u7b97\u5b50\u3092\u4f7f\u3046"},"content":{"rendered":"<p>\u8ad6\u7406\u6f14\u7b97\u5b50\u306fif\u6587\u3084\u5f8c\u3067\u51fa\u3066\u304f\u308bwhile\u6587\u306a\u3069\u306e\u6761\u4ef6\u306b\u3088\u308a\u67d4\u8edf\u3067\u8907\u96d1\u306a\u6307\u5b9a\u3092\u3067\u304d\u308b\u3088\u3046\u306b\u3059\u308b\u30c6\u30af\u30cb\u30c3\u30af\u3067\u3059\u3002\u6700\u521d\u306f\u3082\u3063\u3068\u3082\u5358\u7d14\u306aNOT\u6f14\u7b97\u5b50\u3002\u30d6\u30fc\u30eb\u5024\u306etrue\u3092false\u306b\u3001false\u3092true\u306b\u3068\u53cd\u8ee2\u3057\u307e\u3059\u3002\u3069\u3093\u306a\u6642\u306b\u5f79\u306b\u7acb\u3064\u306e\u3067\u3057\u3087\u3046\uff1f<br \/>\n\u4f8b\u3048\u3070\u3001\u5b9d\u77f3\u306e\u6709\u7121\u3092\u30c1\u30a7\u30c3\u30af\u3059\u308bisOnGem\u3068\u3044\u3046\u306e\u304c\u3042\u308a\u307e\u3057\u305f\u3002\u5b9d\u77f3\u304c\u3042\u3063\u305f\u3089true\u3001\u306a\u3051\u308c\u3070false\u3068\u306a\u308b\u306e\u3067\u3001if\u6587\u3067\u306f<\/p>\n<pre class=\"lang:swift decode:true \" >if isOnGem {\r\n    \/\/\u5b9d\u77f3\u304c\u3042\u3063\u305f\u3089\u3057\u305f\u3044\u51e6\u7406\r\n} else {\r\n    \/\/\u5b9d\u77f3\u304c\u306a\u304b\u3063\u305f\u3089\u3057\u305f\u3044\u51e6\u7406\r\n}<\/pre>\n<p>\u306a\u3093\u3066\u66f8\u304d\u307e\u3059\u3002\u305f\u3060\u3057\u3001\u5b9d\u77f3\u304c\u306a\u304b\u3063\u305f\u6642\u306b\u3057\u304b\u3084\u308a\u305f\u3044\u3053\u3068\u304c\u306a\u304b\u3063\u305f\u3089\u3069\u3046\u3067\u3057\u3087\u3046\uff1f\u6700\u521d\u306etrue\u51e6\u7406\u306e\u30d6\u30ed\u30c3\u30af\u3092\u7a7a\u306b\u3057\u3066\u3082\u3044\u3044\u3093\u3067\u3059\u304c\u3001\u3061\u3087\u3063\u3068\u7121\u99c4\u3063\u307d\u3044\u3067\u3059\u3002\u305d\u3093\u306a\u6642\u306bisOnGem\u306e\u524d\u306b!\u3092\u3064\u3051\u3066true\u3092false\u3092\u9006\u8ee2\u3055\u305b\u3066\u3084\u308b\u306e\u3067\u3059\u3002<\/p>\n<pre class=\"lang:swift decode:true \" >if !isOnGem {\r\n    \/\/\u5b9d\u77f3\u304c\u306a\u304b\u3063\u305f\u3089\u3057\u305f\u3044\u51e6\u7406\r\n}<\/pre>\n<p>isOnGem\u304ctrue\u3060\u3063\u305f\u6642\u3001!\u306b\u3088\u3063\u3066\u3072\u3063\u304f\u308a\u8fd4\u3063\u3066if\u6587\u306b\u306ffalse\u3060\u3068\u4f1d\u3048\u3089\u308c\u307e\u3059\u3002!\u306f\u5929\u90aa\u9b3c\uff08\u3042\u307e\u306e\u3058\u3083\u304f\uff09\u306a\u4f1d\u8a00\u4fc2\u306a\u306e\u3067\u3059\u3002<\/p>\n<p>\u3055\u3066\u30b9\u30c6\u30fc\u30b8\u306e\u65b9\u306f4\u30de\u30b9\u306e\u4e2d\u5fc3\u30eb\u30fc\u30c8\u3092\u9032\u307f\u306a\u304c\u3089\u3001\u5b9d\u77f3\u304c\u3042\u3063\u305f\u3089\u3068\u308a\u3001\u306a\u304b\u3063\u305f\u3089\u8107\u9053\u3078\u964d\u308a\u3066\u3044\u3063\u305f\u5148\u306e\u5b9d\u77f3\u3092\u3068\u3063\u3066\u623b\u308a\u307e\u3059\u3002\u3076\u3063\u3061\u3083\u3051!\u3067\u53cd\u8ee2\u3057\u306a\u304f\u3066\u3082\u5168\u4f53\u306e\u884c\u6570\u306f\u5909\u308f\u3089\u306a\u3044\u306e\u3067\u3059\u304c\u3001\u7df4\u7fd2\u3060\u3068\u601d\u3063\u3066!\u3092\u4f7f\u3063\u3066true\u30d6\u30ed\u30c3\u30af\u3068false\u30d6\u30ed\u30c3\u30af\u306e\u4e2d\u8eab\u304c\u9006\u306b\u306a\u308b\u3053\u3068\u3092\u5b9f\u611f\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002 <\/p>\n<pre class=\"lang:swift decode:true \" >\r\nfor i in 1 ... 4 {\r\n    moveForward()\r\n    if !isOnGem {\r\n        \/\/!\u304c\u3042\u308b\u306e\u3067\u3001\u300c\u5b9d\u77f3\u304c\u306a\u304b\u3063\u305f\u300d\u5834\u5408\u306b\u3053\u3053\u304c\u51e6\u7406\u3055\u308c\u307e\u3059\r\n        turnLeft()\r\n        moveForward()\r\n        moveForward()\r\n        collectGem()\r\n        turnLeft()\r\n        turnLeft()\r\n        moveForward()\r\n        moveForward()\r\n        turnLeft()\r\n    } else {\r\n        \/\/\u9006\u306b\u3053\u3061\u3089\u304c\u300c\u5b9d\u77f3\u304c\u3042\u3063\u305f\u300d\u5834\u5408\u3067\u3059\r\n        collectGem()\r\n    }\r\n}<\/pre>\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>\u8ad6\u7406\u6f14\u7b97\u5b50\u306fif\u6587\u3084\u5f8c\u3067\u51fa\u3066\u304f\u308bwhile\u6587\u306a\u3069\u306e\u6761\u4ef6\u306b\u3088\u308a\u67d4\u8edf\u3067\u8907\u96d1\u306a\u6307\u5b9a\u3092\u3067\u304d\u308b\u3088\u3046\u306b\u3059\u308b\u30c6\u30af\u30cb\u30c3\u30af\u3067\u3059\u3002\u6700\u521d\u306f\u3082\u3063\u3068\u3082\u5358\u7d14\u306aNOT\u6f14\u7b97\u5b50\u3002\u30d6\u30fc\u30eb\u5024\u306etrue\u3092false\u306b\u3001false\u3092true\u306b\u3068\u53cd\u8ee2\u3057\u307e\u3059\u3002\u3069\u3093\u306a &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/do-gugan.com\/swift\/?p=279\" class=\"more-link\"><span class=\"screen-reader-text\">&#8220;\u8ad6\u7406\u6f14\u7b97\u5b50 1. NOT\u6f14\u7b97\u5b50\u3092\u4f7f\u3046&#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":[2,9],"tags":[],"class_list":["post-279","post","type-post","status-publish","format-standard","hentry","category-learncode1","category-logicaloperator"],"_links":{"self":[{"href":"https:\/\/do-gugan.com\/swift\/index.php?rest_route=\/wp\/v2\/posts\/279","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=279"}],"version-history":[{"count":1,"href":"https:\/\/do-gugan.com\/swift\/index.php?rest_route=\/wp\/v2\/posts\/279\/revisions"}],"predecessor-version":[{"id":280,"href":"https:\/\/do-gugan.com\/swift\/index.php?rest_route=\/wp\/v2\/posts\/279\/revisions\/280"}],"wp:attachment":[{"href":"https:\/\/do-gugan.com\/swift\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=279"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/do-gugan.com\/swift\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=279"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/do-gugan.com\/swift\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=279"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}