ChatGPT and LiveCode

Want to talk about something that isn't covered by another category?

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Hutchboy
Posts: 51
Joined: Wed Aug 01, 2018 2:57 pm
Contact:

ChatGPT and LiveCode

Post by Hutchboy » Thu Dec 29, 2022 2:28 am

I’ve been trying out a number of the ai generators out there and tried ChatGPT this evening to see if it knew about LiveCode. It does at least to some degree. I asked it to generate code for a “hello world” program and to multiply two numbers. It mentioned “stack” in its response, so next I asked it to create a stack to display a bouncing ball…and it described the steps to do it with example code. Thought you all might want to play with it. Just google chatgpt and it will get you the link on the OpenAI website. Have a Happy LiveCode New Year folks!

mrcoollion
Posts: 720
Joined: Thu Sep 11, 2014 1:49 pm
Location: The Netherlands

Re: ChatGPT and LiveCode

Post by mrcoollion » Thu Dec 29, 2022 4:55 pm

I have tried it as well and it is pretty amazing. However, the AI does not have internet connection so it has its limits at this time. maybe just as well ???

AndyP
Posts: 615
Joined: Wed Aug 27, 2008 12:57 pm
Location: Seeheim, Germany (ex UK)
Contact:

Re: ChatGPT and LiveCode

Post by AndyP » Tue Dec 26, 2023 10:47 am

The latest version of chat gpt-4 does have internet access, so more up to date than previous versions.
Andy Piddock
https://livecode1001.blogspot.com Built with LiveCode
https://github.com/AndyPiddock/TinyIDE Mini IDE alternative
https://github.com/AndyPiddock/Seth Editor color theming
http://livecodeshare.runrev.com/stack/897/ LiveCode-Multi-Search

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9388
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: ChatGPT and LiveCode

Post by richmond62 » Tue Dec 26, 2023 10:57 am

I have a funny feeling AndyP, that the last 2 posts before yours were Spam Bots.

AndyP
Posts: 615
Joined: Wed Aug 27, 2008 12:57 pm
Location: Seeheim, Germany (ex UK)
Contact:

Re: ChatGPT and LiveCode

Post by AndyP » Tue Dec 26, 2023 4:17 pm

Hi Richmond,

Maybe so, time will tell 🤔
Andy Piddock
https://livecode1001.blogspot.com Built with LiveCode
https://github.com/AndyPiddock/TinyIDE Mini IDE alternative
https://github.com/AndyPiddock/Seth Editor color theming
http://livecodeshare.runrev.com/stack/897/ LiveCode-Multi-Search

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9670
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: ChatGPT and LiveCode

Post by dunbarx » Tue Dec 26, 2023 7:38 pm

How are the posts preceding Andy's spam bots? They are all from known users.

Craig

SparkOut
Posts: 2852
Joined: Sun Sep 23, 2007 4:58 pm

Re: ChatGPT and LiveCode

Post by SparkOut » Tue Dec 26, 2023 8:17 pm

The mod moderated them, but left the real users' posts

Hutchboy
Posts: 51
Joined: Wed Aug 01, 2018 2:57 pm
Contact:

Re: ChatGPT and LiveCode

Post by Hutchboy » Sat Dec 30, 2023 5:36 am

Hi all, I thought I'd like to share a few thing I'm doing with A.I. that are helping me be more productive in coding. I have configured a GPT I call "LiveCode Helper" that is turning out to be a great little assistant.

I've configured it with directions such as telling it all variables need to be declared in compliance with using "Strict Compilation" mode in the IDE (my preference). I uploaded a lot of information for its knowledge base. Until we get LiveCode Create I am finding this agent extremely helpful. Tonight, for instance, I uploaded an old Basic card game listing called "War" (a card game). It analyzed it, spit out a pseudocode listing, and at my request created a script to generate a nice interface for the game (such as color scheme, size and position of elements in the layout, etc.) It then used the pseudocode and Basic listing to generate a pretty detailed LiveCode script in a code block. Then we went back and forth debugging a few minor things.

I think my biggest takeaway from using it is that I am talking back and forth with it and it is very engaging to work like this. "We" worked on recreating this "War" game and had it done and working in about 45 minutes. Anyway, here is the link to this GPT should you want to play (but you need a subscription to ChatGPT plus): https://chat.openai.com/g/g-gfplNpGOd-livecode-helper

Happy Coding and have a Happy New Year,
Mike 8)

Hutchboy
Posts: 51
Joined: Wed Aug 01, 2018 2:57 pm
Contact:

Re: ChatGPT and LiveCode

Post by Hutchboy » Fri Jan 05, 2024 4:26 am

BTW, here is the link to the "War" game I mentioned above. https://mygiantbrain.com/blog/files/1d8 ... cb4-7.html There is a bit more discussion there about how I am using AI assistance during LiveCode sessions. For my purposes I am really exploring how much more productive I can be and it feels like it is paying off. (Note: I am not striving for the most elegant code in the world but just getting the job done. ) - Mike

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

Re: ChatGPT and LiveCode

Post by stam » Fri Jan 05, 2024 9:56 am

Yeahhhhhh.... word of warning:
if you try to run the War! stack it causes LC to hang on launch (M2 Mac running LC 10 DP7 on MacOS Sonoma 14.2.1)

Good-looking blog though :)

There are issues with the code (it's possible to view this by Suppressing Messages prior to attempting to open the stack).
for example:

Code: Select all

repeat with number = 2 to 14 -- 2-10, 11: Jack, 12: Queen, 13: King, 14: Ace
       put number & "-" & suit & "," after gDeck
end repeat
'number' is used as a variable name but is a reserved keyword. That's a definite no-no...

I haven't really tried to debug this properly, this just caught my eye...


EDIT:
That actually seems to have been the problem - the initializeDeck handler causes the crash. Replacing 'number' with a different variable name, such as 'x' fixes the issue. This works:

Code: Select all

-- Initializes the deck of cards
command initializeDeck
   put empty into gDeck
   repeat with suit = 1 to 4 -- 1: Spades, 2: Hearts, 3: Diamonds, 4: Clubs
      repeat with x = 2 to 14 -- 2-10, 11: Jack, 12: Queen, 13: King, 14: Ace
         put x & "-" & suit & "," after gDeck
      end repeat
   end repeat
   delete char -1 of gDeck -- Remove the trailing comma
   shuffleDeck
  
end initializeDeck

Hutchboy
Posts: 51
Joined: Wed Aug 01, 2018 2:57 pm
Contact:

Re: ChatGPT and LiveCode

Post by Hutchboy » Fri Jan 05, 2024 10:18 am

Thanks, since it is working in my environment I didn't give it a second thought...usually reserved words get flagged. I'll go in and revise the code and reupload. Thanks for the quick reply and for the comment on my website...my blog experiment :-)

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

Re: ChatGPT and LiveCode

Post by stam » Fri Jan 05, 2024 10:41 am

You’re welcome!
I’ll keep an eye on your blog, we need more stuff like this!

PS:
If “number” isn’t flagged/coloured in your script editor there is probably an issue with your installation…

genieee
Posts: 2
Joined: Wed May 03, 2023 9:16 am

Re: ChatGPT and LiveCode

Post by genieee » Sat Jan 06, 2024 7:22 am

Hutchboy wrote:
Thu Dec 29, 2022 2:28 am
I’ve been trying out a number of the ai generators out there and tried ChatGPT this evening to see if it knew about LiveCode. It does at least to some degree. I asked it to generate code for a “hello world” program and to multiply two numbers. It mentioned “template” in its response, so next I asked it to create a stack to display a bouncing ball…and it described the steps to do it with example code. Thought you all might want to play with it. Just google chatgpt and it will get you the link on the OpenAI website. Have a Happy LiveCode New Year folks!
Hey there! Thanks for sharing your experience with ChatGPT and LiveCode. It's awesome that it could generate code for a "hello world" program and even guide you through creating a bouncing ball in a stack. I'm intrigued to give it a try myself now! Wishing you a Happy LiveCode New Year too! 🎉

Hutchboy
Posts: 51
Joined: Wed Aug 01, 2018 2:57 pm
Contact:

Re: ChatGPT and LiveCode

Post by Hutchboy » Thu Feb 08, 2024 1:51 am

Hi,

I want to share my continuing experience with ChatGPT 4. I use the unlimited version 3.5 occasionally, it spits out code fast but has a short attention span compared to version 4. Since I have created a custom GPT 4 that contains a lot of specific knowledge about LiveCode it is my daily driver.

One regular use I make of ChatGPT is to upload my longer scripts and ask it to furnish me with a header within block comment markers. It creates a standard layout and summary and then I ask it to include a list of all the handlers in the script and the key variables. Most of the recent files I've uploaded have their script headers generated this way.

Another use is to upload almost any source code (basic, hypercard, python, javascript) and ask the A.I. to analyze the code and produce a pseudocode listing. It does this in a code block which is nice. Then I ask it this specifically: "Using the pseudocode listing and the original source code as a guide let's begin to recreate this in LiveCode for a stack size of 1024x768 pixels." This usually begins a very productive coding session.

- Mike

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

Re: ChatGPT and LiveCode

Post by stam » Thu Feb 08, 2024 9:00 am

Hi Mike,

Don’t know if it’s possible for you, but have you considered creating a series of YouTube videos showing how to integrate chatGPT with liveCode?

I suspect that may be fairly popular…

Stam

Post Reply

Return to “Off-Topic”