{"id":170,"date":"2018-11-23T20:17:47","date_gmt":"2018-11-23T11:17:47","guid":{"rendered":"https:\/\/dalomo.net\/blog\/?p=170"},"modified":"2018-11-23T20:33:50","modified_gmt":"2018-11-23T11:33:50","slug":"%e3%83%aa%e3%83%90%e3%83%bc%e3%82%b7%e3%81%ae%e7%b5%82%e4%ba%86%e5%87%a6%e7%90%86%e3%82%92%e4%bd%9c%e3%82%8a%e3%81%9f%e3%81%84%e3%83%91%e3%82%b9%e3%81%ae%e5%87%a6%e7%90%86%e3%82%82","status":"publish","type":"post","link":"https:\/\/dalomo.net\/blog\/2018\/11\/23\/170\/","title":{"rendered":"\u30ea\u30d0\u30fc\u30b7\u306e\u7d42\u4e86\u51e6\u7406\u3092\u4f5c\u308a\u305f\u3044(+\u30d1\u30b9\u306e\u51e6\u7406\u3082)"},"content":{"rendered":"<p><iframe loading=\"lazy\" src=\"https:\/\/www.youtube.com\/embed\/_ZI1dcH36iM\" width=\"560\" height=\"315\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/p>\n<p>\u7d42\u4e86\u306e\u5224\u65ad\u3092\u4f5c\u308a\u305f\u3044\u3002\u4eca\u306f\u30d7\u30ec\u30a4\u30e4\u30fc\u4efb\u305b\u3002<\/p>\n<h2>\u7d42\u4e86\u51e6\u7406<\/h2>\n<p>\u7d42\u4e86\u51e6\u7406\u306e\u4e2d\u306b\u3001\u30d1\u30b9\u306e\u51e6\u7406\u3082\u542b\u307e\u308c\u308b\u307f\u305f\u3044\u306a\u306e\u3067\u3001\u3069\u3063\u3061\u3082\u4f5c\u3063\u3066\u3044\u304d\u305f\u3044\u3002<\/p>\n<p>\u7d42\u4e86\u6761\u4ef6\u306f<\/p>\n<ul>\n<li>\u30de\u30b9\u304c\u5168\u90e8\u57cb\u307e\u308b\n<ul>\n<li>\u77f3\u6570\u306e\u591a\u3044\u307b\u3046\u304c\u52dd\u3061<\/li>\n<li>\u540c\u6570\u306e\u5834\u5408\u306f\u5f15\u304d\u5206\u3051<\/li>\n<\/ul>\n<\/li>\n<li>\u305d\u308c\u4ee5\u5916\n<ul>\n<li>\u3069\u3061\u3089\u304b\u4e00\u8272\u306b\u306a\u308b<\/li>\n<li>\u3069\u3061\u3089\u3082\u30d1\u30b9\u3059\u308b<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>\u3053\u308c\u3067\u3044\u3044\u307f\u305f\u3044\u3002<\/p>\n<h3>checkFinish()<\/h3>\n<pre>void checkFinish (){\r\n    int AllStone = BlackStoneCount + WhiteStoneCount;\r\n    TextView ttv = parentView.findViewWithTag(\"turn\");\r\n\r\n    switch(AllStone){\r\n        case(64):\r\n            if(BlackStoneCount &gt; WhiteStoneCount) {\r\n                ttv.setText(\"\u9ed2\u306e\u52dd\u3061\u3067\u3059\");\r\n            }else if(BlackStoneCount &lt; WhiteStoneCount) {\r\n                ttv.setText(\"\u767d\u306e\u52dd\u3061\u3067\u3059\");\r\n            }else{\r\n                ttv.setText(\"\u5f15\u304d\u5206\u3051\u3067\u3059\");\r\n            }\r\n            return;\r\n\r\n        default:\r\n             if(BlackStoneCount == 0){\r\n                 ttv.setText(\"\u767d\u306e\u52dd\u3061\u3067\u3059\");\r\n                 return;\r\n             }else if(WhiteStoneCount == 0){\r\n                 ttv.setText(\"\u9ed2\u306e\u52dd\u3061\u3067\u3059\");\r\n                 return;\r\n             }\r\n\r\n             if(!canPutStone()){\r\n                 PlayerTurn = PlayerTurn * (-1);\r\n                 setTurn();\r\n                 scanBoard();\r\n             }\r\n\r\n             if(!canPutStone()){\r\n                 if(BlackStoneCount &gt; WhiteStoneCount) {\r\n                     ttv.setText(\"\u9ed2\u306e\u52dd\u3061\u3067\u3059\");\r\n                 }else if(BlackStoneCount &lt; WhiteStoneCount) {\r\n                     ttv.setText(\"\u767d\u306e\u52dd\u3061\u3067\u3059\");\r\n                 }else{\r\n                     ttv.setText(\"\u5f15\u304d\u5206\u3051\u3067\u3059\");\r\n                 }\r\n             }\r\n    }\r\n}<\/pre>\n<pre>private boolean canPutStone(){\r\n    String s;\r\n\r\n    for(TextView[] cc : CellArray) {\r\n        for (TextView c : cc) {\r\n            s = c.getText().toString();\r\n\r\n            if(s.equals(\"*\")){ return true; }\r\n        }\r\n    }\r\n    return false;\r\n}<\/pre>\n<p>\u3061\u3087\u3063\u3068\u5197\u9577\u306a\u6c17\u3082\u3059\u308b\u3002\u4e0a\u306e\u7d42\u4e86\u6761\u4ef6\u3092\u9806\u306b\u30b3\u30fc\u30c9\u5316\u3057\u305f\u3060\u3051\u3002<\/p>\n<p>\u6700\u5f8c2\u30d6\u30ed\u30c3\u30af\u304c\u30d1\u30b9\u306e\u51e6\u7406\u3067\u3001canPutStone()\u3067\u7f6e\u3051\u308b\u5834\u6240\u304c\u3042\u308b\u304b\u306e\u5224\u5b9a\u3092\u884c\u3044\u3001\u624b\u756a\u3092\u5165\u308c\u66ff\u3048\u3001\u7f6e\u304d\u77f3\u8868\u793a\u3092\u66f4\u65b0\u3057\u3001\u3082\u3046\u4e00\u5ea6\u7f6e\u3051\u308b\u5834\u6240\u304c\u3042\u308b\u304b\u5224\u65ad\u3059\u308b\u3002\u3053\u308c\u3067\u305a\u3063\u3068\u4ffa\u306e\u30bf\u30fc\u30f3\u6642\u306b\u3082\u5bfe\u5fdc\u3067\u304d\u3066\u308b\u306f\u305a\u3002<\/p>\n<p>\u306a\u304b\u306a\u304b\u30b5\u30af\u30b5\u30af\u884c\u3063\u305f\u3002\u305f\u3060\u306a\u3093\u304b\u30ea\u30d0\u30fc\u30b7\u4f5c\u308b\u306e\u98fd\u304d\u3066\u304d\u305f\u306a\u3002<\/p>\n<h4>\u8ffd\u8a18<\/h4>\n<p>\u601d\u3063\u305f\u3093\u3060\u3051\u3069\u3001\u30de\u30b9\u304c\u5168\u90e8\u57cb\u307e\u308b\u5834\u5408\u3082\u3001\u30aa\u30fc\u30eb\u4e00\u8272\u306b\u306a\u308b\u5834\u5408\u3082\u3001\u76e4\u9762\u306b\u300c*\u300d\u306f\u8868\u793a\u3055\u308c\u3066\u3044\u306a\u3044\u308f\u3051\u3067\u3002\u3066\u3044\u3046\u3053\u3068\u306f\u3001\u30d1\u30b9\u3068\u3001\u7d42\u4e86\u3060\u3051\u3067\u3044\u3044\u306e\u3067\u306f\u2026?<\/p>\n<p>\u3064\u307e\u308a<\/p>\n<pre>void checkFinish() {\r\n    TextView ttv = parentView.findViewWithTag(\"turn\");\r\n\r\n    if (!canPutStone()) {\r\n        PlayerTurn = PlayerTurn * (-1);\r\n        setTurn();\r\n        scanBoard();\r\n    }\r\n\r\n    if (!canPutStone()) {\r\n        if (BlackStoneCount &gt; WhiteStoneCount) {\r\n            ttv.setText(\"\u9ed2\u306e\u52dd\u3061\u3067\u3059\");\r\n        } else if (BlackStoneCount &lt; WhiteStoneCount) {\r\n            ttv.setText(\"\u767d\u306e\u52dd\u3061\u3067\u3059\");\r\n        } else {\r\n            ttv.setText(\"\u5f15\u304d\u5206\u3051\u3067\u3059\");\r\n        }\r\n    }\r\n}<\/pre>\n<p>\u3053\u3046\u306d\u3002\u52d5\u3044\u305f\u3088\u304a\u3044\u3002\u3061\u304f\u3057\u3087\u3046\u3081\u3002<\/p>\n<h3>\u53c2\u8003<\/h3>\n<p><a href=\"http:\/\/bassy84.net\/othello.rule2.html\">http:\/\/bassy84.net\/othello.rule2.html<\/a><\/p>\n<p><a href=\"https:\/\/www.javadrive.jp\/start\/if\/index4.html\">https:\/\/www.javadrive.jp\/start\/if\/index4.html<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u7d42\u4e86\u306e\u5224\u65ad\u3092\u4f5c\u308a\u305f\u3044\u3002\u4eca\u306f\u30d7\u30ec\u30a4\u30e4\u30fc\u4efb\u305b\u3002 \u7d42\u4e86\u51e6\u7406 \u7d42\u4e86\u51e6\u7406\u306e\u4e2d\u306b\u3001\u30d1\u30b9\u306e\u51e6\u7406\u3082\u542b\u307e\u308c\u308b\u307f\u305f\u3044\u306a\u306e\u3067\u3001\u3069\u3063\u3061\u3082\u4f5c\u3063\u3066\u3044\u304d\u305f\u3044\u3002 \u7d42\u4e86\u6761\u4ef6\u306f \u30de\u30b9\u304c\u5168\u90e8\u57cb\u307e\u308b \u77f3\u6570\u306e\u591a\u3044\u307b\u3046\u304c\u52dd\u3061 \u540c\u6570\u306e\u5834\u5408\u306f\u5f15\u304d\u5206\u3051 \u305d\u308c\u4ee5\u5916 \u3069\u3061\u3089 &hellip; <a href=\"https:\/\/dalomo.net\/blog\/2018\/11\/23\/170\/\">\u7d9a\u304d\u3092\u8aad\u3080 <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"footnotes":""},"categories":[8],"tags":[3,6,4,13],"class_list":["post-170","post","type-post","status-publish","format-standard","hentry","category-8","tag-android","tag-androidstudio","tag-4","tag-13"],"_links":{"self":[{"href":"https:\/\/dalomo.net\/blog\/wp-json\/wp\/v2\/posts\/170","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dalomo.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dalomo.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dalomo.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/dalomo.net\/blog\/wp-json\/wp\/v2\/comments?post=170"}],"version-history":[{"count":3,"href":"https:\/\/dalomo.net\/blog\/wp-json\/wp\/v2\/posts\/170\/revisions"}],"predecessor-version":[{"id":173,"href":"https:\/\/dalomo.net\/blog\/wp-json\/wp\/v2\/posts\/170\/revisions\/173"}],"wp:attachment":[{"href":"https:\/\/dalomo.net\/blog\/wp-json\/wp\/v2\/media?parent=170"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dalomo.net\/blog\/wp-json\/wp\/v2\/categories?post=170"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dalomo.net\/blog\/wp-json\/wp\/v2\/tags?post=170"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}