{"id":30376,"date":"2015-05-28T01:53:06","date_gmt":"2015-05-27T16:53:06","guid":{"rendered":"http:\/\/www.softantenna.com\/wp\/?p=30376"},"modified":"2015-05-28T01:53:06","modified_gmt":"2015-05-27T16:53:06","slug":"fizzbuzz-alternatives","status":"publish","type":"post","link":"https:\/\/softantenna.com\/blog\/fizzbuzz-alternatives\/","title":{"rendered":"\u30b3\u30df\u30e5\u529b\u3088\u308a\u3082\u6280\u8853\u529b\uff01\uff1fFizzBuzz \u306e\u5909\u308f\u308a\u3068\u306a\u308b5\u3064\u306e\u30c6\u30b9\u30c8\u304c\u63d0\u6848\u3055\u308c\u308b"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/softantenna.com\/blog\/wp-content\/uploads\/2015\/05\/Ikb.jpg\" alt=\"Kb\" title=\"kb.jpg\" border=\"0\" width=\"545\" height=\"339\" \/><\/p>\n<p>1\u304b\u3089\u9806\u306b\u6570\u3092\u5370\u5237\u3001\u305f\u3060\u30573\u3067\u5272\u308a\u5207\u308c\u308b\u5834\u5408\u306f\"Fizz\"\u3092\u30015\u3067\u5272\u308a\u5207\u308c\u308b\u306a\u3089\u3070\"Buzz\"\u3092\u30013\u30685\u3067\u5272\u308a\u5207\u308c\u308b\u306a\u3089\u3070\"FizzBuzz\"\u3092\u51fa\u529b\u3059\u308b\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u4f5c\u6210\u3059\u308b\u300c<a href=\"http:\/\/ja.wikipedia.org\/wiki\/Fizz_Buzz\">FizzBuzz<\/a>\u300d\u554f\u984c\u3002\u30d7\u30ed\u30b0\u30e9\u30de\u30fc\u306e\u9069\u6b63\u3092\u7c21\u5358\u306b\u5224\u5225\u3059\u308b\u305f\u3081\u306e\u30c6\u30b9\u30c8\u3068\u3057\u3066\u77e5\u3089\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u3068\u3053\u308d\u304c\u6700\u8fd1\u306f\u3001FizzBuzz\u554f\u984c\u306e\u77e5\u540d\u5ea6\u304c\u4e0a\u6607\u3057\u3001\u6697\u8a18\u3057\u305f\u30b3\u30fc\u30c9\u3092\u305d\u306e\u307e\u307e\u4f7f\u3063\u3066\u554f\u984c\u3092\u89e3\u304f\u30d7\u30ed\u30b0\u30e9\u30de\u30fc\u5fd7\u671b\u8005\u3082\u73fe\u308c\u3001\u554f\u984c\u306e\u6709\u52b9\u6027\u304c\u8584\u308c\u3066\u304d\u3066\u3044\u308b\u69d8\u5b50\u3002<\/p>\n<p>\u305d\u3053\u3067\u3001\u958b\u767a\u8005\u517c\u8d77\u696d\u5bb6\u306eDavid Elbe\u6c0f\u306f\u3001FizzBuzz\u30c6\u30b9\u30c8\u306e\u4ee3\u308f\u308a\u3068\u306a\u308b<a href=\"http:\/\/david.elbe.me\/developers\/hiring\/2014\/09\/17\/fizzbuzz-alternatives.html\">5\u3064\u306e\u4ee3\u66ff\u30c6\u30b9\u30c8<\/a>\u3092\u63d0\u6848\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u305d\u306e\u554f\u984c\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3059\u3002<\/p>\n<p><!--more--><\/p>\n<h2>1.\u30a2\u30ca\u30b0\u30e9\u30e0<\/h2>\n<p><span class=\"mybold\">2\u3064\u306e\u5f15\u6570\u3092\u53d6\u308a\u3001\u5f15\u6570\u304c\u30a2\u30ca\u30b0\u30e9\u30e0(\u3069\u3061\u3089\u3082\u5168\u304f\u540c\u3058\u6587\u5b57\u3092\u542b\u3093\u3067\u3044\u308b)\u306a\u3089\u3070true\u3092\u3001\u305d\u3046\u3067\u306a\u3044\u306a\u3089\u3070false\u3092\u8fd4\u3059\u95a2\u6570\u3092\u304b\u3051\u3002<\/span><\/p>\n<p><a href=\"http:\/\/ja.wikipedia.org\/wiki\/%E3%82%A2%E3%83%8A%E3%82%B0%E3%83%A9%E3%83%A0\">\u30a2\u30ca\u30b0\u30e9\u30e0<\/a>\u3068\u306f\u3001\u5168\u304f\u540c\u3058\u6587\u5b57\u306e\u7d44\u307f\u5408\u308f\u305b\u304b\u3089\u306a\u308b\u7570\u306a\u308b\u5358\u8a9e\u306e\u3053\u3068\u3002\u30a2\u30ca\u30b0\u30e9\u30e0\u306e\u610f\u5473\u3092\u77e5\u3063\u3066\u3044\u308b\u304b\u3069\u3046\u304b\u304c\u91cd\u8981\u3067\u306f\u306a\u304f\u3001\u554f\u984c\u3092\u3069\u306e\u3088\u3046\u306a\u624b\u9806\u3067\u89e3\u304f\u306e\u304b\u304c\u91cd\u8981\u3067\u3059\u3002<\/p>\n<p>\u4f8b\u3048\u3070\u6700\u521d\u306b\u6587\u5b57\u5217\u306e\u9577\u3055\u3092\u30c1\u30a7\u30c3\u30af\u3057\u3001\u305d\u306e\u3042\u3068\u3067\u30a2\u30eb\u30d5\u30a1\u30d9\u30c3\u30c8\u3067\u30bd\u30fc\u30c8\u3059\u308b\u2026\u3001\u3042\u308b\u3044\u306f\u914d\u5217\u3092\u7528\u610f\u3057\u3066\u6bd4\u8f03\u3059\u308b\u306a\u3069\u3001\u30d7\u30ed\u30b0\u30e9\u30de\u304c\u554f\u984c\u3092\u89e3\u3051\u308b\u304b\u3001\u89e3\u3051\u308b\u3068\u3057\u305f\u3089\u3069\u308c\u304f\u3089\u3044\u30b9\u30de\u30fc\u30c8\u306b\u89e3\u3051\u308b\u304b\u3092\u77e5\u308b\u305f\u3081\u306e\u554f\u984c\u3067\u3059\u3002<\/p>\n<h2>2.\u7a0e\u91d1\u8a08\u7b97<\/h2>\n<p><span class=\"mybold\">\u91d1\u984d(\u30c9\u30eb)\u3068\u3001\u7a0e\u7387\u3092\u5f15\u6570\u306b\u3068\u308a\u3001\u7b54\u3048\u306e\u91d1\u984d\u3092\u30bb\u30f3\u30c8\u3068\u3057\u3066\u914d\u5217\u3067\u8fd4\u305b\u3002<\/span><\/p>\n<p>\u57fa\u672c\u7684\u306a\u6570\u5b66\u306e\u529b\u3092\u77e5\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u306f\u6570\u5b66\u3068\u306f\u7121\u95a2\u4fc2\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002<\/p>\n<h2>3.\u30d0\u30b0\u30d5\u30a3\u30c3\u30af\u30b9<\/h2>\n<p><span class=\"mybold\">\u4ee5\u4e0b\u306e\u30b3\u30fc\u30c9\u306b\u542b\u307e\u308c\u308b\u306e3\u3064\u306e\u30d0\u30b0\u3092\u6307\u6458\u305b\u3088\u3002<\/span><\/p>\n<pre><code class=\"ruby\">def fix_spelling(name)\n  if(name = 'twittr')\n    name = 'twitter'\n  else\n    fix_spelling(name)\n  end\n  return 'name'\nend\n<\/code><\/pre>\n<p>Ruby\u306e\u30e1\u30bd\u30c3\u30c9\u3067\u3059\u3002\u30b3\u30fc\u30c9\u306b\u6f5c\u3080\u602a\u3057\u3044\u5302\u3044\u3092\u55c5\u304e\u3064\u3051\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u304b\u3069\u3046\u304b\u3067\u3001\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u306e\u7d4c\u9a13\u3092\u78ba\u8a8d\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u7b54\u3048\u306f\u3001\"==\"\u306e\u304b\u308f\u308a\u306b\"=\"\u304c\u4f7f\u308f\u308c\u3066\u3044\u308b\u3002\u5e38\u306b'name'\u304creturn\u3055\u308c\u3066\u3044\u308b\u3001\u6f5c\u5728\u7684\u306a\u7121\u9650\u518d\u5e30\u306e\u53ef\u80fd\u6027\u3002<\/p>\n<h2>4. \u30dc\u30c3\u30af\u30b9\u30b5\u30a4\u30ba<\/h2>\n<p><span class=\"mybold\">\u5358\u4f4d\u304c\u30bb\u30f3\u30c1\u30e1\u30fc\u30c8\u30eb\u306e3\u3064\u306e\u5f15\u6570\u3092\u3068\u308a\u3001\u4f53\u7a4d\u3092\u8a08\u7b97\u3057\u30ea\u30c3\u30c8\u30eb\u3068\u3057\u3066\u8fd4\u3059\u95a2\u6570\u3092\u304b\u3051\u3002<\/span><\/p>\n<p>\u30e1\u30fc\u30c8\u30eb\u6cd5\u306b\u6163\u308c\u3066\u3044\u306a\u3044\u30a2\u30e1\u30ea\u30ab\u4eba\u306e\u77e5\u8b58\u3092\u78ba\u8a8d\u3059\u308b\u3068\u3044\u3046\u610f\u56f3\u304c\u3042\u308b\u3088\u3046\u3067\u3059\u3002\u3082\u3068\u304b\u3089\u30e1\u30fc\u30c8\u30eb\u6cd5\u306e\u65e5\u672c\u4eba\u306a\u3089\u3070\u697d\u52dd\u304b\u3082\uff1f<\/p>\n<h2>5. \u6700\u60aa\u306eFizz Buzz<\/h2>\n<p><span class=\"mybold\">\u6700\u60aa\u306e - \u3057\u304b\u3057\u52d5\u4f5c\u3059\u308b - FizzBuzz\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u304b\u3051\u3002<\/span><\/p>\n<p>\u5fd7\u9858\u8005\u3092\u30ea\u30e9\u30c3\u30af\u30b9\u3055\u305b\u548c\u307e\u305b\u308b\u305f\u3081\u306e\u554f\u984c\u3067\u3059\u3002\u30d7\u30ed\u30b0\u30e9\u30de\u306e\u5275\u9020\u6027\u3092\u77e5\u308b\u3053\u3068\u304c\u51fa\u6765\u308b\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002<\/p>\n<h2>\u7d50\u8ad6<\/h2>\n<p>David Elbe\u6c0f\u306f\u3001\u958b\u767a\u8005\u3092\u96c7\u7528\u3059\u308b\u969b\u3001\u3053\u308c\u3089\u306e\u554f\u984c\u3092\u89e3\u3051\u305f\u958b\u767a\u8005\u306b\u5bfe\u3057\u9762\u63a5\u3092\u884c\u3046\u3053\u3068\u3067\u3001\u6642\u9593\u3068\u52b4\u529b\u3092\u5927\u5e45\u306b\u7bc0\u7d04\u3057\u3066\u3044\u308b\u305d\u3046\u3067\u3059\u3002<\/p>\n<p>\u30d5\u30a3\u30eb\u30bf\u30ea\u30f3\u30b0\u306e\u305f\u3081\u306e\u554f\u984c\u306f\u3069\u3046\u3042\u308b\u3079\u304d\u304b\u3001<a href=\"https:\/\/news.ycombinator.com\/item?id=9609918\">Hacker News<\/a>\u3067\u3082\u8b70\u8ad6\u304c\u4ea4\u308f\u3055\u308c\u3066\u3044\u307e\u3059\u3002\u6c17\u306b\u306a\u308b\u65b9\u306f\u78ba\u8a8d\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>1\u304b\u3089\u9806\u306b\u6570\u3092\u5370\u5237\u3001\u305f\u3060\u30573\u3067\u5272\u308a\u5207\u308c\u308b\u5834\u5408\u306f\"Fizz\"\u3092\u30015\u3067\u5272\u308a\u5207\u308c\u308b\u306a\u3089\u3070\"Buzz\"\u3092\u30013\u30685\u3067\u5272\u308a\u5207\u308c\u308b\u306a\u3089\u3070\"FizzBuzz\"\u3092\u51fa\u529b\u3059\u308b\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u4f5c\u6210\u3059\u308b\u300cFizzBuzz\u300d\u554f\u984c\u3002\u30d7\u30ed\u30b0\u30e9\u30de\u30fc\u306e\u9069\u6b63\u3092\u7c21 [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":30375,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"swell_btn_cv_data":"","footnotes":""},"categories":[75],"tags":[659],"class_list":["post-30376","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-software","tag-fizzbuzz"],"_links":{"self":[{"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/posts\/30376","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/comments?post=30376"}],"version-history":[{"count":0,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/posts\/30376\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/media\/30375"}],"wp:attachment":[{"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/media?parent=30376"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/categories?post=30376"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/tags?post=30376"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}