Friday, September 29, 2023

πŸ“š About CIRCLE: First, how CIRCLE behaves in GW-BASIC

A same CIRCLE statement produces, proportionally, the same-looking circle regardless of screen mode.

However, creating a box with the line statement does not produce the same-looking box in all screen modes.

So what does this say about the CIRCLE statement in GW-BASIC ?  To be continued ...

Here are some screenshots to compare results, using GW-BASIC running in a virtual console at the Internet Archive:







Thursday, September 28, 2023

πŸ–₯ Four-Pointed SineWavy Thing

A QB64 program by bplus (a mod to vince's mod to bplus' program?), ported to BAM with mods to improve performance.

QB64 is blazzingly (the programs are compiled), so I had to but the screen resolution by half for the BAM version to have comfortable performance.

This BAM program created with, and exported from, the development version of BASIC Anywhere Machine, which doubles the speed of the CIRCLE statement and includes "Rgba" statement include libraries.






Wednesday, September 27, 2023

πŸ–₯ Colour-Changing Fractal Fern







πŸ“š OPTION EXPLICIT !!!

Wow.  I'm only discovering this now.

While haphazardly scanning the wwwBASIC.js code, I stumbled upon the javascript code that handles  "OPTION EXPLICIT" in a BASIC program.

I wish I had noticed that before.  That's a big deal.

Without OPTION EXPLICIT, a variable name typo gets treated like a new variable created on the spot.  And that can lead to programming errors that are very hard to pinpoint.

Let's consider a simple program example:

greeting$ = "hello there"

print gretting$

The program will run without error, but the results will be incorrect.  "gretting$" (a typo of "greeting$") gets immediately treated as a new variable, has no value assigned to it, and gets printed.  (The result: nothing printed.)

To avoid that kind of problem, which would be very hard to resolve in a long and complex program, start the program with an "OPTION EXPLICIT" statement.

OPTION EXPLICIT

greeting$ = "hello there"

print gretting$

Upon running the above program, we immediately get an error about "greeting$" being an undefined variable.  So we define it and run the program again.

OPTION EXPLICIT

DIM greeting$ = "hello there"

print gretting$

Upon running the above program, we immediately get an error about "gretting$" being an undefined variable.  And we know that this is a variable name typo.

Awesome.




Tuesday, September 26, 2023

πŸ–₯ Catrun.bas, a GW-BASIC/PC-BASIC program ported to BAM

This BASIC Anywhere Machine program is a port (and mod) of a GW-BASIC program transcribed by  Solo88 from a YouTube video.

From the description for Jason Doucette's YouTube video:

Cat animation programmed in GW-BASIC, running from PC-BASIC emulator of Tandy GW-BASIC. The source of the animation data comes from an old 1984 book called "Create Your Own - Games Computers Play" by Keith S. Reid-Green




Jason Doucette's video



πŸ–₯Spinner, a QB64 program by b+

A program by b+ setup to work, as is, in both QB64 and QBJS, and that ported to BAM by moi:





Sunday, September 24, 2023

πŸ–₯ Spinning spiral wheel

This QB64 program by "Dav" ported to, and exported from, the development version of BASIC Anywhere Machine (with speed improvement to the CIRCLE statement.)




πŸ–₯ 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...