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!


Welcome, Guest
You have to register before you can post on our site.

Username
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 847
» Latest member: Jamesbruri
» Forum threads: 224
» Forum posts: 2,286

Full Statistics

Online Users
There are currently 72 online users.
» 0 Member(s) | 70 Guest(s)
Applebot, Bing

Latest Threads
Example Program
Forum: Extensions
Last Post: martmen
03-13-2026, 04:15 PM
» Replies: 0
» Views: 31
BASIC Jam 7 is in progres...
Forum: Discussion
Last Post: eddylo
03-11-2026, 12:40 AM
» Replies: 3
» Views: 117
LitDev extension
Forum: Extensions
Last Post: martmen
02-24-2026, 07:20 AM
» Replies: 2
» Views: 168
Button with icons
Forum: Extensions
Last Post: martmen
02-09-2026, 06:33 PM
» Replies: 6
» Views: 290
How to think correctly?
Forum: Discussion
Last Post: litdev
02-06-2026, 04:20 PM
» Replies: 47
» Views: 17,227
Draw sample
Forum: Extensions
Last Post: martmen
01-29-2026, 06:51 PM
» Replies: 13
» Views: 662
Drawing
Forum: Extensions
Last Post: AbsoluteBeginner
01-29-2026, 10:53 AM
» Replies: 1
» Views: 180
ZScript
Forum: Discussion
Last Post: z-s
01-22-2026, 03:31 AM
» Replies: 0
» Views: 140
I think that no more Smal...
Forum: Discussion
Last Post: eddylo
01-20-2026, 11:02 PM
» Replies: 0
» Views: 118
Small Basic Coder-A New G...
Forum: Discussion
Last Post: AbsoluteBeginner
01-17-2026, 07:57 PM
» Replies: 1
» Views: 512

 
  SB Forms extension
Posted by: litdev - 06-08-2024, 10:13 AM - Forum: Extensions - Replies (1)

Looking through some of the old SB forum files I came accross one using Gungan's SB Forms extension, ZQX928.  I added this extension to Extension Manager in SB-Prime.

If you come across any other fun extensions from the past and they exist in some form I can try to add them.

Print this item

Exclamation Historical backlog of SB programs
Posted by: litdev - 06-05-2024, 12:31 PM - Forum: Discussion - Replies (5)

Split from https://litdev.uk/mybb/showthread.php?tid=75&page=2

WhTurner,

Do you have an archive of all uploaded SB programs - did you systematically scrape them or have some other way to access them?

Just curious - I do remember someone in the past on the old forum doing something like this.

Print this item

  Disconnect the Client from the Server
Posted by: AbsoluteBeginner - 05-31-2024, 10:21 AM - Forum: Extensions - Replies (7)

(translated by Google translator)

Hi all.
I don't know if I chose the right topic for my question.  Angel

Now, if I want to correctly disconnect the Client from the Server, then I can use the "LDGraphicsWindow.Closing" handler for the Graphics Window, but I do not see such a handler for the Text Window.

My question is: is this handler not needed when using the Text Window, or is such a handler just not yet created in the LD extension?

Thank you.

Print this item

  SB-Prime hotkeys
Posted by: AbsoluteBeginner - 05-30-2024, 08:27 AM - Forum: Discussion - Replies (5)

(translated by Google translator)

Hi all.  Smile
Please tell me, can I find a list of "hot keys" for SB-Prime somewhere?
I tested different combinations at random, but found no combinations for turning bookmarks on/off for a line of code and for moving through existing bookmarks.

Thank you.

Print this item

  DataView Font
Posted by: Lester - 05-25-2024, 07:15 PM - Forum: Extensions - Replies (2)

Is it possible to change the font Size in the DataView display?  Thank you

Print this item

  UCI Chess Engine
Posted by: Scout - 05-22-2024, 09:44 PM - Forum: Challenges - Replies (17)

After finding out how to access the UCI interface with the help of an introductory video, it is now possible to write a chess engine with Small Basic that can be integrated into chess programs.
The C# videos and further information can be found in the following thread: https://litdev.uk/mybb/showthread.php?tid=74

But there is still a long way to go to the first usable engine.
The 4 episodes of the C# video tutorial must be implemented in Small Basic and in C# programs.


Episode 1: Hello World

Code:
'Position Textwindow
TextWindow.Left = Desktop.Width/2+1
TextWindow.Top    = Desktop.Height/2+200
'Movelist for black
Move[1] = "bestmove e7e5"
Move[2] = "bestmove a7a6"
Move[3] = "bestmove b7b5"
Move[4] = "bestmove g8f6"
Move[5] = "bestmove g7g6"
Move[6] = "bestmove h7h5"
Move[7] = "bestmove f8g7"
Move[8] = "bestmove b8c6"
Movecount = 1
'LDTextWindow.Hide()
LDTextWindow.UpdateShowHide = "False"
LDTextWindow.Minimise()
While ("True")
  'TextWindow.PauseIfVisible()
  commandline = TextWindow.Read()
  command = LDText.Split(commandline," ")
  if(command[1] = "uci") Then
    TextWindow.WriteLine("uciok")
  ElseIf(command[1] = "isready") Then
    TextWindow.WriteLine("readyok")
  ElseIf(command[1] = "position") Then
    'Board Update
  elseif(command[1] = "go") Then
    'TextWindow.WriteLine("bestmove e7e5")
    TextWindow.WriteLine(Move[Movecount])
    Movecount = Movecount + 1
  Else
    TextWindow.WriteLine("info string "+ commandline)
  endif
  Program.Delay(7)  
EndWhile

Integrating the exe file as an engine into a chess program is described in the C# thread and in the videos.

   

What is also annoying is that the text window cannot be hidden and it has no content.
But since it can be moved to the side, it is still acceptable.

Update: 
With the features LDTextWindow.UpdateShowHide = "False" and LDTextWindow.Minimise() the text window can be minimized to the taskbar.
This requires the Litdev extension 1.2.28.0 or higher. Alternatively, the two lines can be commented out and the text window will appear on the screen.

Note:
If the SB_UCI.exe engine is distributed or copied to another directory, the DLLs Litdev.dll and SmallBasicLibrary.dll must also be included!

Print this item

  Helpful YouTube videos (UCI-Interface for Chess-Engines)
Posted by: Scout - 05-22-2024, 08:36 PM - Forum: C# Moving from Small Basic - Replies (2)

The discussion of the AI championship with a playing field and separate engines reminded me of the chess engine championships of the last few decades. The ranking is determined from countless games that the engines play against each other. This is done automatically via defined interfaces (e.g. UCI interface).
My attempts to access this interface with Small Basic failed because I didn't know how Small Basic used the stdio interface.
So I looked for a C# chess engine that was as simple as possible and then wrote a Small Basic program using the source code that could at least access the UCI interface.
Searching on github I found the following video series that shows how an unknown interface can be accessed and operated using debug outputs.

https://www.youtube.com/playlist?list=PL6vJSkTaZuBtTokp8-gnTsP39GCaRS3du

The video series consists of four episodes, of which I have completed the first one and the others will probably take some time.

Definition UCI Interface: https://en.wikipedia.org/wiki/Universal_Chess_Interface

Chess program that can communicate with chess engines: https://cutechess.com/


Episode 1 : Hello World

The program CS_UCI was written in Visual Studio 2017.
It is a console application with the target framework .NET 4.5.2

Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CS_UCI
{
    class Program
    {
  
        static void Main(string[] args)
        {
            string[] Move = { "e7e5", "a7a6", "d7d6", "b7b5", "g8f6", "g7g6", "h7h5", "f8g7", "b8c6" };
            int Movecount = 0;
               
            while (true)
            {
                //remove leading & trailing whitecases and split using ' ' as delimiter
                string[] tokens = Console.ReadLine().Trim().Split(' ');
                //string   command = Console.ReadLine().Split(' ')[0];
                switch (tokens [0])
                {
                    case "uci":
                        Console.WriteLine("uciok");
                        break;
                    case "isready":
                        Console.WriteLine("readyok");
                        break;
                    case "go":
                        Console.WriteLine("bestmove "+ Move[Movecount]);
                        // Console.WriteLine(Move[Movecount]);
                        Movecount = Movecount + 1;
                        if (Move.Length <= Movecount)
                            { Movecount = Movecount - 1 ; }
                        break;
                    case "position":
                        // Board;
                        break;
                    default:
                        Console.WriteLine("info " +  tokens[0].ToString());
                        break;
                }
            }
        }
    }
}
After starting Cute Chess, the exe file must be defined as the engine via Settings.

Using New, you can choose any engine for white (stockfish, Dragon, etc.) or you can play yourself.

CS_UCI can now be selected for black.

The dummy moves provided for black should be enough for a few moves.
   
The corresponding Small Basic program is in Thread: https://litdev.uk/mybb/showthread.php?tid=75

Print this item

  Debugging with dnSpy
Posted by: litdev - 05-20-2024, 02:46 PM - Forum: C# Moving from Small Basic - No Replies

I have been playing with dnSpy and find it very useful for debugging Small Basic programs.  You can get it from https://github.com/dnSpy/dnSpy/releases - (download dnSpy-net-win64.zip, unblock, extract from zip and run dnSpy.exe, then File->Open... a compiled Small Basic exe and get a professional debugging experience!)

It allows me to debug into SmallBasicLibrary.dll as well as extensions like LitDev.dll.  This is very useful for me to test things, but maybe also for Small Basic users to see how things are done in extension code.

Print this item

  Tron game
Posted by: litdev - 05-17-2024, 04:12 PM - Forum: Extensions - Replies (2)

Multi-player game I wrote and play with my daughter.  Most the fun is creating new levels (currently 19 that come up randomly) - NQDW702.000

Print this item

  Rotate LDPolygon
Posted by: AbsoluteBeginner - 05-15-2024, 08:17 AM - Forum: Extensions - Replies (7)

(translated by Google translator)

Hi all.
Please tell me, does anyone know of any problems using the rotate "Shapes.Rotate()" function?
I have uncontrolled displacement of the "LD Polygon" shape when I rotate it.
This displacement does not always occur. And the displacement can be different.  Huh

Thank you.

Print this item