bwBASIC 2.50Version of implementation Bywater BASIC of programming language Basic
The last version of Bywater BASIC, released in 1997.
PRINT "Hello, World!"
Factorials are calculated iteratively. Note the type inference: data type for storing factorial values is not declared explicitly, and yet the larger values are calculated without an overflow error.
f = 1 FOR i = 0 TO 16 PRINT i; "! ="; f f = f * (i + 1) NEXT i
This example shows iterative calculation of Fibonacci numbers and storing them in an array. Note the explicit array declaration and the string variable
S$ — string variables names must end with a
DIM F(16) F(1) = 1 F(2) = 1 FOR i = 3 TO 16 F(i) = F(i - 1) + F(i - 2) NEXT i S$ = "" FOR i = 1 TO 16 S$ = S$ + STR$(F(i)) + "," NEXT i S$ = S$ + " ..." PRINT S$