{"id":302527,"date":"2022-12-01T04:58:55","date_gmt":"2022-12-01T03:58:55","guid":{"rendered":"https:\/\/blog.jetbrains.com\/?post_type=kotlin&#038;p=302527"},"modified":"2022-12-07T04:34:40","modified_gmt":"2022-12-07T03:34:40","slug":"kotlin-advent-of-code-2022","status":"publish","type":"kotlin","link":"https:\/\/blog.jetbrains.com\/zh-hans\/kotlin\/2022\/12\/kotlin-advent-of-code-2022\/","title":{"rendered":"\u53c2\u52a0\u201c\u4f7f\u7528 Kotlin \u89e3\u51b3 Advent of Code 2022\u201d\u5e76\u8d62\u53d6\u5956\u54c1\uff01"},"content":{"rendered":"<p>\u00a0<\/p>\n<p>\u8bf7\u5217\u4e00\u5f20\u6e05\u5355\u5e76\u4ed4\u7ec6\u68c0\u67e5\uff0c\u56e0\u4e3a Advent of Code \u8d5b\u5b63\u5373\u5c06\u5230\u6765\uff01<\/p>\n<p>\u00a0<\/p>\n<p>\u771f\u60f3\u5feb\u70b9\u7b49\u5230 12 \u6708 1 \u65e5\uff0c\u5c4a\u65f6 25 \u4e2a\u8282\u65e5\u4e3b\u9898\u8c1c\u9898\u4e2d\u7684\u7b2c\u4e00\u4e2a\u5c06\u5728 <a href=\"https:\/\/adventofcode.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">adventofcode.com<\/a> \u4e0a\u89e3\u9501\u3002\u00a0<\/p>\n<p>\u00a0<\/p>\n<p>JetBrains \u5c06\u8fde\u7eed\u7b2c\u4e8c\u5e74\u8d5e\u52a9 Advent of Code 2022\u3002 \u6211\u4eec\u7684\u8bb8\u591a\u540c\u4e8b\u6bcf\u5929\u90fd\u4f1a\u89e3\u51b3\u8fd9\u4e9b\u6709\u8da3\u7684\u7b97\u6cd5\u95ee\u9898\u3002 \u6211\u4eec\u8bda\u9080\u60a8\u548c\u6211\u4eec\u4e00\u8d77\u53c2\u52a0\u4eca\u5e74\u7684\u201c\u4f7f\u7528 Kotlin \u89e3\u51b3 Advent of Code\u201d\u6d3b\u52a8\uff01<\/p>\n<p>\u00a0<\/p>\n<p>\u8fd9\u662f\u7ec3\u4e60\u89e3\u51b3\u95ee\u9898\u3001\u4fdd\u6301\u9ad8\u6c34\u5e73\u7684 Kotlin \u6280\u80fd\u3001\u8fdb\u884c\u7ade\u4e89\uff0c\u5e76\u4ece\u56f4\u7ed5\u6d3b\u52a8\u7684\u51fa\u8272\u793e\u533a\u4e2d\u5b66\u4e60\u7684\u597d\u65b9\u5f0f\u3002 \u8fd9\u4e5f\u662f\u83b7\u5f97\u4e00\u4e9b\u72ec\u5bb6 Kotlin \u5956\u54c1\u7684\u7edd\u4f73\u65b9\u5f0f\uff01 &#x1f381;<\/p>\n<p>\u00a0<\/p>\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/www.youtube.com\/@Kotlin\/featured\" target=\"_blank\" rel=\"noreferrer noopener\"><img decoding=\"async\" loading=\"lazy\" class=\"wp-image-301237\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2022\/11\/DSGN-15081-Solve-Advent-of-Code-2022-in-Kotlin_Twitter-Blogpost.png\" alt=\"\u4f7f\u7528 Kotlin \u89e3\u51b3 Advent of Code\" width=\"800\" height=\"418\" \/><\/a><\/figure>\n<p>\u00a0<\/p>\n<h2><span id=\"Livestreams\" class=\"ez-toc-section\"><\/span>\u76f4\u64ad<\/h2>\n<p>\u00a0<\/p>\n<p>\u4eca\u5e74\uff0c\u6211\u4eec\u8ba1\u5212\u6bcf\u5929\u4e16\u754c\u534f\u8c03\u65f6\u95f4 17:00\uff08\u4e2d\u56fd\u6807\u51c6\u65f6\u95f4\u6b21\u65e5 01:00\uff09\u8fdb\u884c\u73b0\u573a\u76f4\u64ad\uff0c\u671f\u95f4\u6211\u4eec\u5c06\u8ba8\u8bba\u5f53\u5929\u7684\u8c1c\u9898\uff0c\u7ed9\u60a8 12 \u4e2a\u5c0f\u65f6\u7684\u65f6\u95f4\u6765\u63d0\u524d\u89e3\u7b54\u8c1c\u9898\u3002 \u6211\u4eec\u5c06\u4e00\u8d77\u6d4f\u89c8\u95ee\u9898\u9648\u8ff0\uff0c\u8ba8\u8bba\u89e3\u51b3\u4efb\u52a1\u7684\u53ef\u80fd\u65b9\u5f0f\uff0c\u5e76\u4e0e\u6765\u81ea Kotlin \u56e2\u961f\u3001Google \u548c\u793e\u533a\u7684\u4e00\u4e9b\u6709\u8da3\u7684\u5609\u5bbe\u804a\u5929\u3002 \u8bf7\u8ba2\u9605\u6211\u4eec\u7684 YouTube \u9891\u9053\u4ee5\u4fdd\u6301\u5173\u6ce8\uff01<\/p>\n<p>\u00a0<\/p>\n<p align=\"center\"><a class=\"ek-link jb-download-button\" title=\"\u8ba2\u9605 Kotlin YouTube \u9891\u9053\" href=\"https:\/\/www.youtube.com\/@Kotlin\/featured\" target=\"_blank\" rel=\"noopener\">\u8ba2\u9605 Kotlin YouTube \u9891\u9053<\/a><\/p>\n<p>\u00a0<\/p>\n<h2><span id=\"Community_participation\" class=\"ez-toc-section\"><\/span>\u793e\u533a\u53c2\u4e0e<\/h2>\n<p>\u00a0<\/p>\n<p>\u8981\u8ba8\u8bba\u60a8\u7684\u89e3\u51b3\u65b9\u6848\uff0c\u4e0e\u5176\u4ed6\u8c1c\u9898\u7231\u597d\u8005\u5206\u4eab\u6280\u5de7\u548c\u7a8d\u95e8\uff0c\u5e76\u6709\u673a\u4f1a\u5728\u6211\u4eec\u6bcf\u5929\u7684 YouTube \u76f4\u64ad\u4e2d\u4eae\u76f8\uff0c\u8bf7\u52a1\u5fc5\u52a0\u5165 <a href=\"https:\/\/slack-chats.kotlinlang.org\/c\/advent-of-code\" target=\"_blank\" rel=\"noreferrer noopener\">Kotlinlang Slack \u4e0a\u7684 <em>Advent of Code<\/em> \u9891\u9053<\/a>\u4e2d\u7684\u5bf9\u8bdd\u3002 \u6bcf\u5929\u90fd\u4f1a\u6709\u4e00\u4e2a\u65b0\u7684\u8ba8\u8bba\u4e3b\u9898\u53d1\u5e03\uff0c\u60a8\u53ef\u4ee5\u5728\u5176\u4e2d\u5206\u4eab\u60a8\u81ea\u5df1\u7684\u8c1c\u9898\u89e3\u51b3\u65b9\u6848\uff0c\u5e76\u4e0e\u793e\u533a\u4e92\u52a8\uff01<\/p>\n<p>\u00a0<\/p>\n<h2><span id=\"How_to_solve_Advent_of_Code_in_Kotlin\" class=\"ez-toc-section\"><\/span>\u5982\u4f55\u4f7f\u7528 Kotlin \u89e3\u51b3 Advent of Code<\/h2>\n<p>\u00a0<\/p>\n<p>\u4f5c\u4e3a\u70ed\u8eab\uff0c\u6211\u4eec\u6536\u96c6\u4e86\u4e00\u4e9b\u6709\u7528\u7684 Advent of Code \u8d44\u6e90\uff1a<\/p>\n<p>\u00a0<\/p>\n<ul>\n<li><a href=\"https:\/\/kotlinlang.org\/docs\/advent-of-code.html\" target=\"_blank\" rel=\"noreferrer noopener\">\u4f7f\u7528 Kotlin \u89e3\u51b3 Advent of Code \u8c1c\u9898<\/a>\u3002 \u5728\u8fd9\u4e9b\u89c6\u9891\u548c\u535a\u5ba2\u6587\u7ae0\u4e2d\uff0c\u6211\u4eec\u5c55\u793a\u4e86\u5982\u4f55\u4f7f\u7528\u60ef\u7528 Kotlin \u89e3\u51b3\u8282\u65e5\u4e3b\u9898\u8c1c\u9898\u3002\u00a0<\/li>\n<li><a href=\"https:\/\/www.youtube.com\/playlist?list=PLlFc5cFwUnmy2hYx6k3TjjFLd7QXH2CjF\" target=\"_blank\" rel=\"noreferrer noopener\">\u201c\u4f7f\u7528 Kotlin \u89e3\u51b3 Advent of Code 2021\u201d<\/a>\u89c6\u9891\u3002 \u53bb\u5e74\uff0c\u6211\u4eec\u51c6\u5907\u4e86\u51e0\u4e2a\u89c6\u9891\uff0c\u5411\u60a8\u5c55\u793a\u5982\u4f55\u5f00\u59cb\uff0c\u4ee5\u53ca\u5982\u4f55\u7740\u624b\u89e3\u51b3\u8c1c\u9898\u3002\u00a0<\/li>\n<li><a href=\"https:\/\/github.com\/kotlin-hands-on\/advent-of-code-kotlin-template\" target=\"_blank\" rel=\"noreferrer noopener\">\u201c\u4f7f\u7528 Kotlin \u89e3\u51b3 Advent of Code\u201dGitHub \u6a21\u677f<\/a>\u3002 \u8fd9\u662f\u4e00\u4e2a\u5b9e\u7528\u7684\u73b0\u6210\u6a21\u677f\uff0c\u53ef\u4ee5\u5e2e\u52a9\u60a8\u6784\u5efa\u89e3\u51b3\u65b9\u6848\u7684\u7ed3\u6784\u3002<\/li>\n<\/ul>\n<h2>\u00a0<\/h2>\n<h2><span id=\"Leaderboard\" class=\"ez-toc-section\"><\/span>\u6392\u884c\u699c<\/h2>\n<p>\u00a0<\/p>\n<p>\u6211\u4eec\u9080\u8bf7\u60a8\u52a0\u5165\u7279\u522b\u7684 Kotlin \u6392\u884c\u699c\uff01 \u8981\u62a5\u540d\u53c2\u52a0\u6392\u884c\u699c\uff0c\u8bf7\u8f6c\u5230\u60a8\u7684\u4e2a\u4eba\u8d44\u6599\u7684<a href=\"https:\/\/adventofcode.com\/2022\/leaderboard\/private\" target=\"_blank\" rel=\"noreferrer noopener\">\u6392\u884c\u699c\u90e8\u5206<\/a>\uff0c\u7136\u540e\u4f7f\u7528\u4ee5\u4e0b\u4ee3\u7801\u4e2d\u7684\u4e00\u4e2a\uff1a<\/p>\n<p>\u6392\u884c\u699c 1: <code>236080-b0695394<\/code><br \/>\u6392\u884c\u699c 2: <code>2343137-1def15d6<\/code><br \/>\u6392\u884c\u699c 3: <code>2076885-8e47e445<\/code><br \/>\u6392\u884c\u699c 4:<code>\u00a02553918-9ee8ee21<\/code><br \/>\u6392\u884c\u699c 5: <code>2649199-9168a817<\/code><br \/>\u6392\u884c\u699c 6: <code>2716400-8dd8cad2<\/code><\/p>\n<p>\u8bf7\u53ea\u52a0\u5165\u4e00\u4e2a\u6392\u884c\u699c\uff0c\u8c22\u8c22\u3002<\/p>\n<p>\u00a0<\/p>\n<h2><span id=\"GitHub_template\" class=\"ez-toc-section\"><\/span>GitHub \u6a21\u677f<\/h2>\n<p>\u00a0<\/p>\n<p>\u6211\u4eec\u51c6\u5907\u4e86\u4e00\u4e2a <a href=\"https:\/\/github.com\/kotlin-hands-on\/advent-of-code-kotlin-template\" target=\"_blank\" rel=\"noreferrer noopener\">GitHub \u4ed3\u5e93\u6a21\u677f<\/a>\uff0c\u4f9b\u60a8\u5728 Kotlin \u4e2d\u4f7f\u7528\u3002 \u5b83\u5c06\u4e3a\u60a8\u63d0\u4f9b\u4e00\u4e9b\u7ed3\u6784\uff0c\u5e76\u5e2e\u52a9\u60a8\u5feb\u901f\u8bbe\u7f6e\uff0c\u4ee5\u4fbf\u60a8\u53ef\u4ee5\u5f00\u59cb\u7f16\u5199 AoC \u89e3\u51b3\u65b9\u6848\u3002<\/p>\n<p>\u00a0<\/p>\n<p>\u8bf7\u70b9\u51fb\u4e0b\u9762\u7684\u94fe\u63a5\uff0c\u767b\u5f55\u60a8\u7684 GitHub \u5e10\u6237\uff0c\u57fa\u4e8e\u6b64\u6a21\u677f\u521b\u5efa\u4e00\u4e2a\u65b0\u9879\u76ee\uff0c\u7136\u540e\u70b9\u51fb\u540d\u4e3a\u201c\u4f7f\u7528\u6b64\u6a21\u677f\uff08Use this template\uff09\u201d\u7684\u7eff\u8272\u6309\u94ae\u3002 \u8bb0\u4f4f\uff0c\u4e0d\u8981\u590d\u523b\uff08fork\uff09\u6b64\u6a21\u677f\uff01<\/p>\n<p>\u00a0<\/p>\n<p align=\"center\"><a class=\"ek-link jb-download-button\" title=\"\u4f7f\u7528\u6a21\u677f\" href=\"https:\/\/github.com\/kotlin-hands-on\/advent-of-code-kotlin-template\" target=\"_blank\" rel=\"noopener\">\u4f7f\u7528\u6a21\u677f<\/a><\/p>\n<p>\u00a0<\/p>\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" loading=\"lazy\" class=\"wp-image-301283\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2022\/11\/image-29-1.png\" alt=\"\u7528\u4e8e Advent of Code \u7684 Kotlin GitHub \u6a21\u677f\" width=\"2430\" height=\"1652\" \/><\/figure>\n<p>\u00a0<\/p>\n<h2><span id=\"Prizes\" class=\"ez-toc-section\"><\/span>\u5956\u54c1<\/h2>\n<p>\u00a0<\/p>\n<p>\u6211\u4eec\u6ca1\u6709\u5fd8\u8bb0\u5bf9\u90a3\u4e9b\u9009\u62e9\u4f7f\u7528 Kotlin \u89e3\u51b3\u8c1c\u9898\u7684\u4eba\u7684\u6fc0\u52b1\u63aa\u65bd\uff01 \u6211\u4eec\u6709\u81ea\u5df1\u7684\u6392\u884c\u699c\uff0c\u6211\u4eec\u5c06\u4ece\u5411 GitHub \u63d0\u4ea4\u89e3\u51b3\u65b9\u6848\u7684\u4eba\u4e2d\u968f\u673a\u9009\u51fa\u82e5\u5e72\u540d\u83b7\u80dc\u8005\u3002 \u5f53\u7136\uff0c\u5f97\u5206\u6700\u9ad8\u7684\u53c2\u4e0e\u8005\u4e5f\u5c06\u83b7\u5f97\u5956\u54c1\u3002\u00a0<\/p>\n<p>\u00a0<\/p>\n<p>\u8981\u53d6\u5f97\u83b7\u5956\u8d44\u683c\uff0c\u8bf7\u786e\u4fdd\u60a8\u7b26\u5408\u4ee5\u4e0b\u6807\u51c6\uff1a<\/p>\n<p>\u00a0<\/p>\n<ul>\n<li>\u5c1d\u8bd5\u4f7f\u7528 Kotlin \u89e3\u51b3\u81f3\u5c11\u4e09\u5929\u7684 AoC 2022 \u8c1c\u9898\u3002<\/li>\n<li>\u5728 GitHub \u4e0a\u516c\u5f00\u5206\u4eab\u60a8\u7684\u89e3\u51b3\u65b9\u6848\u3002<\/li>\n<li>\u5c06 <code>aoc-2022-in-kotlin<\/code> \u4e3b\u9898\u6dfb\u52a0\u5230\u60a8\u7684\u4ed3\u5e93\uff08\u89c1\u4e0b\u6587\uff09\u3002<\/li>\n<li>\u5728\u60a8\u7684 GitHub \u4e2a\u4eba\u8d44\u6599\u4e2d\u63d0\u4f9b\u60a8\u7684\u8054\u7cfb\u65b9\u5f0f\uff08\u7535\u5b50\u90ae\u4ef6\u5730\u5740\u548c Twitter \u53e5\u67c4\uff09\u3002<\/li>\n<\/ul>\n<p>\u8981\u5c06 <code>aoc-2022-in-kotlin<\/code> \u4e3b\u9898\u6dfb\u52a0\u5230\u4ed3\u5e93\u4e2d\uff0c\u8bf7\u70b9\u51fb\u4ed3\u5e93\u9875\u9762\u53f3\u4e0a\u89d2\u7684\u9f7f\u8f6e\u56fe\u6807\u6765\u7f16\u8f91\u4ed3\u5e93\u8be6\u7ec6\u4fe1\u606f\u3002 \u7136\u540e\uff0c\u5728 Topics \u5b57\u6bb5\u4e2d\uff0c\u6dfb\u52a0\u4ee5\u4e0b\u503c\uff1a<\/p>\n<p>\u00a0<\/p>\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" loading=\"lazy\" class=\"wp-image-301294\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2022\/11\/image-30-1.png\" alt=\"\u4f7f\u7528 Kotlin \u89e3\u51b3 AoC\uff0c\u5411\u4ed3\u5e93\u6dfb\u52a0\u4e3b\u9898\" width=\"1652\" height=\"1298\" \/><\/figure>\n<p>\u00a0<\/p>\n<p>\u6211\u4eec\u5f53\u7136\u6b23\u8d4f\u6bcf\u4e2a\u6709\u7ade\u4e89\u7cbe\u795e\u7684\u4eba\uff0c\u4f46\u6211\u4eec\u4e0d\u60f3\u50ac\u4fc3\u60a8\u3002 \u60a8\u4e0d\u4e00\u5b9a\u8981\u6210\u4e3a\u6700\u5feb\u7684\uff0c\u4e5f\u4e0d\u4e00\u5b9a\u8981\u5b8c\u6210\u6bcf\u4e00\u9879\u6311\u6218\u624d\u80fd\u8d62\u5f97\u5956\u54c1\u3002 \u6211\u4eec\u5e0c\u671b\u786e\u4fdd\u60a8\u4f53\u9a8c\u5230\u4f7f\u7528\u60ef\u7528 Kotlin \u89e3\u51b3\u5047\u65e5\u8c1c\u9898\u7684\u7f8e\u5999\u4e4b\u5904\u3002<\/p>\n<p>\u00a0<\/p>\n<p>\u4f7f\u7528 Kotlin \u89e3\u51b3 Advent of Code 2022\uff0c\u5b66\u4e60\u65b0\u4e1c\u897f\uff0c\u5e76\u4ece\u4e2d\u83b7\u5f97\u4e50\u8da3\uff01<\/p>\n<p>\u00a0<\/p>\n<p>\u672c\u535a\u6587\u82f1\u6587\u539f\u4f5c\u8005\uff1a<\/p>\n\n    <div class=\"about-author \">\n        <div class=\"about-author__box\">\n            <div class=\"row\">\n                <div class=\"about-author__box-img\">\n                    <img decoding=\"async\" src=\"https:\/\/secure.gravatar.com\/avatar\/?s=200&#038;r=g\" width=\"200\" height=\"200\" alt=\"\" loading=\"lazy\"  class=\"avatar avatar-200 wp-user-avatar wp-user-avatar-200 photo avatar-default\">\n                <\/div>\n                <div class=\"about-author__box-text\">\n                                                        <\/div>\n            <\/div>\n        <\/div>\n    <\/div>\n","protected":false},"author":1297,"featured_media":301237,"comment_status":"closed","ping_status":"closed","template":"","categories":[89],"tags":[6828,65],"cross-post-tag":[],"acf":[],"_links":{"self":[{"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/kotlin\/302527"}],"collection":[{"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/kotlin"}],"about":[{"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/types\/kotlin"}],"author":[{"embeddable":true,"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/users\/1297"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/comments?post=302527"}],"version-history":[{"count":5,"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/kotlin\/302527\/revisions"}],"predecessor-version":[{"id":305061,"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/kotlin\/302527\/revisions\/305061"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/media\/301237"}],"wp:attachment":[{"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/media?parent=302527"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/categories?post=302527"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/tags?post=302527"},{"taxonomy":"cross-post-tag","embeddable":true,"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/cross-post-tag?post=302527"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}