LLMs: Transformational Dialogues and Interactions

Checking in again with the curves of learning. I’ve started to take a bit more of a hands-on approach with some simple programming follow alongs. I’ve programmed a simple rock, paper, scissors game based upon a popular training program.

After getting the basics of the game copied from the training program, I saw many opportunities to make the program better and increase the user interaction function. I do not want this to be confused with coding efficiency. There is no doubt that this simple game could be coded in a much more efficient way. The important aspect is that I am able to get in and have an understanding of the syntax.

I used ChatGPT to make a variety of additions to the base program. When I pasted in the base code and told Chat what I wanted to do, I was surprised that Chat also provided some additional aspects that I did not consider. Chat included a code for a tie game if the user and computer selected the same attribute. To simplify the game, I wanted the user input to be reduced to one letter instead of typing in the full word. This took some real massaging because the code was already structured in a certain way and for time purposes I did not want to deviate too much from the initial coding.

The important part of the lesson is to gain greater understandings of the organization and distribution of attributes and instructions to provide the computer. I finally got the program to work but there was a snag that I did not see last night that arose this morning. When there was a tie game, the computer would say that the user had won.

I delivered the results and error into Chat and a repair was made. Unfortunately, the repair created another error which made the game completely unplayable. I went back and forth with Chat to get a simple fix and include additional optional syntax to create a smooth flow of user input and results. What I found was interesting and concerning.

After a few rounds of going back and forth with the language model to repair the issue, I saw that Chat was providing me with code iterations that was the original flawed code that I had given it at the beginning. I also noticed that the Chat was making adjustments to the code in places that was not exactly relevant to the issue at hand. I had to prompt the Chat to just focus on the lines of code that needed repair. Back and forth, back and forth we went. “Am I getting frustrated!!?” I thought.

What I found interesting was that the inanimate Chat LLM was drawing an emotional response from me rather than the other way around. In my blog post “Garbage In, Garbage Out” I speak about “The Permeation,” a situation where the machines will permeate society with a unemotional machine-like influence that could create problematic social issues.

I also realized that my reliance on the Chat to supercharge the code without clearly understanding what it was doing and why, served to my own detriment. The back and forth with the code could create problems where poorly developed code could become integrated with important systems beyond the simple game I was creating.

The Chat kept going back to the code lines regarding the user and computer wins and loses. The issue was with the Tie Game, but the Chat was trying to solve the problem by defining and redefining syntax in the “how to win the game” line. In this case the onset of my simmering frustration is the thing that would lead to the solution and an important insight.

I saw that the Chat was not going to see things how I saw them, regardless of my inexperience. I realized that we needed to address the lines of code where the Tie Game resided. Even though I did not know exactly what code to input, I instructed Chat to focus its attention to the Tie Game code lines. Only then were we able to move away from a code section and focus on the lines that really mattered.

This solidified my idea that the rookie programmer must first learn to program, then, utilize LLMs to make things better and more efficient. I also realized that the potential repairs and efficiencies that the Chat was providing was not efficient when viewing the issue from the perspective of code efficiency; the amount of combination of letters and lines used to create the instructions.

I learned that an inexperienced programmer can still command the focus of the LLM to the desired section, not to issue a complete repair, but to introduce a new idea. I saw that the prompting was becoming more of a dialogue rather than an instructional exchange. I prompted the chat to find a solution in a particular area and the Chat responded. A repair was found that fixed the problem. “YEEEAHHH!!!” Victory! I even let out a shout and fist pump.

That right there is the reaction that will take the beginning guys and keep them creating new things. Young programmers will have more opportunities to have victories that are a bit more meaningful beyond print(“Hello, World!”).

I am really excited about that.

Rock, Paper, Scissors:

import random
print("Do you want to play Rock, Paper, Scissors? ")
user_accept = input("(Y)es or (N)o? ")
if user_accept.upper() != "Y":
    print("OK See you next time")
    quit()
print("You're in!, Let's go!")
user_wins = 0
computer_wins = 0
options = ["rock", "paper", "scissors","r", "p", "s", "Rock", "Paper", "Scissors"]
title_map = {
    "R": "Rock",
    "P": "Paper",
    "S": "Scissors",
    "r": "Rock",
    "p": "Paper",
    "s": "Scissors"
}
while True:
    user_input = input("Type (R)ock/(P)aper/(S)cissors or (Q) to quit: ").upper()
    if user_input == "Q":
        break
    if user_input not in title_map:
        continue
    divider = "-" * 60
    title_selection = title_map[user_input]
    print("\n>>>> You Picked <<<<", title_selection)
    random_number = random.randint(0, 2)
    # rock: 0, paper: 1, scissors: 2
    computer_pick_index = random_number
    computer_pick = options[computer_pick_index]
    print("\n>>>> Computer Picked <<<<", computer_pick + ".")
    if computer_pick == title_selection.lower():
        print("\n>>>> It's a Tie! <<<<\n")
        continue
    elif computer_pick == options[(options.index(title_selection.lower()) + 1) % 3]:
        print("\n>>>> You Lost! <<<<\n")
        computer_wins += 1
    else:
        print("\n>>>> You Won! <<<<\n")
        user_wins += 1
    print(divider)
print("You won", user_wins, "times.")
print("The computer won", computer_wins, "times.")
print("Goodbye!")

albert williams