Late follow-up to September 28th's "🆕 _D2R".
The _R2D function converts a radian value into a degree value.
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.
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.
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.
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:
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.
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...