Saturday, October 29, 2022

🆕 _R2D

Late follow-up to September 28th's "🆕 _D2R".

The _R2D function converts a radian value into a degree value.



Wednesday, October 26, 2022

❇ FOR NEXT: multiple controlVariables.

BAM supports (with nested FOR loops) multiple controlVariables in one NEXT statement for all of the FOR statements.

So now, we are not limited to:

for i = 1 to 2

    for j = 1 to 21 step 20

        locate i, j

        print "hello world!"

    next j

next i

We can instead do this:

for i = 1 to 2

    for j = 1 to 21 step 20

        locate i, j

        print "hello world!"

next j, i


Although it is not necessary to specify controlVariables with the NEXT statement, be aware that each FOR statement then requires a dedicated NEXT.  For example:

for i = 1 to 2

    for j = 1 to 21 step 20

        locate i, j

        print "hello world!"

    next

next

OR:

for i = 1 to 2

    for j = 1 to 21 step 20

        locate i, j

        print "hello world!"

next : next

Personally, I prefer the approach in the first example.  A little bit verbose but very clear.

Tuesday, October 25, 2022

Monday, October 24, 2022

🆕 Logical Operators XOR, EQV, and IMP

Now BASIC Anywhere Machine's logical operators (AND, OR, XOR, EQV, IMP) should match GW-BASIC.  (See page 59 of the Commodore PC Personal Computer GW-BASIC Interpreter User's Guide.

That said, loads of testing to do: we have to check and see if there are any discrepancies in the operator's order of precedence.

Regardless, one should never rely on any language implementation's order of precedence, which could be different from language to language and from one implementation of a language to another implementation of the same language.  So: best to make use of parentheses to explicitly define order of operations.

❇ CIRCLE: Pen position after the statement

In Today's version of BASIC Anywhere Machine:

The CIRCLE statement, upon completion, sets the pen position (i.e. the X and Y coordinates) to the centre coordinates of the drawn CIRCLE.

Before today's change, the CIRCLE statement, although positioning the centre of the circle as expected,  did not adjust the pen position.

Friday, October 21, 2022

❇ _AUTODISPLAY and _DISPLAY

Both statements in BASIC Anywhere Machine should now behave just like the same functions in QB64.

BAM documentation in the works.  In the meantime, refer to the QB64pe documentation:

If you are so inclined, please give the "Tester: _DISPLAY and _AUTODISPLAY" application a try and let me know if you find any bugs or mistakes in the implementation directly in the BASIC Anywhere Machine IDE or via the exported program:


Sunday, October 16, 2022

🆕 Alternative ("thin") character font.

The character font that comes with wwwBASIC is "thick" (a little bit like the Commodore 64 font).

I've recently updated BASIC Anywhere Machine with a second alternative font that is "thin" (a little bit like the Commodore PET font.)

Combined with the smoothing property, the font property now gives us an option (on which to build on!) for the appearance of BAM applications.


wwwBASIC Font, smoothing enabled

wwwBASIC Font, smoothing disabled

wwwBASIC Font - Thin, smoothing enabled

wwwBASIC Font - Thin, smoothing disabled










🖥 Geometric Mandalas

As a coding exercise, I wanted to make use of DRAW statements to get plot points for regular polygons repeated around an axis to create geom...