|nuBASIC is an implementation programming language distributed under GPLv2 License.
nuBASIC has been designed mainly for educational purposes both for C++ developers that can deal with a non-trivial example of C++11 programming and for users, that may get hooked on programming. It is suitable for simple games, educational or small business programs.
As the name suggests, nuBASIC is a programming language from the BASIC family.
Anyone who has previously worked with other BASIC languages will quickly become accustomed to nuBASIC.
Large sections of the basic constructs of nuBASIC are compatible with other BASIC dialects.
nuBASIC is also very simple. It is an excellent tool for teaching programming to a complete beginner, despite this, it has all the features of a modern programming language.
It allows you to write both classic BASIC programs (which use line numbers and GoTo or GoSub control structures) and procedure oriented programs, based on procedural programming paradigm.
- Free and Open Source (distributed under GPLv2 License)
- Easy to use and simple enough for 8-year-old-child to understand
- Fully-developed procedural programming language
- Multiplatform. Runs on 32-bit and 64-bit Linux/Windows x86/amd64
- Built-in help
- Documented (English and Italian Guides)
- IDE for Windows
- Examples include Tetris, Mine Hunter, Breakout, Calculator, TicTacToe
- Tiny version is suitable for embedded systems
nuBASIC source has been written in C++11 and compiles under several operating systems including Windows and Linux.
To compile nuBASIC you may create a Visual Studio 2013 console application or build it by using GCC >= 4.8.1 (both VS project files and autoconf/automake source files have been provided) or using MinGW >= 4.8.1.
Use of nuBASIC
nuBASIC can be used by any user without any additional programs.
It has the components needed to create programs, including:
The nuBASIC programming language can be divided into two components:
- The language of nuBASIC, which defines the elementary linguistic constructs, for example, for variable declarations and loops.
- The built-in function library which provides standard functions for example, functions for modifying numbers and strings, and files.
Unstructured vs Structured BASIC paradigms
nuBASIC allows you to write both classic BASIC programs, which use line numbers and GoTo or GoSub control structures, and procedure oriented programs, based on structured and procedural programming paradigm.
The following two implementations of Rosetta Code example (the Rosetta stone of Fractal geometry is the Mandelbrot set) run correctly on nuBASIC interpreter:
5 Rem Rosetta.bas
10 For x0 = -2 To 2 Step .01
20 For y0 = -1.5 To 1.5 Step .01
30 x = 0
40 y = 0
50 iteration = 0
60 maxIteration = 223
70 xtemp = x*x-y*y+x0
80 y = 2*x*y+y0
90 x = xtemp
100 iteration = iteration + 1
110 If ((x*x+y*y<=4) And (iteration < maxIteration)) Then GoTo 70
120 If iteration <> maxIteration Then c = iteration Else c = 0
130 d%=150: dx%=300 : dy%=300
140 FillRect x0*d%+dx%,y0*d%+dy%,x0*d%+dx%+2,y0*d%+dy%+2,int(c)*16
150 Next y0
160 Next x0
For x0 = -2 To 2 Step .01
For y0 = -1.5 To 1.5 Step .01
x = 0
y = 0
iteration = 0
maxIteration = 223
While ((x*x+y*y<=4) And (iteration < maxIteration))
xtemp = x*x-y*y+x0
y = 2*x*y+y0
x = xtemp
iteration = iteration + 1
If iteration <> maxIteration Then
c = iteration
c = 0