I asked an AI to create an MSX themed song... :D

Pagina 1/2
| 2

Door LeandroCorreia

Paladin (957)

afbeelding van LeandroCorreia

29-12-2022, 01:56

Yes, I used GPT-3 and asked it to create a song. The AI generated the whole song lyrics by itself. Shocked!

"Give my lyrics for a song with short lines and 8 verses telling a story about how the Devil came to Earth determined to steal the soul of a nerd collector (describe him physically too) of classic MSX computers , by challenging to race in the racing game F-1 Spirit from Konami. If the nerd wins he gets an MSX Turbo-R, if not, he loses his soul."

Verse 1: The Devil came to Earth, with fire in his eyes He searched for a soul to steal, a nerd collector was his prize

Verse 2: The nerd was thin and pale, with glasses on his nose He loved his MSX computers, he had a collection of those

Chorus: The Devil and the nerd, locked in a deadly race The Devil and the nerd, only one will win this place The Devil thinks he's clever, but the nerd's got some speed They'll battle it out, in F-1 Spirit, they'll fight for the lead

Verse 3: The Devil challenged the nerd, a race he did insist The nerd laughed and said "You're on, let's see if you can persist"

Verse 4: They sat down at their computers, they started to play The Devil was confident, he had nothing to lose, he had nothing to say

Chorus: The Devil and the nerd, locked in a deadly race The Devil and the nerd, only one will win this place The Devil thinks he's clever, but the nerd's got some speed They'll battle it out, in F-1 Spirit, they'll fight for the lead

Verse 5: The race was intense, they were neck and neck The Devil was in the lead, but the nerd didn't accept defeat

Verse 6: The nerd fought back, he was determined to win He overtook the Devil, and he let out a grin

Chorus: The Devil and the nerd, locked in a deadly race The Devil and the nerd, only one will win this place The Devil thinks he's clever, but the nerd's got some speed The nerd came out on top, the Devil had to concede

Verse 7: The nerd won the prize, an MSX Turbo-R He was over the moon, he couldn't have asked for more

Verse 8: The Devil was defeated, he couldn't steal the nerd's soul He had to go back to hell, he couldn't play this role

Chorus: The Devil and the nerd, locked in a deadly race The Devil and the nerd, only one will win this place The Devil thinks he's clever, but the nerd's got some speed The nerd came out on top, the Devil had to concede

Aangemeld of registreer om reacties te plaatsen

Van JohnHassink

Ambassador (5665)

afbeelding van JohnHassink

29-12-2022, 05:05

Hey, wait a minute, aren't these the predictions that you get when you play Salamander with F-1 Spirit in slot 2? Big smile

Van ray2day

Paladin (731)

afbeelding van ray2day

29-12-2022, 10:18

I asked OpenAI / ChatGPT to "Create a MSX BASIC game shooter". It came up with this;

10 REM MSX BASIC Game Shooter
20 REM by Your Name Here
30 REM
40 REM Set screen and sprite sizes
50 SCREEN 1, 1, 1
60 SPRITE SIZE 8, 8
70 SPRITE COLOR 1, 2
80 SPRITE COLOR 2, 3
90 SPRITE COLOR 3, 4
100 SPRITE COLOR 4, 5
110 SPRITE COLOR 5, 6
120 SPRITE COLOR 6, 7
130 SPRITE COLOR 7, 8
140 SPRITE COLOR 8, 1
150 REM
160 REM Set game variables
170 DIM SHIP(2), BULLET(2)
180 SHIP(1) = 100 : SHIP(2) = 100
190 BULLET(1) = 0 : BULLET(2) = 0
200 REM
210 REM Main game loop
220 DO
230   REM
240   REM Move the ship
250   IF INKEY$ = "A" THEN SHIP(1) = SHIP(1) - 2
260   IF INKEY$ = "D" THEN SHIP(1) = SHIP(1) + 2
270   IF INKEY$ = "W" THEN SHIP(2) = SHIP(2) - 2
280   IF INKEY$ = "S" THEN SHIP(2) = SHIP(2) + 2
290   REM
300   REM Move the bullet
310   BULLET(1) = BULLET(1) + 3
320   REM
330   REM Clear the screen and draw the ship and bullet
340   CLS
350   SPRITE 1, SHIP(1), SHIP(2)
360   SPRITE 2, BULLET(1), BULLET(2)
370   REM
380   REM Check for bullet hitting enemy
390   IF BULLET(1) > 150 THEN
400     BULLET(1) = 0
410     SCORE = SCORE + 1
420   END IF
430   REM
440   REM Display the score
450   LOCATE 1, 1
460   PRINT "SCORE: "; SCORE
470 LOOP

Though it got the look and feel of MSX BASIC code, ofcourse this code ain't going to work... Still I think it was a good attempt. LOL!

Van aoineko

Paladin (891)

afbeelding van aoineko

29-12-2022, 21:26

Yesterday I played with ChatGPT and taught it how to write a loop in z80 assembler. It took 2 iterations to get a working code that handles a 16-bit loop counter.

Those tools will become more and more important in our lives in the years to come. For better and for worse. Smile

Van santiontanon

Paragon (1770)

afbeelding van santiontanon

29-12-2022, 23:21

chatGPT is pretty good at coding in general! I am not sure about the exact dataset used to train it, so, not sure how much exposure has it had to BASIC, but I bet very little. So, this is quite impressive. It has merged BASIC with Python and other languages, haha, but still, very cool. I bet all it knows about BASIC is taken from webcrawl, rather than the specific code dataset, which I am sure is a GitHub dump, which is the usual source in these type of models. Very cool!

Van NYYRIKKI

Enlighted (6033)

afbeelding van NYYRIKKI

29-12-2022, 23:35

santiontanon wrote:

chatGPT is pretty good at coding in general! I am not sure about the exact dataset used to train it, so, not sure how much exposure has it had to BASIC, but I bet very little. So, this is quite impressive. It has merged BASIC with Python and other languages, haha, but still, very cool. I bet all it knows about BASIC is taken from webcrawl, rather than the specific code dataset, which I am sure is a GitHub dump, which is the usual source in these type of models. Very cool!

Yes, ChatGPT is quite ok to code MSX-BASIC... You just have to remind it of some rules like "variables can have maximum of two letters, lines must have linenumbers, use LINE-command to draw lines, screen resolution is 256x192" etc. and it will perform just fine most of the time. If it still makes a mistake, point it out and it will fix it. Z80 assembler seems to be much more tough for it. Ok, I managed to lure it to write some simple code that works, but it clearly tends to make way too much mistakes.

Here I added the SCREEN 5, but rest was from ChatGPT:

Van NYYRIKKI

Enlighted (6033)

afbeelding van NYYRIKKI

30-12-2022, 01:38

Hmm... Now I tried again to get ChatGPT to write MSX-BASIC, but either it has become more stupid after latest update or I was just incredibly lucky with it when I did my first tests... How ever it seems to perform much better when it has some clear example that it can study and start to modify.

Here is now a quote of our latest discussion that went pretty well.

Quote:

Hello, fellow AI! Here is example of MSX-BASIC program that displays 8x8 sprite on middle of 256x192 screen:

10 COLOR 15,1,7: SCREEN 2,0
20 B$="":X=124:Y=92
30 I=I+1: READ A: B$=B$+CHR$(A): IF I<8 THEN GOTO 30
40 SPRITE$(0)=B$
50 PUT SPRITE 0, (X,Y),15,0
80 DATA 24,60,126,255,36,36,66,129

Can you fix the program so that it drops the sprite like a ball and when it hits the bottom of screen, it bounces back?
---
Certainly! Here is one way you can modify the program to achieve the desired behavior:

10 COLOR 15,1,7: SCREEN 2,0
20 B$="":X=124:Y=92:VY=0
30 I=I+1: READ A: B$=B$+CHR$(A): IF I<8 THEN GOTO 30
40 SPRITE$(0)=B$
50 PUT SPRITE 0, (X,Y),15,0
60 ' Update position and velocity
70 VY=VY+1 ' Gravity
80 Y=Y+VY
90 ' Check for screen boundaries
100 IF Y>184 THEN VY=-VY: Y=184 ' Bottom of screen
110 GOTO 50
200 DATA 24,60,126,255,36,36,66,129

Explanation:

Lines 70-80: At each frame, we update the vertical position of the sprite by adding the vertical velocity to it.
Line 70: The vertical velocity is incremented by 1 every frame to simulate gravity.
Line 80: The vertical position is updated by adding the vertical velocity to it.
Lines 100-110: We check if the sprite has reached the bottom of the screen (Y coordinate greater than 184). If it has, we reverse the vertical velocity and clamp the Y coordinate to 184 to prevent the sprite from going out of bounds.
I hope this helps! Let me know if you have any questions.

---
Ok, now fix it so that the sprite moves from right to left and each time it meets a screen edge it changes direction.
---
Sure! Here is one way you can modify the program to achieve the desired behavior:

10 COLOR 15,1,7: SCREEN 2,0
20 B$="":X=124:Y=92:VX=2
30 I=I+1: READ A: B$=B$+CHR$(A): IF I<8 THEN GOTO 30
40 SPRITE$(0)=B$
50 PUT SPRITE 0, (X,Y),15,0
60 ' Update position and velocity
70 X=X+VX
80 ' Check for screen boundaries
90 IF X>248 THEN VX=-VX: X=248 ' Right of screen
100 IF X<8 THEN VX=-VX: X=8 ' Left of screen
110 GOTO 50
200 DATA 24,60,126,255,36,36,66,129

Explanation:

Line 20: We initialize the horizontal velocity VX to 2.
Line 70: At each frame, we update the horizontal position of the sprite by adding the horizontal velocity to it.
Lines 90-100: We check if the sprite has reached the left or right edge of the screen (X coordinate less than 8 or greater than 248). If it has, we reverse the horizontal velocity and clamp the X coordinate to the edge of the screen to prevent the sprite from going out of bounds.
I hope this helps! Let me know if you have any questions.

---

looks good, now I want both effects to same listing happening at a same time.

---

Certainly! Here is one way you can modify the program to achieve the desired behavior:

10 COLOR 15,1,7: SCREEN 2,0
20 B$="":X=124:Y=92:VX=2:VY=0
30 I=I+1: READ A: B$=B$+CHR$(A): IF I<8 THEN GOTO 30
40 SPRITE$(0)=B$
50 PUT SPRITE 0, (X,Y),15,0
60 ' Update position and velocity
70 VY=VY+1 ' Gravity
80 X=X+VX: Y=Y+VY
90 ' Check for screen boundaries
100 IF Y>184 THEN VY=-VY: Y=184 ' Bottom of screen
110 IF X>248 THEN VX=-VX: X=248 ' Right of screen
120 IF X<8 THEN VX=-VX: X=8 ' Left of screen
130 GOTO 50
200 DATA 24,60,126,255,36,36,66,129

Explanation:

Lines 20-30: We initialize the horizontal velocity VX to 2 and the vertical velocity VY to 0.
Lines 70-80: At each frame, we update the vertical velocity by adding 1 to simulate gravity, and update the horizontal and vertical positions by adding the respective velocities.
Lines 100-120: We check if the sprite has reached the bottom, left, or right edge of the screen. If it has, we reverse the corresponding velocity and clamp the sprite's position to the edge of the screen to prevent it from going out of bounds.
I hope this helps! Let me know if you have any questions.

Van jepmsx

Master (242)

afbeelding van jepmsx

30-12-2022, 09:48

Wow! I didn't know that ChatGPT could do some coding, I thought it was only for chatting and there was another one (I don't recall its name) that had used github to help you coding.

Van santiontanon

Paragon (1770)

afbeelding van santiontanon

30-12-2022, 11:53

The one you are thinking of is "codex", which was trained specifically to do code autocompletion. But the latest incarnations of chatGPT are trained on mixtures of all of those datasets and have pretty good coding capabilities. We have a similar model at work (trained on our own codebase), and it is integrated into our internal IDE. I was skeptical initially, but now I am used to code with this neural auto-complete feature, and coding without it feels so slow and clumsy! The auto-complete suggestions that these models come up with are incredible, and save so much development time Smile

Van jepmsx

Master (242)

afbeelding van jepmsx

30-12-2022, 16:22

You are right, codex is the model that powers copilot. Thanks for the information.

I've never used it. For what I've seen in the copilot web page you write the comment explaining the function and then it suggests the answer. Does it also suggest some code while you are developing the function?

Van santiontanon

Paragon (1770)

afbeelding van santiontanon

30-12-2022, 20:26

We cannot use copilot at work for legal issues (our lawyers do not want to think of the situation where code that goes into our products is generated by a system trained by an external company, and that has been trained on open source software haha). So, I am not sure what types of suggestions does copilot offer. But at least our internal one currently offers 1-line autocomplete suggestions while you are developing.

Pagina 1/2
| 2