program generated by chatgpt
#11
(12-16-2022, 09:01 PM)James D Jarvis Wrote: My son told me he watched a video where it was used to write a game using the UNITY engine. They did have to have it rework subroutines and it had trouble understanding the difference between the 2D engine and the 3D engine so there was some manual editing but it was functional.  Seemingly you just have to be patient and feed it information it can use.

Yeah, I think it could probably be useful for generating smaller helper routines, or a general outline for a program where you would fill in the details! 
It is interesting, I will say that!
Reply
#12
(12-16-2022, 09:24 PM)James D Jarvis Wrote: The world's worst image painter. I wish I'd kept track of the whole session. There was also a last second edit because I can't explain everything to the chat AI. It's probably a good thing it can't hear me curse.

Hahahahaha!
One pixel at a time!
Rome wasn't built in a day, you know!
And apparently neither was the Mona Lisa, nor will it be, using this program, in our lifetime!
It worked though - I got it to draw a red pixel at 100,101!
Yippee!
Tongue
Reply
#13
(12-16-2022, 07:15 PM)Pete Wrote: Where's the rocket? All I see is a chess piece with a gas problem.

Pete
ROFLMAO!


(12-16-2022, 08:01 PM)James D Jarvis Wrote: Looks like you bested the ai.  Here's the code it generated for: produce program source code for QB64PE that will generate an ascii image of snoopy cursing the red baron

Just create the "DRAWTEXT" function, change the "COLORDD" and change the "_FONT" line to separate "_LOADFONT" and "_FONT" entries.

Maybe the string entries would have to be edited so it doesn't assume a number of characters per row. It looks like the "_NEWIMAGE" entry could be removed and then "PRINT" could be used straight out but it wouldn't benefit the two figures that have to stand next to each other on the same screen.
Reply
#14
The Linux user could choose a font in his/her system, if he/she doesn't have Wine and didn't run "winetricks". This is to use the same "Courier New" as the Windows version. I made a couple of other modifications -- why did the "Baron" get that name?

Code: (Select All)
'modified by mnrvovrfc
' QB64PE ASCII Art program to generate an image of Snoopy cursing the Red Baron
' Requires QB64PE to run

Screen _NewImage(640, 480, 32)

' Define variables to hold the ASCII art text
Dim Shared cr$
Dim snoopy As String
Dim redBaron As String
cr$ = Chr$(13)

' Set the ASCII art text for Snoopy and the Red Baron
snoopy = ""
snoopy = snoopy + "    .--." + cr$
snoopy = snoopy + "   : (\\/) :" + cr$
snoopy = snoopy + "    '--'" + cr$
snoopy = snoopy + "   /(   )\\" + cr$
snoopy = snoopy + "  |  ''  |" + cr$
snoopy = snoopy + "  |       |" + cr$
snoopy = snoopy + "  |       |" + cr$
snoopy = snoopy + "  |       |" + cr$
snoopy = snoopy + " _|       |_" + cr$
snoopy = snoopy + "(' \\     / ')" + cr$
snoopy = snoopy + "  \\  '._.'  /" + cr$
snoopy = snoopy + "   '-.___.-'" + cr$

redBaron = ""
redBaron = redBaron + "         .-." + cr$
redBaron = redBaron + "        (   )." + cr$
redBaron = redBaron + "       (___(__)" + cr$
redBaron = redBaron + "       /:  V   \\" + cr$
redBaron = redBaron + "      /:  / \\   \\" + cr$
redBaron = redBaron + "     /:  /   \\   \\" + cr$
redBaron = redBaron + "    /:  /     \\   \\" + cr$
redBaron = redBaron + "   /:  /       \\   \\" + cr$
redBaron = redBaron + "  /:  /         \\   \\" + cr$
redBaron = redBaron + " /:  /           \\   \\" + cr$
redBaron = redBaron + "(____________________)" + cr$

' Set the font and text color
Dim As Long lh, ccolor
$If WIN Then
        lh = _LOADFONT("C:\Windows\Fonts\cour.ttf", 20)
$Else
    lh = _LoadFont(Environ$("HOME") + "/.wine/drive_c/windows/Fonts/cour.ttf", 20)
    If lh <= 0 Then Print "Sorry, Wine needs to be installed."
$End If
_Font lh

' Draw the ASCII art text on the screen
ccolor = _RGB(192, 192, 192)
Color ccolor
ELDRAWTEXT snoopy, 10, 10
ccolor = _RGB(224, 0, 0)
Color ccolor
ELDRAWTEXT redBaron, 10, _Width \ 2

' Wait for a key press to exit the program
While InKey$ = ""
    _Limit 100
Wend

System

Sub ELDRAWTEXT (which As String, topy As Long, topx As Long)
    Dim As Long fw, fh, x, y, u
    Dim ch As String * 1
    fw = _PrintWidth("W")
    fh = _FontHeight
    x = topx
    y = topy
    For u = 1 To Len(which)
        ch = Mid$(which, u, 1)
        If ch = cr$ Then
            x = topx
            y = y + fh
        Else
            _PrintString (x, y), ch
            x = x + fw
        End If
    Next
End Sub
Reply
#15
The Red Baron was Baron Manferd Von Richtofen a famed German fighter pilot and arch nemesis of Snoopy.
Reply
#16
(12-16-2022, 07:23 PM)James D Jarvis Wrote: create a qb64PE program to randomly generate a smiley face with a prompt to continue with a new face or quit the program.    

Code: (Select All)
' Random Smiley Face Program
' Author: OpenAI

Randomize Timer

Dim Smiley(3) As String * 5

Smiley(1) = ":)"
Smiley(2) = ":D"
Smiley(3) = ";)"

Do
    Print Smiley(Int(Rnd(1) * 3) + 1)
    Print "Press 'N' for a new smiley, or 'Q' to quit."
    Input choice$
Loop While UCase$(choice$) <> "Q"

End

   
Reply
#17
you have to keep an eye on Chat GPT because it's a horrible liar:

"Provide an example of a simple gui dialog in QB64 with maybe 2 or 3 buttons in a prompt"

DON'T RUN ME
Code: (Select All)
' Declare variables
DIM button AS INTEGER
DIM dialog AS INTEGER

' Create a button and assign it to the variable "button"
button = _CREATEPUSHBUTTON("Click Me!", 50, 50, 150, 50)

' Set the button's font and color
_SETFONT button, "Arial", 24, _FW_BOLD
_SETTEXTCOLOR button, _RGB(0, 0, 255)

' Set the button's background color
_SETBKCOLOR button, _RGB(255, 255, 255)

' Set the button's text alignment
_SETALIGNMENT button, _TA_CENTER

' Set the button's default state (unclicked)
_SETSTATE button, _STATE_NORMAL

' Set the button's hover state (when the mouse is hovering over it)
_SETHOVERSTATE button, _STATE_HOT

' Set the button's clicked state (when it is clicked)
_SETPRESSEDSTATE button, _STATE_PRESSED

' Set the button's callback function
_SETEVENT button, _EVENT_CLICK, "buttonClicked"

' Display the button
_SHOW button

' Main loop
DO
    ' Update the GUI
    _PROCESSMESSAGES

    ' Sleep for 10 milliseconds
    SLEEP 10
LOOP

' Button clicked callback function
SUB buttonClicked
    ' Create a dialog box and assign it to the variable "dialog"
    dialog = _CREATEDIALOG("Dialog", 50, 50, 300, 200)

    ' Set the dialog box's font and color
    _SETFONT dialog, "Arial", 18, _FW_NORMAL
    _SETTEXTCOLOR dialog, _RGB(0, 0, 0)

    ' Set the dialog box's background color
    _SETBKCOLOR dialog, _RGB(255, 255, 255)

    ' Set the dialog box's text
    _SETTEXT dialog, "Would you like to continue?"

    ' Add two buttons to the dialog box
    _CREATEPUSHBUTTON "Yes", 50, 100, 75, 25, _IDOK, dialog
    _CREATEPUSHBUTTON "No", 175, 100, 75, 25, _IDCANCEL, dialog

    ' Display the dialog box and wait for the user to click a button
    result = _DO(dialog)

    ' If the user clicked the "Yes" button
    IF result = _IDOK THEN
        ' Show a message box indicating that the user clicked "Yes"
        _MESSAGE "You clicked Yes!"
    END IF

    ' If the user clicked the "No" button
    IF result = _IDCANCEL THEN
        ' Show a message box indicating that the user clicked "No"
        _MESSAGE "You clicked No!"
    END IF
END SUB
Reply
#18
That processor is assuming QB64 commands available... in 2035? LOL "_CREATEPUSHBUTTON" without any screen created yet and the "SCREEN 0" isn't good enough, maybe except for old "dialog" Linux program.

It's almost like that processor thinks Win API functions could be directly transcribed into QB64 commands.

Maybe I should get this "chatgpt" to see what it does for Freebasic. :O
Reply




Users browsing this thread: 3 Guest(s)