{"id":8566,"date":"2023-10-11T03:46:50","date_gmt":"2023-10-10T19:46:50","guid":{"rendered":"https:\/\/1989lifejourney.com\/?p=8566"},"modified":"2023-11-09T16:43:47","modified_gmt":"2023-11-09T08:43:47","slug":"chagpt%e6%b8%ac%e8%a9%a6_28ai%e5%af%ab%e8%a9%a9%ef%bc%89","status":"publish","type":"post","link":"https:\/\/1989lifejourney.com\/?p=8566","title":{"rendered":"ChaGPT\u6e2c\u8a66_28(AI\u5beb\u8a69\uff09"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"647\" data-attachment-id=\"8567\" data-permalink=\"https:\/\/1989lifejourney.com\/?attachment_id=8567\" data-orig-file=\"https:\/\/i0.wp.com\/1989lifejourney.com\/wp-content\/uploads\/2023\/10\/img_2337-1.jpg?fit=1170%2C739&amp;ssl=1\" data-orig-size=\"1170,739\" data-comments-opened=\"0\" data-image-meta=\"{&quot;created_timestamp&quot;:&quot;1696995945&quot;,&quot;orientation&quot;:&quot;1&quot;}\" data-image-title=\"img_2337-1\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/1989lifejourney.com\/wp-content\/uploads\/2023\/10\/img_2337-1.jpg?fit=1024%2C647&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/1989lifejourney.com\/wp-content\/uploads\/2023\/10\/img_2337-1.jpg?resize=1024%2C647&#038;ssl=1\" alt=\"\" class=\"wp-image-8567\" srcset=\"https:\/\/i0.wp.com\/1989lifejourney.com\/wp-content\/uploads\/2023\/10\/img_2337-1.jpg?resize=1024%2C647&amp;ssl=1 1024w, https:\/\/i0.wp.com\/1989lifejourney.com\/wp-content\/uploads\/2023\/10\/img_2337-1.jpg?resize=300%2C189&amp;ssl=1 300w, https:\/\/i0.wp.com\/1989lifejourney.com\/wp-content\/uploads\/2023\/10\/img_2337-1.jpg?resize=768%2C485&amp;ssl=1 768w, https:\/\/i0.wp.com\/1989lifejourney.com\/wp-content\/uploads\/2023\/10\/img_2337-1.jpg?w=1170&amp;ssl=1 1170w\" sizes=\"auto, (max-width: 1000px) 100vw, 1000px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n<p>\/\/ \u9810\u8a2d\u7684\u5b57\u8a5e\u5eab<br \/>\nconst subjects = [&#8220;\u591c\u6df1&#8221;, &#8220;\u96f2\u98c4&#8221;, &#8220;\u82b1\u958b&#8221;, &#8220;\u6708\u4eae&#8221;];<br \/>\nconst verbs = [&#8220;\u7167&#8221;, &#8220;\u98db&#8221;, &#8220;\u843d&#8221;, &#8220;\u975c&#8221;];<br \/>\nconst objects = [&#8220;\u6c5f\u6c34&#8221;, &#8220;\u9577\u7a7a&#8221;, &#8220;\u9ad8\u6a13&#8221;, &#8220;\u77f3\u8def&#8221;];<br \/>\nconst ends = [&#8220;\u6d41\u9577&#8221;, &#8220;\u7121\u908a&#8221;, &#8220;\u4e0d\u505c&#8221;, &#8220;\u5bc2\u975c&#8221;];<\/p>\n<p>\/\/ \u96a8\u6a5f\u9078\u53d6\u5b57\u8a5e\u7684\u51fd\u6578<br \/>\nfunction getRandomElement(arr) {<br \/>\n  return arr[Math.floor(Math.random() * arr.length)];<br \/>\n}<\/p>\n<p>\/\/ \u751f\u6210\u4e03\u8a00\u7d55\u53e5\u7684\u51fd\u6578<br \/>\nfunction generatePoem() {<br \/>\n  return [<br \/>\n    getRandomElement(subjects) + getRandomElement(verbs) + getRandomElement(objects) + &#8220;\uff0c&#8221;,<br \/>\n    getRandomElement(subjects) + getRandomElement(verbs) + getRandomElement(objects) + &#8220;\u3002&#8221;,<br \/>\n    getRandomElement(subjects) + getRandomElement(verbs) + getRandomElement(ends) + &#8220;\uff0c&#8221;,<br \/>\n    getRandomElement(subjects) + getRandomElement(verbs) + getRandomElement(ends) + &#8220;\u3002&#8221;<br \/>\n  ].join(&#8220;\\n&#8221;);<br \/>\n}<\/p>\n<p>console.log(generatePoem());<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u500b\u4eba\u5fc3\u5f97\uff1a<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">ChatGPT\u96d6\u7136\u662f\u8a9e\u8a00\u6a21\u578b\uff0c\u4f46\u8a69\u8a5e\u7b49\u9700\u8981\u610f\u5883\u7684\u6587\u5b57\uff0c\u5728\u6c92\u6709\u7bc4\u672c\u7684\u53c3\u8003\u4e0b\uff0c\u5176\u77ed\u8655\u986f\u800c\u6613\u898b\u3002\u4eba\u8166\u4e5f\u5f97\u63d0\u5347\uff0c\u624d\u80fd\u6b63\u78ba\u904b\u7528AI\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u500b\u4eba\u5fc3\u5f97\uff1a ChatGPT\u96d6\u7136\u662f\u8a9e\u8a00\u6a21\u578b\uff0c\u4f46\u8a69\u8a5e\u7b49\u9700\u8981\u610f\u5883\u7684\u6587\u5b57\uff0c\u5728\u6c92\u6709\u7bc4\u672c\u7684\u53c3\u8003\u4e0b\uff0c\u5176\u77ed\u8655\u986f\u800c\u6613\u898b\u3002\u4eba\u8166\u4e5f\u5f97 [&hellip;]<\/p>\n","protected":false},"author":139426785,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_coblocks_attr":"","_coblocks_dimensions":"","_coblocks_responsive_height":"","_coblocks_accordion_ie_support":"","_postgate_lock_override":"inherit","_postgate_lock_mode":"inherit","_postgate_preview_mode":"inherit","_postgate_preview_limit":0,"_postgate_product_ids":[],"advanced_seo_description":"","jetpack_seo_html_title":"","jetpack_seo_noindex":false,"jetpack_seo_schema_type":"","jetpack_seo_llms_txt_always_include":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":true,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_wpcom_ai_launchpad_first_post":false,"_jetpack_hide_featured_image":false,"_jetpack_featured_image_duplicate_dismissed":0,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"{title}\n\n{excerpt}\n\n{url}","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"_wpas_customize_per_network":false,"jetpack_post_was_ever_published":false},"categories":[760577830,55138170,1],"tags":[],"post_folder":[],"class_list":["post-8566","post","type-post","status-publish","format-standard","hentry","category-chatgpt-technology-sharing","category-technology-sharing","category-uncategorized"],"jetpack_publicize_connections":[],"jetpack_likes_enabled":true,"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/paR5vw-2ea","jetpack-related-posts":[{"id":7878,"url":"https:\/\/1989lifejourney.com\/?p=7878","url_meta":{"origin":8566,"position":0},"title":"ChatGPT\u6e2c\u8a66_23 (Write the comment which style is Apple&#8217;s documentation comment style)","author":"Kevin","date":"12 4 \u6708, 2023","format":false,"excerpt":"\u554f\u984c: Write the comment for below Swift functions wh\u2026","rel":"","context":"\u5728\u300cChatGPT\u300d\u4e2d","block_context":{"text":"ChatGPT","link":"https:\/\/1989lifejourney.com\/?cat=760577830"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":4594,"url":"https:\/\/1989lifejourney.com\/?p=4594","url_meta":{"origin":8566,"position":1},"title":"RxSwift\u6574\u7406","author":"Kevin","date":"25 2 \u6708, 2022","format":false,"excerpt":"RxSwift Definition:Use concept of Observer pattern\u2026","rel":"","context":"\u5728\u300cIOS Development\u300d\u4e2d","block_context":{"text":"IOS Development","link":"https:\/\/1989lifejourney.com\/?cat=37324612"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":4982,"url":"https:\/\/1989lifejourney.com\/?p=4982","url_meta":{"origin":8566,"position":2},"title":"Difference between value type and a reference type in iOS swift\ufffc","author":"Kevin","date":"29 3 \u6708, 2022","format":false,"excerpt":"\u4ee5\u4e0b\u8cc7\u6599\u7686\u53c3\u8003\u81eaRef1\uff0c\u9019\u88e1\u50c5\u4f5c\u500b\u4eba\u5b78\u7fd2\u6574\u7406: Definition of Value type \u2026","rel":"","context":"\u5728\u300cIOS Development\u300d\u4e2d","block_context":{"text":"IOS Development","link":"https:\/\/1989lifejourney.com\/?cat=37324612"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":6434,"url":"https:\/\/1989lifejourney.com\/?p=6434","url_meta":{"origin":8566,"position":3},"title":"SwiftUI\u5b78\u7fd2","author":"Kevin","date":"10 1 \u6708, 2023","format":false,"excerpt":"SwiftUI \u76ee\u7684: \u907f\u514d\u91cd\u8907\u5275\u5efaobject \u78ba\u4fddobject\u7684\u751f\u547d\u9031\u671f\uff0c\u4ee5\u78ba\u5b9afunction\u2026","rel":"","context":"\u5728\u300cIOS Development\u300d\u4e2d","block_context":{"text":"IOS Development","link":"https:\/\/1989lifejourney.com\/?cat=37324612"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":4067,"url":"https:\/\/1989lifejourney.com\/?p=4067","url_meta":{"origin":8566,"position":4},"title":"Quick Sort","author":"Kevin","date":"15 1 \u6708, 2022","format":false,"excerpt":"func partition(arr: inout [Int], front: Int, \u2026","rel":"","context":"\u5728\u300cIOS Development\u300d\u4e2d","block_context":{"text":"IOS Development","link":"https:\/\/1989lifejourney.com\/?cat=37324612"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":3917,"url":"https:\/\/1989lifejourney.com\/?p=3917","url_meta":{"origin":8566,"position":5},"title":"Objective-C\u548cSwift\u7684\u5171\u540c\u9ede\u8207\u4e0d\u540c\u9ede","author":"Kevin","date":"8 12 \u6708, 2021","format":false,"excerpt":"Objective-C\u548cSwift\u7684\u5171\u540c\u9ede\u8207\u4e0d\u540c\u9ede \u4ee5\u4e0b\u8cc7\u6599\u4f86\u81ea[ref]\u7db2\u9801\u5167\u5bb9\uff0c\u9019\u88e1\u7d14\u7cb9\u505a\u91cd\u9ede\u6574\u2026","rel":"","context":"\u5728\u300cIOS Development\u300d\u4e2d","block_context":{"text":"IOS Development","link":"https:\/\/1989lifejourney.com\/?cat=37324612"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/1989lifejourney.com\/index.php?rest_route=\/wp\/v2\/posts\/8566","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/1989lifejourney.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/1989lifejourney.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/1989lifejourney.com\/index.php?rest_route=\/wp\/v2\/users\/139426785"}],"replies":[{"embeddable":true,"href":"https:\/\/1989lifejourney.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=8566"}],"version-history":[{"count":4,"href":"https:\/\/1989lifejourney.com\/index.php?rest_route=\/wp\/v2\/posts\/8566\/revisions"}],"predecessor-version":[{"id":9097,"href":"https:\/\/1989lifejourney.com\/index.php?rest_route=\/wp\/v2\/posts\/8566\/revisions\/9097"}],"wp:attachment":[{"href":"https:\/\/1989lifejourney.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=8566"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/1989lifejourney.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=8566"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/1989lifejourney.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=8566"},{"taxonomy":"post_folder","embeddable":true,"href":"https:\/\/1989lifejourney.com\/index.php?rest_route=%2Fwp%2Fv2%2Fpost_folder&post=8566"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}