SmallBASIC version 0.12.10 has been released


For details see:

The main changes are:
- Performance enhancements
- Minor language and UI tweaks

The windows zip includes some new samples:
- "Voxel space" renderer

- 2048.bas

- Klotski solver (unfortunately only currently works under the linux build)

- Selection of super awesome stuff from MGA !

Please let me know if you find any issues.

Thanks Chris,

Hey an early Christmas present!

Is there a voxel sample included or test code? It looks very technical.

Well, I will read over new update details...

Merry Christmas!

I just started checking out new SB 12.10, hey there's a SmallBASIC 64 version!

Oh! and there IS a voxel sample in the samples, and wow! look at that landscape and (panning right... )
(Obviously I am NOT the world's best reader, as I see now Chris has already mentioned a voxel sample, dah!)

What is that! (Pan in.... )

Is that an Ancient Alien Pyramid!!!

Screen shot here:

Chris you are full of surprises! ;-))

This is only the first 2 things I find and I had to stop and comment here. Really cool!

Append: Oh I see, the image WAS A pyramid see \resources C1W.png
(I am grinning from ear to ear!)


Glad you like the update!

The voxel code is completely based on this:

SB version 0.12.10 has various minor fixes and performance updates that make running this possible. I just translated their javascript implementation almost directly.

Re performance, it you compare the run time of the maze sample with the previous version you should see a large improvement.


Hi Chris,

Have you checked sound with Bowling7.bas? For me, it works for older version but neither of 0.12.10 versions are working ???

Also I have noticed timing is different for mouse clicks, it seems the mouse is harder to catch. Maybe I will need to wait after a mouse button = 1 for the release.

Thanks for the update. The audio issue was caused by updating to the latest SDL version (2.0.7). I tried 2.0.5 and the sound returned. I suspect your mouse issue was the same cause. Could you please provide a simple test program to demo the timing issue?
Also, I had a play with the img2ascii program and found a subtle problem with the command, so would be good to make another very minor update. I managed to make the program work, I'll share the code later.

I noticed the mouse issue most clearly with the (City) Maps sample, the one with silver buttons. When I clicked a button either it would not respond or it would respond as if I clicked it several times. In the previous version SB 12.9, I had similar problem of "over clicking" and added a delay after click detected. Of course, someone might have changed code a little for samples (or maybe it's my memory), so might be that, that's different? I imagine this is going to work or NOT work very differently on different systems ie speeds of checking for mouse events. That's why I was talking about waiting for mouse button release before acting on click. And that means keeping the mouseX and mouseY updated until release.

(Oh I just remembered, the aiming line for bowling also was working sporadically ie no line as move mouse around after the ball is anchored behind the foul line. A black line should move around with the mouse until it is clicked to set ball in motion down the line drawn. That was 100% OK in previous SB version. Without that black line, it will be very hard to intuitively figure out you are aiming the ball and will probably have to click it to set ball in motion. I can't see someone new to samples being able to get all that without black line. I think it mandatory that samples require no instructions sort of like Jobs with Apple.)

I will play with City and see if I can root out problem/solution more clearly.

Steve at might also be working on an ascii conversion and I will after Sliding Block Game Solver so would be fun to compare notes. Oh speaking of Image problems, is there a way to draw on top of an image? I have been forced to make image half transparent, as I recall, to see any drawing after image is on screen.

Speaking of Sliding Blocks Puzzle (in sample), to me, the mouse version is way more easy and fun to use and it matches what Rosetta Code calls left, right, up, down moves (imagine moving the empty space left, right, up, down. I originally wrote it as sliding the block on left of hole to right for a move "to right" but this effectively moves the empty space left. Very confusing switching between these 2 perspectives, the solution and most intuitive and natural for one who has actually played with the real toy, is use a mouse to click the block to move into the empty space. The game written in samples to make moves with letter keys, was just a novelty challenge to see how few lines the game might be written. The SB mouse version was way more fun to play and what I used to model QB64 code version that we ultimately submitted to Rosetta Code to represent QB64.

BTW Chris, care to get SmallBASIC represented at Rosetta Code?

I've made a very minor update:

This has the following changes:
Build with SDL2-2.0.5 to avoid issues with audio using SDL2-2.0.7
Fix issue with image save() command to ensure resulting array has correct dimensions
Fix issue with display driver escape ESCm (reset scroll position)

I encountered the audio problem, but couldn't see any difference with mouse handling. Could you please let me know if this works okay on your machine?

By Rosetta Code, you mean this right?

There's lots of BASICs in there but no SmallBASIC - we should fix that !

Btw, I included my version of img2ascii.bas in the examples. It would be interesting to change this to use sections of another image (or other images) as the character set.

Hi Chris,

Sorry, my mouse issue with (City) Maps was remembering how it worked. There is big delay when click button when focus is 1 or even 2 (on my system) as there is allot more to process between SHOWPAGEs in main the loop so there is no time to pickup a click event until it finishes (could be improved with a check in the loop). The bottom 2 buttons incremented and decremented by 5s and when you hit 3 it stops... the changes by 5 were messing with my mind, I was expecting changes by 1 with each click.

All this proves, (City) Maps is not intuitive enough for making a great sample but the over clicking problem was improved by waiting until mouse button was released after a mouse button detected eg

pen(3) then 'sometimes loops are so fast you could detect the same mouse button pen(3) click as the last one!
while pen(3) 'wait for mousebutton to be released
mx = pen(4) : my = pen(5)
'now mx, my are last known locations of mouse click process those coordinates


Now what the problem was with bowling (I think it is about detecting mouse while it moves around to update the line drawn.), I ve yet to get to because we are having a fireworks challenge at QB64 by New Years s and it has gotten interesting!

Yes, that is Rosetta Code (RC) though I ve not seen that page before. SmallBASIC has to be registered and I would seek your comments, Chris, for any RC submission so that SmallBASIC is represented by it s best tools and best code using them. I have learned allot about whatever dialect BASIC I am using with these challenges.

I will check out update, and oh! the ascii things too! that was quick! after I get a new fireworks algo off my mind ;-))

PS I got new laptop, will start it with SmallBASIC 12.11

Hi Chris,

RE: Bowling app and mouse "problem"

Dang! I even had instructions in the bowling program to " Click around the pins to set ball angle."

Yeah, when the mouse IS around the pins, the aim line shows up! dah, sorry... (embarassed)

Mystery solved, I just don't remember how my own code is supposed to work!

Append: Oh hey, I got a new laptop for Christmas and Swirl2.bas goes so fast I have to add a delay AND increments of 5 in delay are meaningful!
Now on to the new things... :)

Ah cool, so it's just a sound issue with the updated SDL version.

Speaking of "embarrassed", I made a mistake with the recherche program which originated via an email from Regis Roumiguieres. His google translated English is a bit sketchy but the jist of it seems to be he wasn't happy to share the program, so I've removed it from the zip download. "Vous vivez, vous apprenez"

Oh! I had shared that program at TJP because Aurel had admired it there but spelling was off...

I will remove from there the code.

I am trying to download version 0.12.11 to my old computer (that had 0.12.10 with no sound) and there is a 5 secs count down from Source Forge then a pause and a small pop-up in upper right corner usually tells me the download is complete, but now it is telling me (several times now), the download was interrupted: virus detected.

??? did something change between yesterday (when I downloaded it to my new computer) and today (Saturday 12-30)

??? OK a 2nd download from new laptop also worked fine! (done about 4.5 hours later on Saturday).

I tried a fresh download and compared with the files I uploaded. The size, date and md5sums all match.

29a00925803c9d76de245a922273d64c sbasicg64.exe
9ec0c81f98ed788bc64ce7cc7924155b sbasicg.exe
3034643cf824e99bdc9b92f26e3480ca sbasicw.exe

510464 Dec 28 21:17 sbasicw.exe
2177024 Dec 28 21:17 sbasicg.exe
2413568 Dec 28 21:17 sbasicg64.exe

Was the popup a sourceforge screen or from the virus checker on your machine?

The virus checker that is doing the rejection must be in my old laptop.

Last night I had tried again on old laptop with a different browser (MS Edge) and got same result only it was reported with slightly different wording in a completely different location of the browser screen.

I also had another successful download on my new laptop, I had Bowling 7 tested for sound within a minute of download from this forum through Source Forge. I ended up copying the files downloaded on new laptop to old and had bowling7.bas also working with sound from the sample files on the old laptop.

I reported all this last night but must have forgotten to save after forced Preview without direct save option on this forum.

I've just uploaded version 0.12.12 for Windows and Linux. This has a couple of changes:

- Fix issue with creating 6D arrays. You can do this again:
print m[1,2,3,4,5,6])

- Increased default stack size