Results 1 to 8 of 8

Thread: ChatGPT

  1. #1

    Thread Starter
    PowerPoster abhijit's Avatar
    Join Date
    Jun 1999
    Location
    Chit Chat Forum.
    Posts
    3,221

    ChatGPT

    Are you able to use this new AI phenomenon? What have you used it for?
    Everything that has a computer in will fail. Everything in your life, from a watch to a car to, you know, a radio, to an iPhone, it will fail if it has a computer in it. They should kill the people who made those things.- 'Woz'
    save a blobFileStreamDataTable To Text Filemy blog

  2. #2
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    37,846

    Re: ChatGPT

    Hadn't heard of it, but after a bit of looking....I wonder where the future will lead?
    My usual boring signature: Nothing

  3. #3
    PowerPoster Arnoutdv's Avatar
    Join Date
    Oct 2013
    Posts
    5,481

    Re: ChatGPT

    In the following post wqweto used ChatGPT to answer the original question:
    https://www.vbforums.com/showthread....=1#post5588127

  4. #4
    Wall Poster TysonLPrice's Avatar
    Join Date
    Sep 2002
    Location
    Columbus, Ohio
    Posts
    3,711

    Re: ChatGPT

    I guess it has been around awhile..."itís an updated version of GPT-3, which has been around since 2020". But it seems cool and popular.

    There are some examples in this article: https://www.theatlantic.com/technolo...ssages/672411/

    This is one example:
    Attached Images Attached Images  
    Please remember next time...elections matter!

  5. #5
    Frenzied Member
    Join Date
    Feb 2003
    Posts
    1,660

    Re: ChatGPT

    I tried it and while the answers aren't always perfect, I am impressed. Here's a Connect Four game in vb it produced with only a few prompts:

    Code:
    Module Module1
    
        Sub Main()
          PlayConnectFour()
       End Sub
    
       Sub PlayConnectFour()
          ' Create the game board as a two-dimensional array
          Dim rows As Integer = 6
          Dim columns As Integer = 7
          Dim board(rows, columns) As Integer
    
          ' Initialize the game board with empty cells
          For r = 0 To rows
             For c = 0 To columns
                board(r, c) = 0
             Next
          Next
    
          ' Play the game until someone wins or the board is full
          Dim player As Integer = 1
          Dim gameOver As Boolean = False
          While Not gameOver
             ' Prompt the current player to select a column
             Console.WriteLine("Player " & player & ", select a column:")
             Dim column As Integer = Console.ReadLine()
    
             ' Check if the selected column is valid
             If column < 0 Or column >= columns Then
                Console.WriteLine("Invalid column. Please try again.")
                Continue While
             End If
    
             ' Check if the selected column is full
             If board(0, column) <> 0 Then
                Console.WriteLine("Column is full. Please try again.")
                Continue While
             End If
    
             ' Place the player's token in the lowest empty cell in the selected column
             For r = rows - 1 To 0 Step -1
                If board(r, column) = 0 Then
                   board(r, column) = player
                   Exit For
                End If
             Next
    
             ' Check if the player has won
             If CheckForWin(board, player) Then
                Console.WriteLine("Player " & player & " wins!")
                gameOver = True
             End If
    
             ' Display the updated game board
             DisplayBoard(board)
    
             ' Check if the board is full
             If IsBoardFull(board) Then
                Console.WriteLine("The game is a draw.")
                gameOver = True
             End If
    
             ' Switch to the other player
             If player = 1 Then player = 2 Else player = 1
          End While
       End Sub
    
       Function CheckForWin(board(,) As Integer, player As Integer) As Boolean
          Dim rows As Integer = board.GetLength(0)
          Dim columns As Integer = board.GetLength(1)
    
          ' Check for horizontal wins
          For r = 0 To rows - 1
             For c = 0 To columns - 4
                If board(r, c) = player AndAlso board(r, c + 1) = player AndAlso board(r, c + 2) = player AndAlso board(r, c + 3) = player Then
                   Return True
                End If
             Next
          Next
    
          ' Check for vertical wins
          For r = 0 To rows - 4
             For c = 0 To columns - 1
                If board(r, c) = player AndAlso board(r + 1, c) = player AndAlso board(r + 2, c) = player AndAlso board(r + 3, c) = player Then
                   Return True
                End If
             Next
          Next
    
          ' Check for diagonal wins (top-left to bottom-right)
          For r = 0 To rows - 4
             For c = 0 To columns - 4
                If board(r, c) = player AndAlso board(r + 1, c + 1) = player AndAlso board(r + 2, c + 2) = player AndAlso board(r + 3, c + 3) = player Then
                   Return True
                End If
             Next
          Next
    
          ' Check for diagonal wins (top-right to bottom-left)
          For r = 0 To rows - 4
             For c = columns - 1 To 3 Step -1
                If board(r, c) = player AndAlso board(r + 1, c - 1) = player AndAlso board(r + 2, c - 2) = player AndAlso board(r + 3, c - 3) = player Then
                   Return True
                End If
             Next
          Next
    
          Return False
       End Function
    
       Function IsBoardFull(board(,) As Integer) As Boolean
          Dim rows As Integer = board.GetLength(0)
          Dim columns As Integer = board.GetLength(1)
    
          For r = 0 To rows - 1
             For c = 0 To columns - 1
                If board(r, c) = 0 Then
                   Return False
                End If
             Next
          Next
    
          Return True
       End Function
    
       Sub DisplayBoard(board(,) As Integer)
          Dim rows As Integer = board.GetLength(0)
          Dim columns As Integer = board.GetLength(1)
    
          ' Print the column numbers at the top of the board
          Console.Write("  ")
          For c = 0 To columns - 1
             Console.Write(c & " ")
          Next
          Console.WriteLine()
    
          ' Print each row of the board
          For r = 0 To rows - 1
             Console.Write(r & " ")
             For c = 0 To columns - 1
                If board(r, c) = 0 Then
                   Console.Write(". ")
                Else
                   Console.Write(board(r, c) & " ")
                End If
             Next
             Console.WriteLine()
          Next
       End Sub
    
    End Module
    It's not perfect but could be made into a passable program with little effort.

  6. #6
    Fanatic Member Peter Porter's Avatar
    Join Date
    Jul 2013
    Posts
    514

    Re: ChatGPT

    Quote Originally Posted by Peter Swinkels View Post
    I tried it and while the answers aren't always perfect, I am impressed. Here's a Connect Four game in vb it produced with only a few prompts:

    Code:
    Module Module1
    
        Sub Main()
          PlayConnectFour()
       End Sub
    
       Sub PlayConnectFour()
          ' Create the game board as a two-dimensional array
          Dim rows As Integer = 6
          Dim columns As Integer = 7
          Dim board(rows, columns) As Integer
    
          ' Initialize the game board with empty cells
          For r = 0 To rows
             For c = 0 To columns
                board(r, c) = 0
             Next
          Next
    
          ' Play the game until someone wins or the board is full
          Dim player As Integer = 1
          Dim gameOver As Boolean = False
          While Not gameOver
             ' Prompt the current player to select a column
             Console.WriteLine("Player " & player & ", select a column:")
             Dim column As Integer = Console.ReadLine()
    
             ' Check if the selected column is valid
             If column < 0 Or column >= columns Then
                Console.WriteLine("Invalid column. Please try again.")
                Continue While
             End If
    
             ' Check if the selected column is full
             If board(0, column) <> 0 Then
                Console.WriteLine("Column is full. Please try again.")
                Continue While
             End If
    
             ' Place the player's token in the lowest empty cell in the selected column
             For r = rows - 1 To 0 Step -1
                If board(r, column) = 0 Then
                   board(r, column) = player
                   Exit For
                End If
             Next
    
             ' Check if the player has won
             If CheckForWin(board, player) Then
                Console.WriteLine("Player " & player & " wins!")
                gameOver = True
             End If
    
             ' Display the updated game board
             DisplayBoard(board)
    
             ' Check if the board is full
             If IsBoardFull(board) Then
                Console.WriteLine("The game is a draw.")
                gameOver = True
             End If
    
             ' Switch to the other player
             If player = 1 Then player = 2 Else player = 1
          End While
       End Sub
    
       Function CheckForWin(board(,) As Integer, player As Integer) As Boolean
          Dim rows As Integer = board.GetLength(0)
          Dim columns As Integer = board.GetLength(1)
    
          ' Check for horizontal wins
          For r = 0 To rows - 1
             For c = 0 To columns - 4
                If board(r, c) = player AndAlso board(r, c + 1) = player AndAlso board(r, c + 2) = player AndAlso board(r, c + 3) = player Then
                   Return True
                End If
             Next
          Next
    
          ' Check for vertical wins
          For r = 0 To rows - 4
             For c = 0 To columns - 1
                If board(r, c) = player AndAlso board(r + 1, c) = player AndAlso board(r + 2, c) = player AndAlso board(r + 3, c) = player Then
                   Return True
                End If
             Next
          Next
    
          ' Check for diagonal wins (top-left to bottom-right)
          For r = 0 To rows - 4
             For c = 0 To columns - 4
                If board(r, c) = player AndAlso board(r + 1, c + 1) = player AndAlso board(r + 2, c + 2) = player AndAlso board(r + 3, c + 3) = player Then
                   Return True
                End If
             Next
          Next
    
          ' Check for diagonal wins (top-right to bottom-left)
          For r = 0 To rows - 4
             For c = columns - 1 To 3 Step -1
                If board(r, c) = player AndAlso board(r + 1, c - 1) = player AndAlso board(r + 2, c - 2) = player AndAlso board(r + 3, c - 3) = player Then
                   Return True
                End If
             Next
          Next
    
          Return False
       End Function
    
       Function IsBoardFull(board(,) As Integer) As Boolean
          Dim rows As Integer = board.GetLength(0)
          Dim columns As Integer = board.GetLength(1)
    
          For r = 0 To rows - 1
             For c = 0 To columns - 1
                If board(r, c) = 0 Then
                   Return False
                End If
             Next
          Next
    
          Return True
       End Function
    
       Sub DisplayBoard(board(,) As Integer)
          Dim rows As Integer = board.GetLength(0)
          Dim columns As Integer = board.GetLength(1)
    
          ' Print the column numbers at the top of the board
          Console.Write("  ")
          For c = 0 To columns - 1
             Console.Write(c & " ")
          Next
          Console.WriteLine()
    
          ' Print each row of the board
          For r = 0 To rows - 1
             Console.Write(r & " ")
             For c = 0 To columns - 1
                If board(r, c) = 0 Then
                   Console.Write(". ")
                Else
                   Console.Write(board(r, c) & " ")
                End If
             Next
             Console.WriteLine()
          Next
       End Sub
    
    End Module
    It's not perfect but could be made into a passable program with little effort.
    I'm impressed!

    Maybe it can help me solve some programming issues.

  7. #7
    Addicted Member jg.sa's Avatar
    Join Date
    Nov 2017
    Location
    South Australia ( SA )
    Posts
    191

    Re: ChatGPT

    Decided to give #chatgpt a try, it doesn't seem to be self aware, in humans this starts between 15 and 18 months of age !!!

    Question : when should you use chatgpt

    Answer : It is not clear what you are referring to with "chatgpt." Could you please provide more context or clarify your question?

    #ai #bots #selfawareness

  8. #8
    Angel of Code Niya's Avatar
    Join Date
    Nov 2011
    Posts
    7,823

    Re: ChatGPT

    Here's a fun one I just had. Sometimes getting it to do something right is like pulling teeth. I had to condescend to it before it got it right:-
    It seems you don't know how to draw a cube. Let me teach you. You can draw a cube by drawing two overlapping squares that are slightly offset from each other. You then draw lines that connect the corresponding corners of each square. Using this information, I want you to write some GDI+ code in VB.Net that draws a cube on a Form.
    Last edited by Niya; Yesterday at 09:06 AM.
    Treeview with NodeAdded/NodesRemoved events | BlinkLabel control | Calculate Permutations | Object Enums | ComboBox with centered items | .Net Internals article(not mine) | Wizard Control | Understanding Multi-Threading | Simple file compression | Demon Arena

    Copy/move files using Windows Shell | I'm not wanted

    C++ programmers will dismiss you as a cretinous simpleton for your inability to keep track of pointers chained 6 levels deep and Java programmers will pillory you for buying into the evils of Microsoft. Meanwhile C# programmers will get paid just a little bit more than you for writing exactly the same code and VB6 programmers will continue to whitter on about "footprints". - FunkyDexter

    There's just no reason to use garbage like InputBox. - jmcilhinney

    The threads I start are Niya and Olaf free zones. No arguing about the benefits of VB6 over .NET here please. Happiness must reign. - yereverluvinuncleber

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width