← All news Releases

BASIC-256 v2.3.0 released

2.3.0 adds SORT, a real character screen for text, HSV colours and 3D noise, and asks before a program touches files outside its folder.

BASIC-256 v2.3.0 is out. 2.2.0 started adding to the language; 2.3.0 carries on with a sort built in, a proper character screen for text, colour by hue and a few long-standing loose ends tied up — and it also changes how a program reaches outside its own folder, which is why it is 2.3 rather than 2.2.1.

Most programs keep working unchanged, but this release has more to watch for when upgrading than the last one did, so read the list at the end before moving a classroom over. Builds are available for Windows, macOS (Apple Silicon and Intel), Linux and the Raspberry Pi, and BASIC-256 also runs in a browser tab with nothing to install.

What 2.3.0 brings

  • A program asks before it touches files outside its own folder. Anything at or below the folder a program was loaded from is read and written without a word, which is what nearly every program does. Naming anything outside it — with OPEN, KILL, MKDIR, IMGSAVE, DBOPEN, a path inside SQL or any other statement — brings up a dialog that names the file and offers Don’t allow, Allow once and Allow for this run. It asks when a file is opened rather than at every WRITE, and a file picked in a file dialog never asks at all. Preferences ▸ Advanced has a standing answer for anyone who wants it. The browser version is unchanged, the browser sandboxing its files already.
  • The Text Output window can be a screen as well as a scroll. LOCATE column, row puts the cursor anywhere, and what is printed there replaces the characters it lands on, so a score, a clock or a counter can be rewritten in place. TEXTCOLOR and TEXTBACKGROUND bring back the white on dark green of an old console, TEXTFONT picks the font, and TEXTCOL and TEXTROW read the position back.
  • A real character screen, with the new TEXTSCREEN statement. TEXTSCREEN 40, 25 turns the window into a fixed grid of characters, the kind the home computers of the eighties printed on: a column really is a column whatever the font, so boxes close up and figures line up, and the screen grows and shrinks with the window. A third argument asks for square cells for boards and pictures, and TEXTCHAR(column, row) reads a character back off the screen — the same idea as the old SCREEN$.
  • Arrays can be sorted, with the new SORT statement. sort names puts a list in order, and ascending, descending and ignorecase may follow it in any order. A two-dimensional array has its rows sorted on the column given — sort scores, 1, descending — each row moving as a whole. The sort is stable, so sorting on a second key and then on the first gives a two-key order.
  • Colour by hue, with the new HSV function. hsv(hue, saturation, value) is the sibling of RGB: the hue in degrees round the colour wheel and the other two in percent, with an optional alpha. Counting the hue from 0 to 360 walks through the whole rainbow with a single number.
  • NOISE takes a third coordinate. noise(x, y, z) reads a three-dimensional field, so a program can draw with x and y and move through z as time — clouds, water or fire that change smoothly instead of standing still.
  • Text on sprites, with SPRITETEXT. spritetext n, text$ makes a sprite from the text in the current font and colour, and a third argument fills it with a background colour first, for a label that can be read over anything behind it.
  • A benchmark you can run yourself. TestSuite/Benchmark times each part of the language — loops, arithmetic, arrays, sorting, the MAT statements, strings, maps, files, databases, graphics and text output — and prints one table at the end, so you can measure the speed on your own machine, or compare two machines or two versions, rather than guess at it.

Also in this release

  • SPRITEW and SPRITEH now report the size a sprite covers on the screen, following the scale and rotation it was given, so an edge test keeps a scaled or turned sprite inside the window.
  • IMGLOAD, GETSLICE and PUTSLICE now understand WINDOW coordinates, the way PLOT and PIXEL do.
  • A statement with no arguments followed straight away by a colon — next: print i, cls: print "ready" — is now that statement, instead of being read as a label and skipped.
  • DBOPEN now works in the Raspberry Pi downloads, which were missing the SQLite driver, and the Pi archive now includes the TestSuite and the benchmark like the other platforms.
  • A new example, Examples/DataBase/GamesDB.kbs, brings SQLite and the text screen together: a small games database with a menu drawn with TEXTSCREEN, LOCATE and TEXTCOLOR. It is not in the browser version, which has no database support.
  • The website now has a Gallery, where the example programs can be run straight away in a pop-up browser window.

Things to watch when upgrading

  • A program that reads or writes outside its own folder will now ask first, and a program started with --silent is refused rather than asked. Keep a program’s files beside it, or set the standing answer in Preferences ▸ Advanced.
  • NETLISTEN now listens only on the machine it is running on. For two machines talking to each other — the classroom case — tick NETLISTEN accepts connections from other machines in Preferences ▸ Advanced.
  • MKDIR works again without SYSTEM being switched on, but RMDIR has been removed for good, and a program that uses it no longer runs.
  • A parameter declared with ref() now receives the caller’s own variable, as the documentation has always said, so call fill(a) changes a. A program that relied on its variable staying unchanged will now see it change.
  • sort, ascending, descending, ignorecase and hsv are now reserved words, so a program that used one of them as the name of a variable or a function has to rename it.

The ChangeLog has the full list, and the release notes summarise every version so far.

Pick your platform and download it, or try it in your browser first.