Saturday, March 15, 2025

πŸ“š Simulating OOP Methods in BAM Using GOSUB

BASIC Anywhere Machine's GOSUB implementation allows using numeric expressions for dynamic line numbers or using string expressions for dynamic line labels.

  • As of this blog entry's publishing,  the "production" version of BAM requires such an expression to be within parentheses and preceded by the "EVAL" keyword
    • example:  GOSUB EVAL( some_expression )
  • The current "development" version of BAM drops the "EVAL" keyword, because the parentheses are enough for indicating an expression for GOSUB
    • example:  GOSUB ( some_expression )
    • note: this syntax will appear in some yet-to-be-determined "production" release of BAM, replacing the syntax using "EVAL"
The use of expressions as GOSUB arguments allows BAM programs to simulate OOP methods, as demonstrated in the following program:
The program fills the screen with 570 random shapes (circles or squares) with random ( x, y ) center coordinates, random colours, and random sizes.

Each type of shape has a dedicated shape-drawing GOSUB routine.

The program is written in a way that assumes a future enhancement that involves movement of the shapes and bouncing away from the edges of the screen.

Saturday, March 8, 2025

πŸ–₯ Hypnot

This program is a port (and very minor mod) of a QB64 program by bplus.  The program by bplus is a port and mod of a ZBASIC program.



Saturday, March 1, 2025

πŸ–₯ Isometric Bouncing Ball Sim

This program is a port and mod of a QB64 program by b+, that program being a port and mod of a BASIC program by "Claude."




Sunday, February 23, 2025

πŸ–₯ Rotating Icosahedron

Icosahedron: I cause a head-run ???  (Yup, that's this sponge's insta-thought...)

This BAM program is a port of a QBJS program created and shared by "vince" on the QB64 Phoenix Edition forums. (πŸ”—link)

This program port was a little tricky because BAM does not have a "MapTriangle" function to create filled-in triangles.  I had to put a PAINT statement in an IF statement that checks to make sure the triangle is not so thin that PAINT does not work.



Friday, February 21, 2025

πŸ–₯ "Spirographed" ellipses to create a colorful (32-bit, gradiant) spherical shape

This sample program shows how to use DRAW to create ellipses (I like to call this a "spirographing" approach.

The program generates a series of ellipses (each ellipse having an increasingly brighter shade of blue) to create a spherical object with a black to blue gradient color.



Saturday, February 15, 2025

πŸ–₯ "Spirographed" ellipses to create colorful circles

This sample program shows how to use DRAW to create ellipses (I like to call this a "spirographing" approach.

The program generates (in an animated way) a new circle every 2 seconds with a new random color palette of between 2 and 62 colors.









Friday, February 7, 2025

πŸ–₯ Geometric Thingy

This program is inspired by a little programming challenge by ZXDunny.

I wasn't in the mood to deal with math formulas, which would have made my program much more compact.  So I stuck with simple/mindless programming.

The program displays the image with new random colors every four seconds or so, and uses a little bit of very simple animation as the colors get changed.









πŸ“š Simulating OOP Methods in BAM Using GOSUB

BASIC Anywhere Machine's GOSUB implementation allows using numeric expressions for dynamic line numbers or using string expressions for ...