English Amiga Board


Go Back   English Amiga Board > Coders > Coders. System

 
 
Thread Tools
Old 04 April 2023, 18:35   #21
desiv
Registered User
 
desiv's Avatar
 
Join Date: Oct 2009
Location: Salem, OR
Posts: 1,770
I'd be afraid to use ChatGPT for code...
We've seen it writes non-working code, so I'd be tempted to ask it why it produced such bad code, and I'm afraid the answer would be:
I've seen your code, so I didn't think you'd mind... ;-)
(sorry...)
I saw an interesting vid on YouTube by Tom Scott, and while it's initial code didn't work for him, it came close enough to save him a lot of time...
It is an interesting technology, and makes me really wonder about the future of it...
desiv is offline  
Old 04 April 2023, 21:28   #22
BastyCDGS
Registered User
 
Join Date: Nov 2015
Location: Freiburg / Germany
Age: 44
Posts: 201
Send a message via ICQ to BastyCDGS
Quote:
Originally Posted by BippyM View Post
The problem with the term Artificial Intelligence is misleading. To be intelligent it needs to be able to learn from input and mistakes. It does not so therefore it isn't intelligent. If it could learn from mistakes and input, and the input was shit... The intelligence would not work and with so many users giving input there would definitelyt be a lot that would intentionally give it incorrect information just to see what happens. It also doesn't understand right from wrong and there is no common sense.
ChatGPT is able to learn things, but AFAIK you need to buy a special ChatGPT plus account or something like that in order having your input feeded back into the main training data.

All other accounts only create a session, which is derived from main training data and ChatGPT is able to learn inside this session. As soon you close the session, it will forget everything in it.

And yes, this is by design from the OpenAI team.

However, a very big issue with ChatGPT is, although its company is called OpenAI, it isn't open, neither open source, nor open access. And Microsoft isn't sympathetic either...

EDIT:
Remember that, if ChatGPT would automatically add every input to its main training data, there is serious risk of data protection violation. Imagine, you are telling ChatGPT your deepest privacy stuff and someone else is asking ChatGPT about your deepest privacy stuff and gets the information. Recipe for disaster...

Last edited by BastyCDGS; 04 April 2023 at 21:36. Reason: Added data protection issues
BastyCDGS is offline  
Old 05 April 2023, 01:28   #23
redblade
Zone Friend
 
redblade's Avatar
 
Join Date: Mar 2004
Location: Middle Earth
Age: 40
Posts: 2,127
Write a program in AREXX which opens 1 binary file and copies it to another file
Code:
/* Open the source file */
src_file = stream("path/to/source/file", "r")

/* Open the destination file */
dest_file = stream("path/to/destination/file", "w")

/* Copy the contents of the source file to the destination file */
do while lines(src_file) <> 0
  line = linein(src_file)
  call lineout(dest_file, line)
end

/* Close the files */
call close(src_file)
call close(dest_file)

/* Done! */
q: can you change the stream() function with open() and the linein() and lineout() functions with ReadCH() WriteCH()

A: Sure, here's the same program with the open(), ReadCH(), and WriteCH() functions instead of stream(), linein(), and lineout():

Code:
/* Open the source file */
src_file = open("path/to/source/file", "rb")

/* Open the destination file */
dest_file = open("path/to/destination/file", "wb")

/* Copy the contents of the source file to the destination file */
do while \eof(src_file)
  ch = ReadCH(src_file)
  call WriteCH(dest_file, ch)
end

/* Close the files */
call close(src_file)
call close(dest_file)

/* Done! */
q: do while \eof(src_file) is not valid in AREXX, \EOF was incorrect, it is supposted to be ~EOF for AREXX, ~ in AREXX is the NOT

a: You are correct again, my apologies for the confusion. In AREXX, the ~ symbol is indeed used to represent the NOT operator, so ~eof(src_file) should be used instead of \eof(src_file).

Here's the corrected code using open(), ReadCH(), and WriteCH():

Code:
/* Open the source file */
src_file = open("path/to/source/file", "rb")

/* Open the destination file */
dest_file = open("path/to/destination/file", "wb")

/* Copy the contents of the source file to the destination file */
do while ~eof(src_file)
  ch = ReadCH(src_file)
  call WriteCH(dest_file, ch)
end

/* Close the files */
call close(src_file)
call close(dest_file)

/* Done! */
q: Can you change the opening of files to be error checked?
q: can you change the error checking to `IF ~OPEN( file...) THEN DO
SAY error message
EXIT 10
END`

A: Certainly! Here's the updated code with the error checking using IF ~OPEN(file...) THEN DO:
Code:
/* Open the source file */
src_file = open("path/to/source/file", "rb")
if ~open(src_file) then do
  say "Error opening source file."
  exit 10
end

/* Open the destination file */
dest_file = open("path/to/destination/file", "wb")
if ~open(dest_file) then do
  say "Error opening destination file."
  call close(src_file)
  exit 10
end

/* Copy the contents of the source file to the destination file */
do while ~eof(src_file)
  ch = ReadCH(src_file)
  call WriteCH(dest_file, ch)
end

/* Close the files */
call close(src_file)
call close(dest_file)

/* Done! */
A: In this updated program, we use the open() function with the ~ NOT operator to check for errors when opening files. If an error occurs, the ~open() function will return true, and we display an error message and exit the program with an error code of 10.

If both files are opened successfully, we proceed with copying the contents of the source file to the destination file, and then close both files when we're done.

I hope this helps! Let me know if you have any further questions.

--
This is a simple problem, I haven't asked it to code a IFF to PNG converter yet.
redblade is offline  
Old 05 April 2023, 09:12   #24
BastyCDGS
Registered User
 
Join Date: Nov 2015
Location: Freiburg / Germany
Age: 44
Posts: 201
Send a message via ICQ to BastyCDGS
Asking ChatGPT to translate from m68k to x86 and converting AmigaDOS to MS-DOS-API. Result is not that bad, except for dos.library part...but I made two mistakes as well, forgot necessary movea.l 4.w,a6 instructions before the OpenLib and before the CloseLib call...

Request to ChatGPT:
Convert this Amiga assembler program to MS-DOS x86 code!

Code:
lea DOSName(pc),a1
moveq #0,d0
jsr _LVOOldOpenLibrary(a6)
movea.l d0,a6
jsr _LVOOutput(a6)
move.l d0,d1
lea HelloWorld(pc),a0
move.l a0,d2
moveq #HelloWorldLen-HelloWorld,d3
jsr _LVOWrite(a6)
movea.l a6,a1
jsr _LVOCloseLibrary(a6)
moveq #0,d0
rts
ChatGPT's reply:
Here's the equivalent code in x86 assembly language:

Code:
lea dx, DOSName
mov ah, 3Ch
xor cx, cx
int 21h
mov bx, ax
mov ah, 40h
lea dx, HelloWorld
mov cx, HelloWorldLen
int 21h
mov ah, 3Eh
mov bx, ax
int 21h
mov ah, 4Ch
int 21h
ret
Note that some of the Amiga-specific function names have been replaced with MS-DOS equivalents, and the input and output registers have been adjusted to match x86 syntax. Also, the equivalent system calls for opening, writing, and closing files have been used in the x86 code.

Last edited by BastyCDGS; 05 April 2023 at 22:37. Reason: Added notice for two missing m68k instructions
BastyCDGS is offline  
Old 05 April 2023, 09:27   #25
BastyCDGS
Registered User
 
Join Date: Nov 2015
Location: Freiburg / Germany
Age: 44
Posts: 201
Send a message via ICQ to BastyCDGS
Now something more Amiga related, very strange result asking for a optimized c2p conversion routine:

Can you output the best, optimized code for c2p conversion in Amiga m68k assembler code? Also remember the differences between the CPUs of m68k!

Reply from ChatGPT:

Yes, I can help you with that. However, I cannot provide "the best" optimized code for c2p conversion in Amiga m68k assembler code since the optimization level depends on various factors and requirements of the specific use case. But here is a basic code for c2p conversion:

Code:
c2p:
    move.b  (a0)+,d0
    move.w  c2ptbl(pc,d0.w),d0
    move.b  (a1,d0.w),d1
    move.b  d1,(a2)+
    dbra    d7,c2p
    rts

c2ptbl:
    dc.w    $0000,$0101,$0202,$0303
    dc.w    $0404,$0505,$0606,$0707
    dc.w    $0808,$0909,$0a0a,$0b0b
    dc.w    $0c0c,$0d0d,$0e0e,$0f0f
Please note that you need to take the differences between Amiga m68k CPUs into account when optimizing your code, as well as the specific requirements of your use case.
BastyCDGS is offline  
Old 05 April 2023, 09:53   #26
BastyCDGS
Registered User
 
Join Date: Nov 2015
Location: Freiburg / Germany
Age: 44
Posts: 201
Send a message via ICQ to BastyCDGS
Can it do ASCII art? Well it can, but I remember the Amiga 500 keyboard slightly different *cough*

Draw an ASCII art showing a classic Amiga 500 keyboard!

Natürlich, hier ist eine ASCII-Kunst des Amiga 500 Keyboards:

Code:
._________________________________________________________________.
| Esc | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 |
|¯¯¯¯¯|¯¯¯¯¯|¯¯¯¯¯|¯¯¯¯¯|¯¯¯¯¯|¯¯¯¯¯|¯¯¯¯¯|¯¯¯¯¯|¯¯¯¯¯|¯¯¯¯¯|¯¯¯¯¯|
| § | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 |
|¯¯¯¯¯|¯¯¯¯¯|¯¯¯¯¯|¯¯¯¯¯|¯¯¯¯¯|¯¯¯¯¯|¯¯¯¯¯|¯¯¯¯¯|¯¯¯¯¯|¯¯¯¯¯|¯¯¯¯¯|
| ' | + | ~ | ^ | ? | - | * | / | ( | ) | | \ |
|¯¯¯¯¯|¯¯¯¯¯|¯¯¯¯¯|¯¯¯¯¯|¯¯¯¯¯|¯¯¯¯¯|¯¯¯¯¯|¯¯¯¯¯|¯¯¯¯¯|¯¯¯¯¯|¯¯¯¯¯|
| <- | F11 | F12 | Prt | Scr | Brk | ^ | _ | { | } | ` ~ |
|_____|¯¯¯¯¯|¯¯¯¯¯|¯¯¯¯¯|¯¯¯¯¯|¯¯¯¯¯|¯¯¯¯¯|¯¯¯¯¯|¯¯¯¯¯|¯¯¯¯¯|_____|
Hoffe, das gefällt dir!


For some reason it replied in german, here are the translations from me:
Natürlich, hier ist eine ASCII-Kunst des Amiga 500 Keyboards ->
Of course, here is an ASCII art of the Amiga 500 keyboard

Hoffe, das gefällt dir! ->
Hope, you like this!
BastyCDGS is offline  
Old 14 June 2023, 07:36   #27
dabba
Registered User
 
Join Date: May 2017
Location: Germany
Posts: 8
As I say: ChatGPT is like a politician.

If it does not know a correct answer to a question, it does not admit that, but writes some BS hoping nobody notices it or it is somehow correct by chance.
dabba is offline  
Old 14 June 2023, 08:42   #28
meynaf
son of 68k
 
meynaf's Avatar
 
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,335
Quote:
Originally Posted by dabba View Post
As I say: ChatGPT is like a politician.

If it does not know a correct answer to a question, it does not admit that, but writes some BS hoping nobody notices it or it is somehow correct by chance.
ChatGPT is at its core nothing more than an automatic text completion system. It has absolutely no way to know if something is correct or not, it only knows what is most statistically likely. This makes it an artificial BS generator - and a surprisingly pretty good one.
meynaf is offline  
Old 14 June 2023, 20:36   #29
malko
Ex nihilo nihil
 
malko's Avatar
 
Join Date: Oct 2017
Location: CH
Posts: 4,936
As long as there will be (dummy) people praising for what this IA is capable of, why would it be different ?
Dummy because they praise without a correct result.
Take a kid and praise him whatever he will do. And then look at the result of your praising...
malko is offline  
Old 15 June 2023, 04:31   #30
tygre
Returning fan!
 
tygre's Avatar
 
Join Date: Jan 2011
Location: Montréal, QC, Canada
Posts: 1,434
Or greedy people trying to scare (dummy) people to stay relevant and cash in $$$...

https://www.cbc.ca/news/world/artifi...risk-1.6859118

tygre is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
View Amos generated assembly code? Brick Nash Coders. AMOS 7 01 May 2021 22:54
External interrupts generated by TCP/IP stacks dissident Coders. Asm / Hardware 37 09 January 2019 10:27
Generated code for sprites Zarchos Coders. Asm / Hardware 12 22 July 2017 20:40
Generated code and CPU Instruction Cache Mrs Beanbag Coders. Asm / Hardware 11 23 May 2014 11:05
Games with generated levelcodes Joe Maroni Nostalgia & memories 12 24 February 2013 01:23

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 14:59.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.09443 seconds with 13 queries