program generated by chatgpt
#10
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.

Code: (Select All)
Dim image As _Unsigned Long
Dim s As _Unsigned Long
s = _NewImage(800, 600, 32)
Screen s

' Prompt the user to enter the width and height of the image
Print "Enter the width of the image: ";
Input ww
Print "Enter the height of the image: ";
Input hh

' Create a blank image with the specified dimensions
image = _NewImage(ww, hh)
' Set the initial color of the image to white
_Dest image
For x = 0 To width - 1
    For y = 0 To height - 1
        PSet (x, y), _RGB32(255, 255, 255)
    Next y
Next x

' Display the image on the screen
Cls
_PutImage (0, 0), image, 0
Sleep 1

' Loop until the user exits the program
Do
    _Dest s
    ' Prompt the user to enter the x and y coordinates of the pixel they want to change
    Print "Enter the x coordinate of the pixel to change: ";
    Input x
    Print "Enter the y coordinate of the pixel to change: ";
    Input y

    ' Prompt the user to enter the new color for the pixel
    Print "Enter the red value (0-255): ";
    Input red
    Print "Enter the green value (0-255): ";
    Input green
    Print "Enter the blue value (0-255): ";
    Input blue

    ' Update the color of the pixel
    _Dest image
    PSet (x, y), _RGB32(red, green, blue)
    _Dest 0

    ' Redraw the image on the screen
    _PutImage (0, 0), image, s

    ' Prompt the user to enter 'q' to exit or any other key to continue
    Print "Press 'q' to quit or any other key to continue: ";
    Input kkey$
Loop Until kkey$ = "q"
Reply


Messages In This Thread
program generated by chatgpt - by James D Jarvis - 12-16-2022, 07:06 PM
RE: program generated by chatgpt - by madscijr - 12-16-2022, 08:51 PM
RE: program generated by chatgpt - by madscijr - 12-16-2022, 09:40 PM
RE: program generated by chatgpt - by Pete - 12-16-2022, 07:15 PM
RE: program generated by chatgpt - by mnrvovrfc - 12-16-2022, 10:24 PM
RE: program generated by chatgpt - by mnrvovrfc - 12-17-2022, 04:39 PM
RE: program generated by chatgpt - by Pete - 12-16-2022, 07:38 PM
RE: program generated by chatgpt - by Pete - 12-16-2022, 08:05 PM
RE: program generated by chatgpt - by James D Jarvis - 12-16-2022, 09:24 PM
RE: program generated by chatgpt - by madscijr - 12-16-2022, 09:44 PM
RE: program generated by chatgpt - by mnrvovrfc - 12-16-2022, 10:46 PM
RE: program generated by chatgpt - by mnrvovrfc - 12-22-2022, 04:52 PM



Users browsing this thread: 4 Guest(s)