Fun with ChatGPT

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
M-A Kuttner
Posts: 49
Joined: Mon Apr 03, 2017 3:55 pm
Location: Nova Scotia, Canada

Fun with ChatGPT

Post by M-A Kuttner » Tue Dec 06, 2022 3:02 pm

This post is just for fun. I was messing around with ChatGPT last night and asked it to generate some LiveCode script for me. Turns out, it can, sorta.
LiveCode GPT.png
Obviously it's got a bunch of holes in it and I had to clean up the script to get it to do exactly what I wanted, but I was impressed that it spat out any code at all. Might be a fun thing to check out!

Cheers
M-A
Hypertalk developer on and off since the days of SuperCard. Currently using LC to do rapid prototyping for a new kids' toy.

stam
Posts: 2679
Joined: Sun Jun 04, 2006 9:39 pm
Location: London, UK

Re: Fun with ChatGPT

Post by stam » Tue Dec 06, 2022 3:23 pm

Looks like fun… for the uninitiated, can you post a link?

M-A Kuttner
Posts: 49
Joined: Mon Apr 03, 2017 3:55 pm
Location: Nova Scotia, Canada

Re: Fun with ChatGPT

Post by M-A Kuttner » Tue Dec 06, 2022 3:39 pm

For sure: https://chat.openai.com/chat

You need to sign up (free). It's in beta right now, so short chats are free. Eventually you'll have to buy tokens, so now's the time to play. Have fun!
Hypertalk developer on and off since the days of SuperCard. Currently using LC to do rapid prototyping for a new kids' toy.

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3581
Joined: Mon Jan 22, 2007 7:36 am
Location: Berkeley, CA, US
Contact:

Re: Fun with ChatGPT

Post by mwieder » Wed Dec 07, 2022 3:45 am

Wait... what?
Who trained it to know xtalk?

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3581
Joined: Mon Jan 22, 2007 7:36 am
Location: Berkeley, CA, US
Contact:

Re: Fun with ChatGPT

Post by mwieder » Wed Dec 07, 2022 4:11 am

OK - this is fun. I said "write a bubblesort script using the LiveCode programming language".
It came up with

Code: Select all

-- Bubble sort function
on bubbleSort(arr)
  repeat for i = 1 to the number of items in arr
    repeat for j = i + 1 to the number of items in arr
      if item j of arr < item i of arr then
        swap item i of arr with item j of arr
      end if
    end repeat
  end repeat
end bubbleSort
I then said "that should be

Code: Select all

on bubbleSort arr
   local i
   
   repeat with i = 1 to the number of items in arr
      repeat with j = i + 1 to the number of items in arr
         if item j of arr < item i of arr then
            swap i, j, arr
         end if
      end repeat
   end repeat
   breakpoint
end bubbleSort

on swap i, j, @arr
   local temp
   
   put item i of arr into temp
   put item j of arr into item i of arr
   put temp into item j of arr
end swap
and it came back with
"Here is an updated version of the bubble sort script, using the LiveCode programming language:" followed by the code I just uploaded. It learns quickly.

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9824
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Fun with ChatGPT

Post by FourthWorld » Wed Dec 07, 2022 5:25 pm

mwieder wrote:
Wed Dec 07, 2022 3:45 am
Wait... what?
Who trained it to know xtalk?
You did. And me. And everyone who's posted code.

Here's a copyright suit against a related "AI" content generator, GitHub's Copilot:
https://www.theregister.com/2022/11/11/ ... t_opinion/
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

LCMark
Livecode Staff Member
Livecode Staff Member
Posts: 1208
Joined: Thu Apr 11, 2013 11:27 am

Re: Fun with ChatGPT

Post by LCMark » Wed Dec 07, 2022 5:46 pm

FourthWorld wrote:
Wed Dec 07, 2022 5:25 pm
You did. And me. And everyone who's posted code.

Here's a copyright suit against a related "AI" content generator, GitHub's Copilot:
https://www.theregister.com/2022/11/11/ ... t_opinion/
Morale of the story... Never use code which you haven't verified the license of first :)

To be fair, using ChatGPT is no different from using a human to write code for you - you need to ensure the code they have written/produced has an appropriate license to include in your software (usually by requiring them to ensure that it does satisfy a suitable license).

One wonders what ChatGPT says if you ask it to write code but with the source code license it is being provided under in a comment at the top...

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3581
Joined: Mon Jan 22, 2007 7:36 am
Location: Berkeley, CA, US
Contact:

Re: Fun with ChatGPT

Post by mwieder » Wed Dec 07, 2022 6:56 pm

Ah. Yeah, that makes sense.

I'd be curious what would happen if someone else asked for a bubblesort... did it just spit back what I wrote in my own lane or did it actually add this to its corpus of knowledge?

Cairoo
Posts: 107
Joined: Wed Dec 05, 2012 5:54 pm

Re: Fun with ChatGPT

Post by Cairoo » Wed Dec 07, 2022 7:21 pm

mwieder wrote:
Wed Dec 07, 2022 6:56 pm
...
I'd be curious what would happen if someone else asked for a bubblesort... did it just spit back what I wrote in my own lane or did it actually add this to its corpus of knowledge?
I would test it but can't. They've since taken it offline due to an exceptionally high demand their systems weren't ready for.

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3999
Joined: Sun Jan 07, 2007 9:12 pm
Location: Bochum, Germany

Re: Fun with ChatGPT

Post by bn » Wed Dec 07, 2022 7:50 pm

mwieder wrote:
Wed Dec 07, 2022 6:56 pm
I'd be curious what would happen if someone else asked for a bubblesort... did it just spit back what I wrote in my own lane or did it actually add this to its corpus of knowledge?
Mark, I tested your request before they the system offline and it returned something very similar to the result you had after your initial inquiry.
(did not compare word by word but there was no handler "swap" and the first line was "-- Bubble sort function", the second line: "on bubbleSort(arr)"

Kind regards
Bernd

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3581
Joined: Mon Jan 22, 2007 7:36 am
Location: Berkeley, CA, US
Contact:

Re: Fun with ChatGPT

Post by mwieder » Wed Dec 07, 2022 8:09 pm

Ah, thanks. I was guessing that it was just spitting back what I uploaded and not really learning from it.
I'm still logged onto the system but it's unresponsive except to say "Too many requests, please slow down"

stam
Posts: 2679
Joined: Sun Jun 04, 2006 9:39 pm
Location: London, UK

Re: Fun with ChatGPT

Post by stam » Wed Dec 07, 2022 9:59 pm

Stop feeding the Gremlin ;)

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3581
Joined: Mon Jan 22, 2007 7:36 am
Location: Berkeley, CA, US
Contact:

Re: Fun with ChatGPT

Post by mwieder » Fri Dec 09, 2022 5:12 pm

Even more fun.

"I Asked ChatGPT To Tell Me a Story about Cookie-Obsessed Squirrels and Iron Man’s Presidential Run. Here’s What It Cooked Up."

https://dlewis.net/blog/2022/12/08/i-as ... cooked-up/

stam
Posts: 2679
Joined: Sun Jun 04, 2006 9:39 pm
Location: London, UK

Re: Fun with ChatGPT

Post by stam » Fri Dec 09, 2022 7:22 pm

mwieder wrote:
Fri Dec 09, 2022 5:12 pm
Even more fun.

"I Asked ChatGPT To Tell Me a Story about Cookie-Obsessed Squirrels and Iron Man’s Presidential Run. Here’s What It Cooked Up."

https://dlewis.net/blog/2022/12/08/i-as ... cooked-up/
That is hilarious! or scary... not sure which lol...
All I can think of is "I'm sorry Dave, I'm afraid I can't do that"

Klaus
Posts: 13824
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Fun with ChatGPT

Post by Klaus » Fri Dec 09, 2022 7:29 pm

stam wrote:
Fri Dec 09, 2022 7:22 pm
...
That is hilarious! or scary... not sure which lol...
All I can think of is "I'm sorry Dave, I'm afraid I can't do that"
Hehe, exactly my thoughts! :-D

Post Reply

Return to “Getting Started with LiveCode - Experienced Developers”