Sunday, August 31, 2008

Quite BASIC Video Introduction

Wednesday, June 11, 2008

Compatibility Step 7

Another step towards running "Hunt the Wumpus" on Quite BASIC! :)

Today I added conditional GOTO to the language. I did it with mixed feelings because it is one ugly construct, but many early BASIC programs did use it.

So, now you can do things like:
10 LET R = 1 + RND(3)
20 ON R GOTO 100,200,300
...

That little code snippet will randomly make the program go to either line 100, 200, or 300.

Oh, and I also added the INT(x) function. It is the same as the existing FLOOR(x), but INT(x) is the name that classic BASIC programs used.

Sunday, June 01, 2008

Compatibility Step 6 -- Multi dimensional Arrays

This one was not straight forward because javascript doesn't have a simple syntactic construct to create a multi dimensional arrays. As of today though, QuiteBASIC has just that. For example:

10 DIM A(5,6,4)

declares a 3D array.

The array can then be used in LET commands and in expressions just like you expect it to. For example:

20 LET A(1,2,3) = 64
30 PRINT SQR(A(1,2,3))

will print 8.

This only works with the DIM command. The ARRAY command just declares a 1D array of dynamic size. And this only works with the parenthesis syntax for array indices. So A[1,2,3] is a syntax error.

I also added the TAB(x) function which is typically used in PRINT commands to format the output. For example:

40 PRINT TAB(5); "Hello!"

will print five spaces followed by "Hello!".

Sunday, May 11, 2008

Compatibility Step 5

One tricky difference between QuiteBASIC and the real old classic BASIC dialects were that QuiteBASIC were only allowing brackets to enclose array indices, like so: A[5].

As of today, QuiteBASIC will also allow parentheses like this: A(5).

This was one of the big remaining incompatibilities. The few most important remaining issues are multidimensional arrays and the (ugly) "ON" command.

I keep track of incompatibilities on this page in the club house.

Sunday, February 10, 2008

Compatibility Step 4

Another step towards compatibility with "real" classic BASIC: as of today, the colon terminator works in Quite BASIC! So now you can do things like:
10 LET A = 17 : LET B = 4711
Myeah, I know... Pretty "basic" stuff, but still.

Friday, February 08, 2008

Cool use of a Quite BASIC gadget

Lewis Palmer on his site about "Volcanos in the making" has written some pretty cool Quite BASIC programs to create animations. The Quite BASIC programs are published on his site as Google Gadgets.

Update: The pages are no longer online. It was fun as long as it lasted though.

Check it out at:
http://scienceperiod2.spruz.com/
Each of the three sections: Subduction zones, Divergent Boundaries, and Hot Spots have an animation powered by a Quite BASIC gadget.

Monday, February 04, 2008

Compatibility Step 3

Good news!
DATA/READ is now part of the Quite BASIC language.

The bad news is that I identified a few more incompatibilities with classic BASIC.
  • Array indices; Quite BASIC uses [] but classic BASIC uses ().
  • The DEF keyword. Quite BASIC does not support this.
I am tracking all this loosely in a doc at the club house.