{"id":23740,"date":"2014-10-03T23:38:04","date_gmt":"2014-10-03T14:38:04","guid":{"rendered":"http:\/\/www.softantenna.com\/wp\/?p=23740"},"modified":"2014-10-03T23:42:02","modified_gmt":"2014-10-03T14:42:02","slug":"codin-game","status":"publish","type":"post","link":"https:\/\/softantenna.com\/blog\/codin-game\/","title":{"rendered":"\u30b2\u30fc\u30e0\u3092\u3057\u306a\u304c\u3089\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u30b9\u30ad\u30eb\u3092\u5411\u4e0a\u3055\u305b\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u5922\u306e\u3088\u3046\u306a\u30b5\u30a4\u30c8\u300cCodinGame\u300d"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/softantenna.com\/blog\/wp-content\/uploads\/2014\/10\/blogGames-for-Programmers.jpg\" alt=\"Games for Programmers\" title=\"Games for Programmers.jpg\" border=\"0\" width=\"546\" height=\"332\" \/><\/p>\n<p>\u300c<a href=\"http:\/\/www.codingame.com\/\">CodinGame : Gamese for Programmers<\/a>\u300d\u306f\u30b2\u30fc\u30e0\u3092\u3057\u306a\u304c\u3089\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u30b9\u30ad\u30eb\u3092\u9ad8\u3081\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u5922\u306e\u3088\u3046\u306a\u30b5\u30a4\u30c8\u3067\u3059\u3002<\/p>\n<p>\u6700\u8fd1\u3053\u306e\u624b\u306e\u30b5\u30a4\u30c8\u3092\u7d50\u69cb\u898b\u304b\u3051\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u304c\u3001CodinGame\u306f\u30a8\u30c7\u30a3\u30bf\u304cVim\/Emacs\u30d0\u30a4\u30f3\u30c9\u306b\u5bfe\u5fdc\u3057\u3066\u3044\u305f\u308a\u3001\u591a\u6570\u306e\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u8a00\u8a9e\u304c\u4f7f\u3048\u305f\u308a(Ruby\/JavaScrip\/Java\/C++\u306a\u3069\u591a\u5f69)\u30d7\u30ed\u30b0\u30e9\u30de\u30fc\u5fc3\u3092\u304f\u3059\u3050\u308b\u4f5c\u308a\u306b\u306a\u3063\u3066\u3044\u308b\u306e\u304c\u7279\u5fb4\u3067\u3059\u3002<\/p>\n<p>\u51fa\u984c\u3055\u308c\u308b\u30b2\u30fc\u30e0\u3082\u30d1\u30ba\u30eb\u7684\u3067\u3084\u308a\u3054\u305f\u3048\u304c\u3042\u308a\u3001\u30b0\u30e9\u30d5\u30a3\u30c3\u30af\u30b9\u3082\u672c\u683c\u7684\u3067\u3059\u3002\u305f\u3060\u3061\u3087\u3063\u3068\u89e3\u304d\u65b9\u306b\u7656\u304c\u3042\u308b\u306e\u3067\u6163\u308c\u306a\u3044\u3068\u6700\u521d\u3044\u304d\u306a\u308a\u8a70\u307e\u3063\u3066\u3057\u307e\u3046\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002<\/p>\n<p>\u59cb\u3081\u306e\u307b\u3046\u306e\u30b2\u30fc\u30e0\u3092\u5c11\u3057\u3084\u3063\u3066\u307f\u305f\u306e\u3067\u7d39\u4ecb\u3057\u3066\u307f\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<!--more--><\/p>\n<h3>Onboarding\u3092\u89e3\u304f\uff01<\/h3>\n<p>\u6700\u521d\u306e\u30b2\u30fc\u30e0\u300cOnboarding\u300d\u306e\u76ee\u7684\u306f\u81ea\u5206\u306e\u30ad\u30e3\u30ce\u30f3\u304c\u6575\u306b\u4f53\u5f53\u305f\u308a\u3055\u308c\u306a\u3044\u3088\u3046\u306b\u9632\u885b\u3059\u308b\u3053\u3068\u3067\u3059\u3002\u30bf\u30fc\u30f3\u30d9\u30fc\u30b9\u3067\u6575\u304c\u305b\u307e\u3063\u3066\u304f\u308b\u306e\u3067\u3001\u3046\u307e\u304f\u6483\u3061\u843d\u3068\u305b\u308b\u3088\u3046\u306b\u30b3\u30fc\u30c9\u3092\u6539\u826f\u3057\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<h4>\u30b2\u30fc\u30e0\u753b\u9762<\/h4>\n<p><img decoding=\"async\" src=\"https:\/\/softantenna.com\/blog\/wp-content\/uploads\/2014\/10\/blogonboarding.jpg\" alt=\"Onboarding\" title=\"onboarding.jpg\" border=\"0\" width=\"546\" height=\"362\" \/><\/p>\n<p>\u30b2\u30fc\u30e0\u753b\u9762\u306f4\u3064\u306e\u30d1\u30fc\u30c8\u306b\u5206\u304b\u308c\u3066\u3044\u3066\u3001\u5de6\u5074\u304c\u5b9f\u884c\u4e2d\u306e\u30b2\u30fc\u30e0\u753b\u9762\u3068\u30b3\u30f3\u30bd\u30fc\u30eb\u51fa\u529b\u3001\u53f3\u5074\u304c\u30a8\u30c7\u30a3\u30bf\u3068\u30c6\u30b9\u30c8\u30b1\u30fc\u30b9(\u554f\u984c)\u3068\u306a\u3063\u3066\u3044\u307e\u3059\u3002\u30c6\u30b9\u30c8\u30b1\u30fc\u30b9\u306fOnboarding\u306e\u5834\u5408\u300101\u301c04\u307e\u3067\u3042\u308a\u6570\u5b57\u304c\u5897\u3048\u308b\u307b\u3069\u96e3\u3057\u304f\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/softantenna.com\/blog\/wp-content\/uploads\/2014\/10\/blog01-1.jpg\" alt=\"01 1\" title=\"01-1.jpg\" border=\"0\" width=\"546\" height=\"362\" \/><\/p>\n<p>\u7fd2\u3046\u3088\u308a\u6163\u308c\u3088\u3068\u3044\u3046\u3053\u3068\u3067\u3001\u521d\u671f\u72b6\u614b\u306e\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u306e\u307e\u307e\u30c6\u30b9\u30c8\u30b1\u30fc\u30b9\u300cFive enemies\u300d\u5b9f\u884c\u3057\u3066\u307f\u308b\u3068\u2026\u6700\u5f8c\u306e\u6575\u306b\u3076\u3064\u304b\u3063\u3066\u5931\u6557\u3057\u3066\u3057\u307e\u3044\u307e\u3057\u305f\u3002\u3084\u306f\u308a\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u3092\u6539\u826f\u3059\u308b\u3057\u304b\u306a\u3044\u3088\u3046\u3067\u3059\u3002<\/p>\n<h4>\u30b2\u30fc\u30e0\u306e\u30eb\u30fc\u30eb<\/h4>\n<p>\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u3092\u59cb\u3081\u308b\u524d\u306b\u30eb\u30fc\u30eb\u306e\u628a\u63e1\u3092\u3002\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u306e\u4e0a\u306e\u65b9\u306b\u82f1\u8a9e\u3067\u30b2\u30fc\u30e0\u306e\u30eb\u30fc\u30eb\u304c\u66f8\u304b\u308c\u3066\u3044\u305f\u306e\u3067\u3001\u8a33\u3057\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n<ul>\n<li>1\u30bf\u30fc\u30f3\u3054\u3068\u306b\u6a19\u6e96\u5165\u529b\u304b\u3089\u60c5\u5831\u304c\u5165\u624b\u3067\u304d\u308b: \u30c8\u30fc\u30bf\u30eb\u306e\u6575\u306e\u6570\u3001\u6575\u306e\u540d\u524d\u3068\u81ea\u5206\u304b\u3089\u306e\u8ddd\u96e2\u3092\u5f97\u308b\u3053\u3068\u304c\u3067\u304d\u308b<\/li>\n<li>\u6a19\u6e96\u51fa\u529b\u306b\u6575\u306e\u540d\u524d\u304c\u66f8\u304b\u308c\u308b\u307e\u3067\u30b7\u30b9\u30c6\u30e0\u306f\u30a6\u30a8\u30a4\u30c8\u3059\u308b\u3002<\/li>\n<li>\u6307\u793a\u3092\u51fa\u3059\u3068\u3001\u30ad\u30e3\u30ce\u30f3\u306e\u767a\u5c04\u3001\u6575\u306e\u79fb\u52d5\u304c\u5b9f\u65bd\u3055\u308c\u3001\u6700\u521d\u306b\u623b\u308b<\/li>\n<\/ul>\n<p>\u306a\u3093\u3068\u306a\u304f\u308f\u304b\u3063\u305f\u3088\u3046\u306a\u3001\u308f\u304b\u3089\u306a\u3044\u3088\u3046\u306a\u611f\u3058\u3067\u3059\u304c\u3001\u8981\u3059\u308b\u306b\u300c\u6a19\u6e96\u5165\u529b\u304b\u3089\u6575\u306e\u60c5\u5831\u3092\u8aad\u307f\u53d6\u3063\u3066\u3001\u6a19\u6e96\u51fa\u529b\u306b\u6575\u306e\u540d\u524d\u3092\u51fa\u529b\u3059\u308c\u3070\u6483\u3061\u843d\u3068\u3059\u3053\u3068\u304c\u3067\u304d\u308b\u300d\u3068\u3044\u3046\u30eb\u30fc\u30eb\u306e\u3088\u3046\u3067\u3059\u3002<\/p>\n<h4>\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u306e\u6539\u826f<\/h4>\n<p>\u3053\u308c\u3092\u8e0f\u307e\u3048\u305f\u4e0a\u3067\u3001\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u3092\u898b\u3066\u307f\u307e\u3059\u3002\u521d\u671f\u72b6\u614b\u306e\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u3092\u6574\u7406\u3057\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n<pre><code class=\"ruby\">STDOUT.sync = true # \u524a\u9664\u3057\u306a\u3044\u3088\u3046\u306b\n# \u30b2\u30fc\u30e0\u30eb\u30fc\u30d7\nloop do\n    $count = gets.to_i # \u6575\u306e\u8239\u306e\u6570\u3092\u53d6\u5f97\n    $count.times do\n        # enemy: \u6575\u306e\u8239\u306e\u540d\u524d\n        # dist: \u30ad\u30e3\u30ce\u30f3\u3068\u8239\u306e\u9593\u306e\u8ddd\u96e2\n        $enemy, $dist = gets.split(\" \")\n        $dist = $dist.to_i\n    end    \n    puts \"HotDroid\" # \u6575\nend\n<\/code><\/pre>\n<p>\u30b2\u30fc\u30e0\u30eb\u30fc\u30d7\u306e\u4e2d\u3067\u3001\u5168\u3066\u306e\u6575\u306e\u60c5\u5831\u3092\u30eb\u30fc\u30d7\u3067\u6301\u3063\u3066\u304d\u3066\u3001\u6700\u5f8c\u306b\u300cputs \"HotDroid\"\u300d\u306b\u3088\u308aHotDroid\u3068\u3044\u3046\u540d\u524d\u306e\u6575\u3092\u6483\u3061\u843d\u3068\u3057\u3066\u3044\u308b\u3053\u3068\u304c\u308f\u304b\u308a\u307e\u3059\u3002\u3053\u308c\u3060\u3068\u3001\u6575\u306e\u540d\u524d\u304c\u56fa\u5b9a\u3055\u308c\u3066\u3044\u308b\u306e\u3067\u3001\u4ed6\u306e\u540d\u524d\u306e\u6575\u304c\u653b\u3081\u3066\u304d\u305f\u3068\u304d\u306b\u5bfe\u5fdc\u3067\u304d\u306a\u3055\u305d\u3046\u3067\u3059\u306d\u3002<\/p>\n<p>\u5b9f\u306f\u3001\u30c6\u30b9\u30c8\u30b1\u30fc\u30b9\u300cFive enemies\u300d\u3067\u306f\u3001\u653b\u3081\u3066\u304f\u308b\u6700\u521d\u306e4\u4f53\u306e\u6575\u306e\u540d\u524d\u306fHotDroid\u306b\u306a\u3063\u3066\u3044\u3066\u305d\u306e\u307e\u307e\u306e\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u3067\u6483\u3061\u843d\u3068\u305b\u308b\u306e\u3067\u3059\u304c\u3001\u6700\u5f8c\u306e\u6575\u3060\u3051\u540d\u524d\u304c\u7570\u306a\u3063\u3066\u3044\u3066\u6483\u589c\u306b\u5931\u6557\u3057\u3066\u3044\u305f\u306e\u3067\u3059\u3002<\/p>\n<p>\u305d\u3053\u3067\u300cputs \"HotDroid\"\u300d\u306e\u884c\u3092\u6b21\u306e\u3088\u3046\u306b\u5909\u66f4\u3059\u308b\u3068\u3001\u5909\u6570$enemy\u306b\u683c\u7d0d\u3055\u308c\u305f\u6575\u306e\u540d\u524d\u3092\u72d9\u3063\u3066\u30ad\u30e3\u30ce\u30f3\u3092\u767a\u5c04\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u3001\u3044\u308d\u3044\u308d\u306a\u540d\u524d\u306e\u6575\u306b\u5bfe\u5fdc\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre><code class=\"ruby\">puts $enemy # \u6575\n<\/code><\/pre>\n<p>\u3082\u3046\u4e00\u5ea6\u300cFive enemies\u300d\u3092\u5b9f\u884c\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/softantenna.com\/blog\/wp-content\/uploads\/2014\/10\/blogwin.jpg\" alt=\"Win\" title=\"win.jpg\" border=\"0\" width=\"546\" height=\"361\" \/><\/p>\n<p>\u300cYou Win!\u300d\u898b\u4e8b\u6210\u529f\u3067\u3059\uff01\uff01<\/p>\n<h4>\u307e\u3060\u307e\u3060\u7d9a\u304f<\/h4>\n<p><img decoding=\"async\" src=\"https:\/\/softantenna.com\/blog\/wp-content\/uploads\/2014\/10\/blog02.jpg\" alt=\"02\" title=\"02.jpg\" border=\"0\" width=\"546\" height=\"362\" \/><\/p>\n<p>\u6b21\u306e\u30c6\u30b9\u30c8\u30b1\u30fc\u30b9\u300cImminent danger\u300d\u306f\u6539\u826f\u7248\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u3067\u3082\u5931\u6557\u3057\u307e\u3059\u3002\u7406\u7531\u306f\u9ad8\u901f\u3067\u79fb\u52d5\u3059\u308b\u6575\u304c\u542b\u307e\u308c\u3066\u3044\u3066\u3001\u3084\u307f\u304f\u3082\u306b\u898b\u3064\u304b\u3063\u305f\u6575\u3092\u9078\u3093\u3067\u6483\u589c\u3057\u3066\u3044\u308b\u3060\u3051\u3067\u306f\u653b\u6483\u304c\u9593\u306b\u5408\u308f\u306a\u3044\u304b\u3089\u3067\u3059\u3002<\/p>\n<p>\u3053\u308c\u3092\u907f\u3051\u308b\u305f\u3081\u306b\u306f\u3001\u6575\u3068\u306e\u8ddd\u96e2$dist\u3092\u3046\u307e\u304f\u4f7f\u3063\u3066\u3001\u4e00\u756a\u63a5\u8fd1\u3057\u305f\u6575\u304b\u3089\u6483\u3061\u843d\u305b\u3070\u3088\u3055\u305d\u3046\u3067\u3059\u304c\u3001\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u306b\u3069\u3046\u53cd\u6620\u3059\u308c\u3070\u3088\u3044\u306e\u304b\u2026\u3002\u3068\u3044\u3046\u3053\u3068\u3067\u3053\u3053\u304b\u3089\u306e\u6539\u826f\u306f\u304a\u307e\u304b\u305b\u3057\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<h3>\u307e\u3068\u3081<\/h3>\n<p>\u6a19\u6e96\u5165\u529b\u3068\u6a19\u6e96\u51fa\u529b\u3092\u4f7f\u3063\u3066\u30b2\u30fc\u30e0\u3092\u89e3\u304f\u3068\u3044\u3046\u6982\u5ff5\u304c\u304a\u3082\u3057\u308d\u3044\u3067\u3059\u3002Onboarding\u3067\u306f\u6575\u306e\u540d\u524d\u3068\u8ddd\u96e2\u3092\u6a19\u6e96\u5165\u529b\u304b\u3089\u8aad\u307f\u53d6\u308a\u3001\u6a19\u6e96\u51fa\u529b\u306b\u540d\u524d\u3092\u66f8\u304d\u51fa\u3059\u30b7\u30b9\u30c6\u30e0\u3067\u3057\u305f\u304c\u3001<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/softantenna.com\/blog\/wp-content\/uploads\/2014\/10\/blogskynet.jpg\" alt=\"Skynet\" title=\"skynet.jpg\" border=\"0\" width=\"546\" height=\"325\" \/><\/p>\n<p>\u6b21\u306e\u30b2\u30fc\u30e0Skynet\u3067\u306f\u3001\u9053\u8def\u306e\u9577\u3055\u3092\u6a19\u6e96\u5165\u529b\u304b\u3089\u8aad\u307f\u53d6\u308a\u3001\u30d0\u30a4\u30af\u306e\u64cd\u4f5c\u3092\u6a19\u6e96\u51fa\u529b\u306b\u66f8\u304d\u51fa\u3059\u3068\u3044\u3046\u30b7\u30b9\u30c6\u30e0\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002\u30b7\u30f3\u30b0\u30eb\u30d7\u30ec\u30a4\u30b2\u30fc\u30e0\u3060\u3051\u3067\u306f\u306a\u304f\u3001\u30de\u30eb\u30c1\u30d7\u30ec\u30a4\u30b2\u30fc\u30e0\u3084\u3001\u30b3\u30f3\u30c6\u30b9\u30c8\u3082\u3042\u308a\u3001\u304b\u306a\u308a\u5965\u304c\u6df1\u305d\u3046\u3067\u3059\u3002<\/p>\n<p>\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u306b\u8208\u5473\u304c\u6709\u308b\u65b9\u306f\u30c1\u30e3\u30ec\u30f3\u30b8\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u300cCodinGame : Gamese for Programmers\u300d\u306f\u30b2\u30fc\u30e0\u3092\u3057\u306a\u304c\u3089\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u30b9\u30ad\u30eb\u3092\u9ad8\u3081\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u5922\u306e\u3088\u3046\u306a\u30b5\u30a4\u30c8\u3067\u3059\u3002 \u6700\u8fd1\u3053\u306e\u624b\u306e\u30b5\u30a4\u30c8\u3092\u7d50\u69cb\u898b\u304b\u3051\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u304c\u3001CodinGa [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":23733,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"swell_btn_cv_data":"","footnotes":""},"categories":[66,75],"tags":[2705,223],"class_list":["post-23740","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-webservice","category-software","tag-coding","tag-game"],"_links":{"self":[{"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/posts\/23740","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=23740"}],"version-history":[{"count":0,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/posts\/23740\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/media\/23733"}],"wp:attachment":[{"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/media?parent=23740"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/categories?post=23740"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/tags?post=23740"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}