Welcome, Guest |
You have to register before you can post on our site.
|
Online Users |
There are currently 27 online users. » 0 Member(s) | 25 Guest(s) Google, Bing
|
Latest Threads |
LDArray extension
Forum: Extensions
Last Post: AbsoluteBeginner
3 hours ago
» Replies: 17
» Views: 165
|
AI learns Small Basic
Forum: Discussion
Last Post: jrmrhrb00
Yesterday, 12:14 AM
» Replies: 6
» Views: 133
|
Challenge 9 - Quick sort
Forum: Challenges
Last Post: AbsoluteBeginner
11-18-2024, 03:52 PM
» Replies: 47
» Views: 956
|
How to exit a subroutine ...
Forum: Standard Small Basic
Last Post: litdev
11-11-2024, 12:59 PM
» Replies: 2
» Views: 82
|
Training program for SB-N...
Forum: Discussion
Last Post: AbsoluteBeginner
11-08-2024, 07:02 AM
» Replies: 13
» Views: 333
|
SmallBasic Open Edition
Forum: C# Moving from Small Basic
Last Post: KristianVirtanen
11-05-2024, 06:37 PM
» Replies: 21
» Views: 660
|
UCI Chess Engine
Forum: Challenges
Last Post: Scout
10-30-2024, 10:41 PM
» Replies: 17
» Views: 1,746
|
Welcome
Forum: Standard Small Basic
Last Post: AbsoluteBeginner
10-30-2024, 10:01 PM
» Replies: 11
» Views: 1,670
|
Skull Custom Language Cre...
Forum: Discussion
Last Post: z-s
10-28-2024, 04:49 PM
» Replies: 87
» Views: 10,713
|
SB-Prime Plugins
Forum: Extensions
Last Post: litdev
10-25-2024, 07:52 AM
» Replies: 1
» Views: 73
|
|
|
LDArray extension |
Posted by: Yumda - 11-17-2024, 10:05 PM - Forum: Extensions
- Replies (17)
|
|
Hi All...
This may seem like a dumb question... but
Having trouble understanding how to use the LDarray extension. There is no examples, do you think you can give me some example?
I am having trouble to even create one using the ldarray extension, normal Sb array is fine, but just don't seem to get ldarray to work.
Thanks you all for helping and your time in advance.
Regards
|
|
|
Challenge 9 - Quick sort |
Posted by: litdev - 10-28-2024, 08:41 AM - Forum: Challenges
- Replies (47)
|
|
Implement quicksort algorithm and sort 1000 random numbers.
Interesting to see if it's easier the usual way understanding the algorithm and writing the code or getting AI to do it for you?
|
|
|
Challenge 8 - Drag n Drop |
Posted by: litdev - 10-20-2024, 12:19 PM - Forum: Challenges
- Replies (7)
|
|
Make a Drag and Drop feature using the Mouse buttons to position a GraphicsWindow shape (Rectangle).
Extend it to rotate the shape when Shift key is down.
|
|
|
SmallBasic Open Edition |
Posted by: KristianVirtanen - 10-13-2024, 04:41 PM - Forum: C# Moving from Small Basic
- Replies (21)
|
|
Hi,
This project (SmallBasic Open Edition) is part of a larger whole, where the goal is to recreate Microsoft SmallBasic, at least in its main features.
The first phase of the project, which is exactly this, is to create the same classes as in SmallBasic: Text, Math, GraphicsWindow, and so on. The project is mostly complete, although types for variables, some small tests, and so on are still required.
Note: The classes Array, Flickr, and Dictionary have not been created.
Array is missing because I have not yet decided on the final way the future compiler will handle arrays. I have a couple of different solutions for this, but I haven’t had time to decide yet.
Flickr is missing because I am simply not very familiar with this service, and their API is completely unknown to me.
Dictionary is a class I’m not sure if I want to spend time on, at least not personally.
Unlike the original SmallBasic, Open Edition converts SmallBasic code into the C# programming language and compiles it afterward. This brings significant advantages in terms of memory management, speed, and extensibility.
Variables will function mostly the same way as in the original SmallBasic. This is made possible by C#’s dynamic. However, the idea is that variables will require a suffix of "$" at the end of their names. Not only does this make the programs easier to compile, but I also believe it helps distinguish variables and makes coding a bit easier.
The program that tokenizes and converts SmallBasic code into C# is also mostly done. However, at the moment, it's more like a pile of sticks rather than a well-designed and structured program, so its release will be more appropriate at a later time.
Example SmallBasic program:
Code: ' Example Smallbasic program
x$ = 1
y$ = 2
c$ = "Foo"
TextWindow.WriteLine(x$ + y$ + c$)
SayHello()
Goto MyLabel:
TextWindow.WriteLine("I'm never printed.")
MyLabel:
Program.End()
Sub SayHello
TextWindow.WriteLine("Hello")
EndSub
Converted to C#:
Code: // Converted as C#
namespace SmallBasicOpenEditionDll
{
public static class SB_Program
{
// Declare dynamic variables (similar to Smallbasic's dynamic typing)
public static dynamic x = 1;
public static dynamic y = 2;
public static dynamic c = "Foo";
// Entry point of the program
public static void Main()
{
// Equivalent of TextWindow.WriteLine(x$ + y$ + c$)
TextWindow.WriteLine(x + y + c);
// Call the method SayHello()
SayHello();
// This line will not be executed
Goto MyLabel:
TextWindow.WriteLine("I'm never printed.");
MyLabel:
Program.End();
}
// The equivalent of SmallBasic's subroutine 'SayHello'
public static void SayHello()
{
TextWindow.WriteLine("Hello");
}
}
}
Note: I work with this while I am working with two job's and such, so this will not move forward in fast speed. Help is appreciated here. Let me know
|
|
|
|