{"id":6282,"date":"2026-08-01T14:29:45","date_gmt":"2026-08-01T14:29:45","guid":{"rendered":"https:\/\/jwilliamcupp.name\/blog\/?p=6282"},"modified":"2026-08-01T14:29:45","modified_gmt":"2026-08-01T14:29:45","slug":"fun-with-ai-we-still-need-thinking","status":"publish","type":"post","link":"https:\/\/jwilliamcupp.name\/blog\/fun-with-ai-we-still-need-thinking\/","title":{"rendered":"Fun with AI: We Still Need Thinking"},"content":{"rendered":"<h2 style=\"text-align:center;\"><b>We Still Need Thinking<\/b><\/h2>\n<p>Recently, as an intellectual exercise I wanted to write a program to play \u201cPsych-Out\u201d (also called Flip-It), which is a small hand held plastic implementation of a game of <a href=\"https:\/\/en.wikipedia.org\/wiki\/Nim\">Nim<\/a>. I sought ChatGPT\u2019s assistance in program the game for solo console play, first in Python and then in Ada.<\/p>\n<p>ChatGPT is good at Python and in no time at all I had the game finished. Here is a screen shot of the first screen, where the player begins \u201cremoving chips.\u201d<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/jwilliamcupp.name\/blog\/wp-content\/uploads\/2026\/08\/image.png\" width=70% height=auto alt=\"Psych Out game display programmed in Python\"\/><\/p>\n<p>Then, I moved along to the Ada version. Early on, ChatGPT developed a version that worked, but the alignment of the chips was not right. It looked like this:<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/jwilliamcupp.name\/blog\/wp-content\/uploads\/2026\/08\/image-1.png\" width=70% height=auto alt=\"Psych Out game display programmed in Ada\"\/><\/p>\n<p>I tried three or four times to get it to correct the code but it kept getting nowhere. I realized it was oscillating between two versions, going back and forth and decided to step in. Looking at the problem, I realized pretty quickly it <i>had<\/i> aligned the chips, but failed to consider the different lengths in the row labels. I merely changed the definition of Top from \u201cTOP\u201d (three characters) to \u201cTOP \u201d (six characters, including three spaces) and the difficulty was instantly handled.<\/p>\n<p>Getting the Ada version to display pink color \u201cchips\u201d was another issue. Ada naturally defaults to ASCII. To display color on an ANSI-capable console \u2013 and to use the solid vertical block character \u2013 it\u2019s necessary to use Unicode (UTF-8). Ada can do this by use of the predefined type <span style=\"font-family: 'Courier New', Courier, monospace;\">Wide_Wide_Character<\/span>, as opposed to the easier and more common predefined type <span style=\"font-family: 'Courier New', Courier, monospace;\">Character<\/span>. ChatGPT tried all kinds of tricks and work-arounds attempting to make <span style=\"font-family: 'Courier New', Courier, monospace;\">Character<\/span> work. Only when I specifically told it to just accept reality and use <span style=\"font-family: 'Courier New', Courier, monospace;\">Wide_Wide_Character<\/span> did it give up trying longer, harder approaches and go with the straightforward Unicode character set.<\/p>\n<p>Another point is that the program specification called for the player to input moves by either entering the desired row name, or simply the first letter of that row name. ChatGPT designed an approach in Ada that worked, but it was much simpler to just inspect the first letter of the string input by the player, and I replaced several lines of code with one, much simpler statement in Ada.<\/p>\n<p>From my viewpoint, ChatGPT (AI in general) is pretty good at doing arcane, complicated, and repetitive things well. When so directed, it could and did write \u201cgood Ada code,\u201d including language cultural approaches such as full use of code unit modularity, enforced separation of declarative parts and executable parts, and meaningful naming conventions. But left to its own, ChatGPT wrote Ada code in a Python like-approach: any time a new variable was needed an additional Declare block was thrown in to avoid thinking forward. Variable and constant names all come out as one-letter titles; when instructed to avoid use of single letters, ChatGPT uses variable names like <span style=\"font-family: 'Courier New', Courier, monospace;\">c1<\/span>, <span style=\"font-family: 'Courier New', Courier, monospace;\">c2<\/span> and so on. With input of detailed expectations, the Ada code came out very good from the start.<\/p>\n<p>Thinking is still required.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>We Still Need Thinking Recently, as an intellectual exercise I wanted to write a program to play \u201cPsych-Out\u201d (also called Flip-It), which is a small hand held plastic implementation of a game of Nim. I sought ChatGPT\u2019s assistance in program the game for solo console play, first in Python and then in Ada. ChatGPT is &hellip; <a href=\"https:\/\/jwilliamcupp.name\/blog\/fun-with-ai-we-still-need-thinking\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Fun with AI: We Still Need Thinking<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","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},"jetpack_post_was_ever_published":false},"categories":[1],"tags":[],"class_list":["post-6282","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p4oUw6-1Dk","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/jwilliamcupp.name\/blog\/wp-json\/wp\/v2\/posts\/6282","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jwilliamcupp.name\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jwilliamcupp.name\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jwilliamcupp.name\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jwilliamcupp.name\/blog\/wp-json\/wp\/v2\/comments?post=6282"}],"version-history":[{"count":1,"href":"https:\/\/jwilliamcupp.name\/blog\/wp-json\/wp\/v2\/posts\/6282\/revisions"}],"predecessor-version":[{"id":6285,"href":"https:\/\/jwilliamcupp.name\/blog\/wp-json\/wp\/v2\/posts\/6282\/revisions\/6285"}],"wp:attachment":[{"href":"https:\/\/jwilliamcupp.name\/blog\/wp-json\/wp\/v2\/media?parent=6282"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jwilliamcupp.name\/blog\/wp-json\/wp\/v2\/categories?post=6282"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jwilliamcupp.name\/blog\/wp-json\/wp\/v2\/tags?post=6282"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}