01 February 2023, 22:58 | #1 |
Registered User
Join Date: Jan 2023
Location: Nice, France
Age: 55
Posts: 13
|
chatGPT to write Amiga C code
A colleague of mine was playing with chatGPT today. As he was looking for some challenging questions, I told him to ask chatGPT to create an Amiga C program opening a window. He got the below answer:
#include <intuition/intuition.h> int main() { struct Window *window; struct Screen *screen; screen = OpenScreenTags(NULL, SA_DisplayID, 0x50051000, SA_Title, "My First Window", SA_Width, 640, SA_Height, 480, SA_Depth, 3, TAG_END); if (screen == NULL) { // Screen opening failed, handle error return 1; } window = OpenWindowTags(NULL, WA_Left, 0, WA_Top, 0, WA_Width, 640, WA_Height, 480, WA_IDCMP, IDCMP_CLOSEWINDOW, WA_Title, "My First Window", WA_Activate, TRUE, WA_SmartRefresh, TRUE, WA_NoCareRefresh, TRUE, WA_GimmeZeroZero, TRUE, WA_CloseGadget, TRUE, WA_DepthGadget, TRUE, TAG_END); if (window == NULL) { // Window opening failed, handle error CloseScreen(screen); return 1; } // Main event loop while (1) { ULONG signals = Wait(0L); if (signals & SIGBREAKF_CTRL_C) { break; } } CloseWindow(window); CloseScreen(screen); return 0; } Maybe in the future we'll use this tool to create new Amiga programs! |
02 February 2023, 03:53 | #2 |
Registered User
Join Date: Jun 2016
Location: europe
Posts: 1,089
|
When it comes to programming you should ask the same question a few times, and then compare the answers and laugh (well, you can do that right after the first answer).
|
02 February 2023, 13:32 | #4 |
Global Moderator
Join Date: May 2001
Location: Derby, UK
Age: 46
Posts: 2,304
|
I love it when people post like they're the first person to do something in the world ever lol.
Anyway, convos will get lost in a merge, so will leave the separate threads for now |
02 February 2023, 15:44 | #5 |
Amiga user
Join Date: Nov 2008
Location: Sofia / Bulgaria
Posts: 477
|
This thread was started by chatGPT powered bot!
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
code generated by ChatGPT | ara | Coders. System | 29 | 15 June 2023 04:31 |
Can write Amiga Bootblock PC? | Retro1234 | support.Other | 8 | 10 June 2019 18:15 |
HW banging IDE harddisk read/write asm source code (FFS/OFS) | jotd | Coders. Asm / Hardware | 1 | 19 August 2018 13:09 |
Best way to write native code? | arodgers | support.FS-UAE | 4 | 02 September 2016 19:53 |
So, I'd like to write a new Amiga game - what do you want to see? | Graham Humphrey | Amiga scene | 88 | 26 February 2012 21:50 |
|
|