We would like to build a community for Small Basic programmers of any age who like to code. Everyone from total beginner to guru is welcome. Click here to register and share your programming journey!


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
AI learns Small Basic
#21
(02-19-2025, 01:08 PM)jrmrhrb00 Wrote: All,

I suggest that all of you try DeepSeek.com...

Hi all.  Shy

I chose ChatGPT for research because Open AI seems to me to be the most reliable team.
I think that the risk of disappearing from the market is higher for other companies.
I'm too lazy to start all over again with another company if the company in which I already store so many settings suddenly disappears.  Blush
[-] The following 1 user Likes AbsoluteBeginner's post:
  • jrmrhrb00
Reply
#22
AB,

That's a good point. I agree that in a few years most of them will be gone.

JR
Reply
#23
https://copilot.microsoft.com/shares/PWP...mjUFnzq65T

https://copilot.microsoft.com/shares/82h...8cpzLiV5as

https://copilot.microsoft.com/shares/BhH...LeDRZtDF1J

copilot is becaming smarter you can try.
ZS
[-] The following 2 users Like z-s's post:
  • AbsoluteBeginner, jrmrhrb00
Reply
#24
Z-S,

I agree in that they are getting smarter. It did a good job of highlighting your extension and it's capabilities.

JR
[-] The following 1 user Likes jrmrhrb00's post:
  • z-s
Reply
#25
Hi all.  Wink

My attempts to make ChatGPT do the job the way I needed led me to decide to write SCRIPTS for it.
Chat is good at performing individual operations, but it can't construct a good process from those operations.

What do you feel about it?  Shy
Reply
#26
Generally I find it helpful to have a look at, but certainly don't rely on it (makes stuff up that can be tedious to debug), try to find the actual source web sites it used.  Can be useful to get ideas, but not usually for detail unless it has found an exact answer to the question, even then it should be checked carefully which usually takes more time than just doing it.

Here's a challenge:  Use it it code the the Breadth-First Search (BFS) maze search algorithm in Small Basic - there are plenty example sources out there in different languages (none in SB).
[-] The following 1 user Likes litdev's post:
  • AbsoluteBeginner
Reply
#27
Here is the code that ChatGPT-4.5 generated for me.
Code:
' Breadth-First Search (BFS) algorithm
' Implementation in Small Basic using the LDText.Split() method

' Graph initialization (example graph represented as an adjacency list)
graph["A"] = "B,C"
graph["B"] = "A,D,E"
graph["C"] = "A,F"
graph["D"] = "B"
graph["E"] = "B,F"
graph["F"] = "C,E"

startNode = "A"

' Preparing the structure for BFS
queue = startNode + ","
visited[startNode] = "True"

TextWindow.WriteLine("BFS traversal order:")

' Main BFS loop
While queue <> ""
  commaPos = Text.GetIndexOf(queue, ",")
  currentNode = Text.GetSubText(queue, 1, commaPos - 1)
  queue = Text.GetSubTextToEnd(queue, commaPos + 1)

  ' Output the current node
  TextWindow.WriteLine(currentNode)

  ' Getting neighbors of the current node using LDText.Split
  neighborArray = LDText.Split(graph[currentNode], ",")
  neighborCount = Array.GetItemCount(neighborArray)

  ' Iterate through neighbors of the current node
  For i = 1 To neighborCount
    neighbor = neighborArray[i]

    ' Check if the neighbor has already been visited
    If visited[neighbor] <> "True" Then
      visited[neighbor] = "True"
      ' Add the neighbor node to the queue
      queue = queue + neighbor + ","
    EndIf
  EndFor
EndWhile
Chat swore that he created the code himself and did not convert it from a sample found on the internet.
I didn't change anything in this code. The compiler found no errors in this code.
I haven't checked the beauty of this code. I have not tested the perfection of the logic. If I have time, I will study this code in more detail.
I'm interested to know your opinion.  Shy
Reply
#28
AB,

This is really pretty good, I am impressed - it works, is commented and is correct.

If I am being pedantic I have the following comments.

1] Use LDQueue rather than a comma list, but the LDText.Split list is a reasonable way.
2] This is a 1D graph, I guess I was interested in navigating a 2D maze (the principle is the same with an exit when the target location is found), finding the fastest route between any 2 points (assuming it has full knowledge of the maze).

I will post my latest maze3D code that uses BFS to find a route from current positionn to random target cell (using knowledge of the maze previously discovered). See https://litdev.uk/mybb/showthread.php?ti...36#pid1936 #116.
[-] The following 1 user Likes litdev's post:
  • AbsoluteBeginner
Reply
#29
Here is a fragment of my conversation with ChatGPT-4.5:
=====

Human:
Today, I want to discuss with you the topic of SYNTAX, which would be as convenient as possible for use in scripts that I could write for you, Ji, describing in detail the sequences of your actions that I need.
Please describe to me what you consider to be the most convenient syntax for these scripts.

-----

Artificial Intelligence:
For the script syntax to be convenient and understandable for both you (as a human) and me (AI), it is important to combine simplicity, unambiguity, and ease of interpretation.

General principles of convenient syntax:
1. Step-by-step structure
- Each line is one clear command.
- Sequential execution from top to bottom.
Example:
Create a variable X
Assign X the value 10
Output the value of X

2. Clear separation of commands and parameters
- Commands are verbs, actions.
- Parameters are nouns, clearly defined.
Example:
Open file "Report.txt"
Write text "Hello World!" to file "Report.txt"
Close file "Report.txt"

3. Use of simple and understandable keywords
- Natural language for commands.
- Clear keywords: Create, Assign, Output, Combine, Compare, Repeat, Finish, etc.
Example:
Create a string variable "message"
Assign the variable "message" the value "Good afternoon, Ji!"
Output "message"

4. Naming variables
- Simple but descriptive variable names.
- Use of underscores if necessary.
Example:
Create a numeric variable "air_temperature"

5. Working with data types
- Explicit indication of data types (string, numeric, logical, array).
Example:
Create a logical variable "rain"
Assign the variable "rain" the value True

6. Use of comments (optional)
- If necessary, use // or # for comments. They help to understand the purpose of each part of the script.
Example:
// Here we set the initial data
Create a numeric variable "counter"
Assign "counter" the value 0

7. Convenient formatting for reading and editing
- Commands on separate lines.
- Use of blank lines between logical command blocks.
Example:
Create a variable "X"
Assign "X" the value 5

Create a variable "Y"
Assign "Y" the value 10

Combine "X" and "Y" into a string "Z"
Output "Z"
---

Final recommendation on syntax:
The most convenient option is a simple, structured, and understandable language based on natural language, similar to human speech, but with clear logic and structure.

Example of a fully convenient script:
// Preparing variables
Create a numeric variable "age"
Assign the variable "age" the value 30

Create a string variable "name"
Assign the variable "name" the value "Eugene"

// Forming a message
Create a string variable "message"
Combine "Hello, " + variable "name" + "! Your age: " + variable "age" and assign the result to "message"

// Output result
Output the value of the variable "message"
---

Why is this option convenient:
It will be easy for you to write and read scripts.
It will be easy for me to interpret, execute, and also find and correct errors.
=====

Damn it, if THIS isn't Mind, then WHAT is it?  Huh
Reply
#30
It does seem like a mind, but...

What it actually is is a very big trained neural net, that takes input text (for a LLM) and is trained to output what it has been trained is the most likely next word, and it does this word by word!

GPT-3 has 175 billion parameters in its neural net, and was trained on the entire www at the time - that is every book, technical paper, bit of softawre code, blog, image, everything with no regard for privacy, accuracy etc.  This takes enormous computing power and is hideously expensive in hardware and power - each GPU costs $50,000 and there are hundres of thousands of them doing this training.  GPT-4 and successors are orders of magnitude bigger.

The actual neural net code is very simple node by node, much the same as the ANN in SB, but the amount of data and training required is astonomical.  The real value is the data required and that is why Google, Apple, Meta et al want everything they can about everything and especially us individually.

A human brain neuron is also relatively simple individually, but with billions of them and their connections consciousness and intelligence emerges.  I don't think we are anywhere near that with generative AI, but that is philosophical.  Remember it is just an enormous neural net trained to output what it thinks is most likely to come next.  It will always sound totally authorative and will be right a lot of the time - when it is pushed into areas it hasn't been trained on it will make stuff up very convincingly.
[-] The following 1 user Likes litdev's post:
  • AbsoluteBeginner
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)