{"id":9606,"date":"2015-05-29T16:05:51","date_gmt":"2015-05-29T07:05:51","guid":{"rendered":"http:\/\/programminglanguage7.com\/?p=9606"},"modified":"2015-05-30T18:49:08","modified_gmt":"2015-05-30T09:49:08","slug":"post-9606","status":"publish","type":"post","link":"https:\/\/programminglanguage7.com\/?p=9606","title":{"rendered":"if\u6587\u3067\u5360\u3044\u3092\u4f5c\u308d\u3046"},"content":{"rendered":"<p><span style=\"font-size: 14pt;\">\u3053\u306e\u7ae0\u3067\u306f\u4eca\u307e\u3067\u8aac\u660e\u3057\u3066\u304d\u305fif\u6587\u3068\u914d\u5217\u3092\u4f7f\u3063\u3066\u3001\u5360\u3044\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u4f5c\u308a\u307e\u3059\u3002<\/span><br \/>\n<span style=\"font-size: 14pt;\">\u3067\u306f\u4f8b\u3092\u307f\u3066\u307f\u307e\u3057\u3087\u3046\u3002<a href=\"https:\/\/programminglanguage7.com\/wp-content\/uploads\/2015\/05\/9407.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone  wp-image-9607\" src=\"https:\/\/programminglanguage7.com\/wp-content\/uploads\/2015\/05\/9407-300x203.jpg\" alt=\"9\" width=\"366\" height=\"248\" srcset=\"https:\/\/programminglanguage7.com\/wp-content\/uploads\/2015\/05\/9407-300x203.jpg 300w, https:\/\/programminglanguage7.com\/wp-content\/uploads\/2015\/05\/9407.jpg 549w\" sizes=\"(max-width: 366px) 100vw, 366px\" \/><\/a><a href=\"https:\/\/programminglanguage7.com\/wp-content\/uploads\/2015\/05\/9408.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone  wp-image-9608\" src=\"https:\/\/programminglanguage7.com\/wp-content\/uploads\/2015\/05\/9408-292x300.jpg\" alt=\"9\" width=\"315\" height=\"324\" srcset=\"https:\/\/programminglanguage7.com\/wp-content\/uploads\/2015\/05\/9408-292x300.jpg 292w, https:\/\/programminglanguage7.com\/wp-content\/uploads\/2015\/05\/9408.jpg 498w\" sizes=\"(max-width: 315px) 100vw, 315px\" \/><\/a><\/span> <span style=\"font-size: 14pt;\">result\u306f\u5927\u5409\u304b\u3089\u5927\u51f6\u307e\u3067\u306e\u8981\u7d20\u3092\u6301\u3064\u914d\u5217\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/span><br \/>\n<span style=\"font-size: 14pt;\">answer\u306b\u306f0\u304b\u30896\u307e\u3067\u306e\u30e9\u30f3\u30c0\u30e0\u306a\u6570\u304c\u5165\u308a\u307e\u3059\u3002<\/span><br \/>\n<span style=\"font-size: 14pt;\">\u30e9\u30f3\u30c0\u30e0\u306a\u6570\u3092\u5f97\u308b\u306b\u306frand\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u3044\u307e\u3059(\u30e1\u30bd\u30c3\u30c9\u306e\u610f\u5473\u306b\u3064\u3044\u3066\u306f<a title=\"\u30e1\u30bd\u30c3\u30c9\u306b\u3064\u3044\u3066\u77e5\u308d\u3046\" href=\"https:\/\/programminglanguage7.com\/?p=9723\" target=\"_blank\">\u300c\u30e1\u30bd\u30c3\u30c9\u306b\u3064\u3044\u3066\u77e5\u308d\u3046\u300d<\/a>\u306e\u7ae0\u3067\u8aac\u660e\u3057\u307e\u3059)\u3002<a href=\"https:\/\/programminglanguage7.com\/wp-content\/uploads\/2015\/05\/9409.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-9609\" src=\"https:\/\/programminglanguage7.com\/wp-content\/uploads\/2015\/05\/9409-300x63.jpg\" alt=\"9\" width=\"300\" height=\"63\" srcset=\"https:\/\/programminglanguage7.com\/wp-content\/uploads\/2015\/05\/9409-300x63.jpg 300w, https:\/\/programminglanguage7.com\/wp-content\/uploads\/2015\/05\/9409.jpg 418w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/span> <span style=\"font-size: 14pt;\">\u6574\u6570\u5024\u3092\u5165\u529b\u3057\u305f\u5834\u5408\u306b\u306f0\u304b\u3089<a href=\"https:\/\/programminglanguage7.com\/wp-content\/uploads\/2015\/05\/9410.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-9610\" src=\"https:\/\/programminglanguage7.com\/wp-content\/uploads\/2015\/05\/9410-300x36.jpg\" alt=\"9\" width=\"300\" height=\"36\" srcset=\"https:\/\/programminglanguage7.com\/wp-content\/uploads\/2015\/05\/9410-300x36.jpg 300w, https:\/\/programminglanguage7.com\/wp-content\/uploads\/2015\/05\/9410.jpg 303w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a>\u307e\u3067\u306e\u4e71\u6570\u5024\u3092\u751f\u6210\u3057\u307e\u3059\u3002<\/span><br \/>\n<span style=\"font-size: 14pt;\">0\u3082\u3057\u304f\u306f\u4f55\u3082\u5165\u529b\u3057\u306a\u3044\u5834\u5408\u306f0\u4ee5\u4e0a 1\u672a\u6e80\u306e\u4e71\u6570\u5024\u3092\u751f\u6210\u3057\u307e\u3059\u3002<\/span><br \/>\n<span style=\"font-size: 14pt;\">\u3053\u306e\u4f8b\u306erand(7)\u3067\u3042\u308c\u30700\u304b\u30896\u307e\u3067\u306e\u4e71\u6570\u5024\u3092\u751f\u6210\u3057\u307e\u3059(7\u307e\u3067\u3067\u306f\u3042\u308a\u307e\u305b\u3093)\u3002<\/span><br \/>\n<span style=\"font-size: 14pt;\">rand(6)+1\u3067\u3042\u308c\u30701\u304b\u30896\u307e\u3067\u306e\u4e71\u6570\u5024\u3092\u751f\u6210\u3057\u307e\u3059\u3002<\/span><br \/>\n<span style=\"font-size: 14pt;\">\u4e71\u6570\u3092\u5f97\u305f\u5f8c\u306fif\u6587\u3067\u5224\u5b9a\u3092\u884c\u3044\u307e\u3059\u3002<\/span><br \/>\n<span style=\"font-size: 14pt;\">\u4f8b\u3048\u3070\u4e71\u6570\u304c0\u3067\u3042\u308c\u3070<a href=\"https:\/\/programminglanguage7.com\/wp-content\/uploads\/2015\/05\/9411.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-9611\" src=\"https:\/\/programminglanguage7.com\/wp-content\/uploads\/2015\/05\/9411.jpg\" alt=\"9\" width=\"279\" height=\"49\" \/><\/a>\u3068\u3044\u3046\u6761\u4ef6\u5f0f\u306b\u306a\u308b\u306e\u3067\u3001\u300c\u5927\u5409\u3067\u3059\u300d\u304c\u51fa\u529b\u3055\u308c\u307e\u3059\u3002<\/span><br \/>\n<span style=\"font-size: 14pt;\">\u7d50\u679c\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3001\u6bce\u56de\u9055\u3046\u5024\u304c\u51fa\u529b\u3055\u308c\u307e\u3059\u3002<a href=\"https:\/\/programminglanguage7.com\/wp-content\/uploads\/2015\/05\/9412.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-9612\" src=\"https:\/\/programminglanguage7.com\/wp-content\/uploads\/2015\/05\/9412.jpg\" alt=\"9\" width=\"240\" height=\"206\" \/><\/a><\/span> <span style=\"font-size: 14pt;\">\u3053\u308c\u3092case..when\u6587\u3067\u66f8\u304d\u63db\u3048\u308b\u3068\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059(\u5148\u982d\u306e\uff12\u884c\u306f\u7701\u7565)\u3002<a href=\"https:\/\/programminglanguage7.com\/wp-content\/uploads\/2015\/05\/9413.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone  wp-image-9613\" src=\"https:\/\/programminglanguage7.com\/wp-content\/uploads\/2015\/05\/9413-300x182.jpg\" alt=\"9\" width=\"373\" height=\"226\" srcset=\"https:\/\/programminglanguage7.com\/wp-content\/uploads\/2015\/05\/9413-300x182.jpg 300w, https:\/\/programminglanguage7.com\/wp-content\/uploads\/2015\/05\/9413.jpg 532w\" sizes=\"(max-width: 373px) 100vw, 373px\" \/><\/a><a href=\"https:\/\/programminglanguage7.com\/wp-content\/uploads\/2015\/05\/9414.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone  wp-image-9614\" src=\"https:\/\/programminglanguage7.com\/wp-content\/uploads\/2015\/05\/9414-181x300.jpg\" alt=\"9\" width=\"211\" height=\"349\" srcset=\"https:\/\/programminglanguage7.com\/wp-content\/uploads\/2015\/05\/9414-181x300.jpg 181w, https:\/\/programminglanguage7.com\/wp-content\/uploads\/2015\/05\/9414.jpg 311w\" sizes=\"(max-width: 211px) 100vw, 211px\" \/><\/a><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3053\u306e\u7ae0\u3067\u306f\u4eca\u307e\u3067\u8aac\u660e\u3057\u3066\u304d\u305fif\u6587\u3068\u914d\u5217\u3092\u4f7f\u3063\u3066\u3001\u5360\u3044\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u4f5c\u308a\u307e\u3059\u3002 \u3067\u306f\u4f8b\u3092\u307f\u3066\u307f\u307e\u3057\u3087\u3046\u3002 result\u306f\u5927\u5409\u304b\u3089\u5927\u51f6\u307e\u3067\u306e\u8981\u7d20\u3092\u6301\u3064\u914d\u5217\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002 answer\u306b\u306f0\u304b\u30896\u307e\u3067\u306e\u30e9\u30f3\u30c0\u30e0\u306a\u6570\u304c\u5165\u308a\u307e\u3059 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[557],"tags":[142,130],"class_list":["post-9606","post","type-post","status-publish","format-standard","hentry","category-ruby","tag-if","tag-rand"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/programminglanguage7.com\/index.php?rest_route=\/wp\/v2\/posts\/9606"}],"collection":[{"href":"https:\/\/programminglanguage7.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/programminglanguage7.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/programminglanguage7.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/programminglanguage7.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=9606"}],"version-history":[{"count":3,"href":"https:\/\/programminglanguage7.com\/index.php?rest_route=\/wp\/v2\/posts\/9606\/revisions"}],"predecessor-version":[{"id":10458,"href":"https:\/\/programminglanguage7.com\/index.php?rest_route=\/wp\/v2\/posts\/9606\/revisions\/10458"}],"wp:attachment":[{"href":"https:\/\/programminglanguage7.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=9606"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/programminglanguage7.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=9606"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/programminglanguage7.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=9606"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}