Coding with ChatGPT3: On gaining a superpower

by | Wednesday, May 03, 2023

I had heard that ChatGPT3 could help with writing code and just hadn’t much time to play with it. Part of the reason is that I haven’t really coded in almost 2 decades (maybe more) so was somewhat hesitant to jump in. But again I kept reading of people doing amazing things in this space, creating games, apps to summarize documents, and lots more.

So, not one to start small, I began by asking ChatGPT3 to create me a WordPress plugin to extract everything I have blogged in the past 15 years. And it gave me a bunch of code.

It did take a bit of playing around – but at the end of the day I have a text file on my desktop with over 600-thousand words that I have written over the past 15 years!

Wow.

Just think about it for a second. And let me emphasize, I have NO knowledge of PhP. And I had created a computer program that did a pretty complex task.

As I said, WOW!

So I have, over the past few days, been pushing it further.

First I had it create me a simple version of pong, and in an hour I had created two versions (a 2-player version and single-player one). The code was written in Python – again another programming language I know nothing about. Below is a gif of me playing the single-player version of the game. Yes, it is super basic – but this is not something I had ever imagined I could do.

I began wondering, as an educator, is there something I could create that would be actually pedagogically useful. So I decided to create a simulation that would explain one of the gas laws. In particular I focused on the relationship between temperature and pressure, what is popularly known as Gay-Lussac’s law. Essentially it states that

For a given mass and constant volume of an ideal gas, the pressure exerted on the sides of its container is directly proportional to its absolute temperature.

As a mathematical equation, Gay-Lussac’s law is written as:
P\propto T\, (essentially pressure is directly proportional to temperature).

https://en.wikipedia.org/wiki/Gas_laws

So I began working with ChatGPT3 to see if I could create a simulation of an ideal gas in a box, with little particles bouncing around, off off each other and the walls. And then whether I could increase the temperature making the balls bounce around more faster and slower depending on how I raised or reduced the temperature. Finally, I wanted it to compute some measure of pressure on the walls that changed as I changed the temperature.

This took a bit longer but the end of the day I had a working simulation (animated gif version is given below). Essentially the temperature can be raised or reduced by hitting the up and down arrows and the pressure is computed from the speed and number of balls hitting the walls at any given moment.

First, lets take a moment to just marvel at what I could create in just a few hours of working with ChatGPT3. I have absolutely no knowledge of Python, or even how to use Terminal on my Mac. But here it is.

This is something a middle schooler can create.

Just let that sink in.

I should add that the process was not as straightforward as writing in a prompt and some working code would pop out. I mean, it will generate some code, but the chances are it will not work. You have to learn over time how to craft the prompts and the process is a complex dialogue that does take a bit of patience. To be sure I was constrained by multiple factors, such as my own ignorance of programming, and the fact that the interface often choked when streaming out long batches of code, and so on.

But that is not the point.

The first website I created, possibly back in 1995/6 was terrible… both a of function of being a new technology and my lack of knowledge of what I could do with it. But the technology got better over time, and I got better as well.

All that I know is that I have suddenly been given a super-power that I didn’t have a few days ago.


In 1927, almost a hundred years ago Warner Brothers released a movie called The Jazz Singer. And in a throwaway moment in the film, the main characters says:

“Wait a minute … you ain’t heard nothin’ yet.”

That one sentence captured how sound came to cinema. It upended the industry and changed film forever.

I think the same can be said of these new technologies.


The famous sentence can be seen in the first 15 seconds of the clip below.

A few randomly selected blog posts…

Brevity is the soul

I had posted earlier (see Twittering a tale) about short, short fiction that is suddenly the rage. Matt Koehler just introduced me to another example of this new emerging genre: Six Word Memoirs. Check it out.

Unpacking McLuhan’s “The medium is the message” (1/3)

Unpacking McLuhan’s “The medium is the message” (1/3)

This is the first of a series of blog posts about how media influence our thinking. This, the first post, uses the invention of writing and print to unpack the meaning of McLuhan’s statement, “The medium is the message.” The second post, focuses on a story by Ted...

TPACK at SITE, AERA & ISTE: Newsletter #36

TPACK at SITE, AERA & ISTE: Newsletter #36

Modification of the TPACK diagram to capture all the sessionsrelated to TPACK in three upcoming conferences. Here is a link to Issue #36 of the TPACK newsletter—a special spring conference issue that contains citations and abstracts for all of the TPACK-focused and...

Perceiving & Patterning as skills essential for creativity

We have been writing a series of articles for Tech Trends titled Rethinking Technology & Creativity in the 21st Century. You can see the full list here. One of the key focus areas of these articles is on what we call trans-disciplinary thinking i.e. a set of...

Kuala Lumpur & Penang

I love Malaysia. I love its greenery, its up and down hilly landscape, the colors and designs of the houses, and yes the food. Malaysians are food crazy. There are food stalls everywhere and the range and variety of food available is just amazing. My first night here...

TPACK Newsletter, #43 April 2020

TPACK Newsletter, #43 April 2020

Here is the latest pdf version of the TPACK Newsletter (#43, April 2020), as curated and shared by Judi Harris and her team. (Previous issues are archived here.) This issue includes titles, abstract and links to 76 articles, 2 chapters, and 10 dissertations...

From incompetence to mastery, the stages

One who knows and knows he knows is a wise man, Follow Him One who knows and knows not he knows is asleep, Awaken him One who knows not and knows he knows not is a child, Teach him One who knows not and knows not he knows not is a Fool, Avoid him. -- Attributed...

Constructing knowledge on the web: New dissertation

I am pleased and proud to announce that Mike DeSchryver recently defended his dissertation, titled: Toward a Theory of Web-Mediated Knowledge Synthesis:  How Advanced Learners Used the Web to Construct Knowledge about Climate Change Behavior This is an excellent piece...

Cybersecurity & the Future of Education

Cybersecurity & the Future of Education

I was recently interviewed by David W. Schropfer for his DIY Cyber Guy podcast. David is an expert on cybersecurity and, and that is the focus of his podcast. I am clearly not an cybersecurity expert, so I was somewhat surprised at being invited to his show. What...

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *