Showing posts with label Program. Show all posts
Showing posts with label Program. Show all posts

Saturday, June 27, 2026

🖥 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 geometric mandalas.





Monday, June 15, 2026

🖥 Circular Meander

About Meanders: read this Wikipedia article. 

This program is based on the image shared by bplus in this post (QB64 Phoenix Edition forum).

NOTE: Somebody is insisting (or "some may insist") that the graphic generated by my program is NOT a meander.  To me, although the program's process does not draw the pattern in one continuous line, the result is "a decorative border that is a continuous line, shaped into a repeated motif."

This animated program repeatedly draws the same style of meander in an infinite loop, with plot points that are relative to each other, but together varying depending on random screen resolution on every iteration, and random colors.

This is an unstructured program, coded very organically/incrementally without any planning, and without any desire to minimize the amount of code.

Although I originally created the program to generate the graph in one step, I've setup the animation to draw the graph in four steps.  This gives a visual idea of how circles are used, and plot points used at specific angles on points of each of the eight circles.

The program has short pauses throughout.  At any time, you can click/touch the screen to pause the animation.



Thursday, June 11, 2026

🖥 Golden Ball 1 Crop Circle

Over in the QB64 Phoenix Edition community, bplus (one of their prolific programmers) suggested (in this post) a little programming challenge to recreate the pretty awesome "Golden Ball Hill" crop circles:



In this program, I tackled the formation that interested me the most, but stopped short of the partial doughnut holes in the "half moon" shapes in the formation.  For me, the gist of this as a "brain age" kind of exercise involved just getting the fundamental process figured out, and graphing the thing via a simple animation in an infinite loop with random colors:






Monday, June 8, 2026

🖥 Café Wall Illusion

This program is based on the graphic output of a BBC-BASIC-for-SDL program created by Kurt Moerman and shared with the "BASIC Programming Language" Facebook Group.  (Although Kurt's post cannot be shared, his code is available on Github here.)

This BAM program:


Wednesday, May 20, 2026

🎉 New version of Blitkrieg Stratagem Chooser

Barely a moment after sharing the program, I decided to immediately tackle a few personal annoyances:

  • I decided to let my coding style freak flag fly  That involved:
    • slight reorganization of the code to fit my tastes, including moving some bode into GOSUB routines
    • some "strategic" use of emojis here and there to help me quickly spot certain particular things
    • naming conventions for my GOSUB routines (I like to start them with an alphabetic character followed by a three digit number, and an emoji) 
  • I added the ability to, at any time, copy the current A.I. Turn statistics to the clipboard, which you can then paste anywhere of use
    • I figured, if the program is presenting that info, might as well make it possible to "export" that info via the no fuss no muss approach that is making use of the clipboard.
    • I pasted sample output at the bottom of this post
  • Because I needed different actions when clicking/touching the screen:
    • I modified the program to require clicking a defined area of the screen related to getting the stratagem for the A.I. Bot's Next Turn
    • I added another defined area of the screen related to sending game statistics to the clipboard
  • I reconsidered my use of colors in the bottom half of the screen to keep usage of color to a minimum (as in only for those very important things we really want to highlight)
Compare the screenshot of today's new version to the screenshot of the previous version found in the earlier blog post.



Sample stats copied to the clipboard (best formatted with a fixed font after pasting):

Statistics:
    BigGun: 4
    CounterAttack: 4
    EconomicWarfare: 2
    ForTheGlory: 4
    RapidDeployment: 3
    ResearchAndDevelopment: 6
    Secure: 2
    SteamRoll: 6

Turn  Stratagem
----  ---------
   1  CounterAttack
   2  EconomicWarfare
   3  ForTheGlory
   4  BigGun
   5  SteamRoll (BigGun)
   6  ResearchAndDevelopment
   7  ForTheGlory
   8  EconomicWarfare
   9  CounterAttack
  10  Secure
  11  CounterAttack
  12  ResearchAndDevelopment
  13  CounterAttack
  14  ForTheGlory
  15  SteamRoll (ForTheGlory)
  16  RapidDeployment
  17  SteamRoll (RapidDeployment)
  18  Secure
  19  ResearchAndDevelopment
  20  SteamRoll (ResearchAndDevelopment)
  21  BigGun
  22  SteamRoll (BigGun)
  23  ResearchAndDevelopment
  24  SteamRoll (ResearchAndDevelopment)
  25  RapidDeployment


Monday, May 18, 2026

🖥 Blizkrieg Stratagem Chooser

UPDATE: 🎉 New version of Blitkrieg Stratagem Chooser

I really enjoy tabletop games, particularly games that I can play solo: 1-player games, multiplayer games that have official solo rules, and multiplayer tabletop games that have fan-created solo variants.

Right up there among my favourites, you'll find Blitkrieg! World War Two In 20 Minutes (about the game at BGG).

This two-player game is fantastic, and the included solo rules are very well designed.

However, no matter the tabletop game: I do get a little bit annoyed by cumbersome/fiddly and/or time-consuming mechanisms/processes.

With Blitkrieg!, although I'm quite happy to draw "unit tokens" after every turn, I get annoyed with the process of drawing a stratagem token at the start of the A.I. Bot's turn (when playing solo.)

I have no idea why I'm annoyed, and I don't really care.  I think: "what am I going to do about it?"

That problem is just a fun programming exercise.  Since my heart belongs to the BASIC programming language, then it is BAM to the rescue.





Saturday, May 2, 2026

🖥 Animated "100 Doors"

EDIT 2026-05-11: Something was causing this program to not work on mobile devices.  I'm guessing I had exported and uploaded the wrong version (an earlier non-working one) of this program.  A newly exported version now works (with my tablet, anyway.) (New test version)

This program is an animated version of the "100 Doors" programming task described on the Rosetta Code website.

Other than the tackling the task and enhancing it with some simple animation (to visualize the process), I also wanted to showcase a few features of BAM's BASIC implementation:

  • Using expressions in GOSUB statements
  • Using emojis to facilitate finding/noticing program sections and identifiers/labels 
  • Using the IFF function
  • Using the BETWEEN function
  • Pausing the program with help from the _MOUSEBUTTON function
My primary interest in this exercise (other than giving the old sponge a workout) revolved around the design of this loop and setting it up for multiple purposes:

FOR y% = 0 TO 4
  FOR x% = 1 TO 20
    GOSUB (DoorAction$)
    IF _MOUSEBUTTON THEN WHILE _MOUSEBUTTON : WEND
    SLEEP IFF(BETWEEN(pass%,1,30) AND (pass% < 5 OR pass% MOD 10 = 0), 0.025, 0.001)
  NEXT x%
NEXT y%

The program:



Saturday, April 25, 2026

🖥 Swirling Circles

This strange animation is the result of me wondering:

  • What if I drew circles at each end of a piston, and that piston moved up and down a fixed point on the screen.
  • And then made that piston go up and down.
  • Then, what if I made the fixed point the center of a circle, and then drew similar pistons at different angles in that circle.
  • And then made all the pistons go "up and down".
  • And then rotated the circle of pistons around the axis of that circle.

And then I went down the rabbit hole of "what kind of randomness can I add to this thing?"



Saturday, April 18, 2026

🖥 Orbs

EDIT 2026-04-19

Apparently, there are many "very similar" versions of this program "out there."

I think it would be a stretch to believe that all of these programs ought to be attributed to one person.  Anybody, at any time, can have an "original thought" that is completely independent from an identical "original thought" by somebody else in a different place and a different time.

When somebody shares a program, I assume it is their original code, and any port/mod of mine will give credit to the author of the source code I ported.  I'm not going to spend time investigating the origins of any program I find on the web.  (Well, if it is easy for me to give credit to all the shoulders on which I'm standing tall, I'll do that because I do enjoy doing that.) 

Some may believe that all programs similar to this one should be attributed to Jan Vibe as author of a similar program written in BBC BASIC.  I leave it up to you:  credit Jan Vibe for my port/mod if you wish.  Regardless, it would seem Jan Vibe made some significant contributions, which you might find worth researching.


This program is a port and mod of a BazzBasic program by EkBass, shared by EkBass via the GotBASIC discord server.

Note that I've setup some random "color randomness" to each drawing cycle loop (which generates a finite number of orbs each loop to create interesting patterns because of small empty spaces with no orbs.)























Tuesday, March 31, 2026

🖥 Modular Multiplication Circles

This BAM program is a port and mod of a PC-BASIC' program by Kurt Moerman which he shared with' the BASIC Programming Language Facebook Group via this post.



Saturday, February 21, 2026

📚 GETCHR$: Graphing characters using character pixel maps

This sample program demonstrates how to use the character pixel maps in BASIC Anywhere Machine as templates for the graphic creation of simple custom character sets. 

The program, in an endless loop, cycles through the digits 0 to 9, with a three second pause before clearing the screen and displaying the next digit.



Friday, February 13, 2026

🖥 DRAW to generate a conical shape

This program was inspired by a BBC program shared by Richard Russell with the "BASIC Programming Language" Facebook group via this post.

The question "how would I create a similar program to this BBC one without using trigonometric functions?" turned into the "brain-age" exercise that resulted in this BAM program:


Tuesday, February 10, 2026

🖥 "Quirky" Digital Clock

I could not dream up a good name for this clock.

Most folk would probably find the programming task itself much more quirky than the program.

For some reason, I started wondering about how to program a simple digital clock that is complimented by a simple graphic animation that gives a visual representation of how close the current minute is to ending, or how close the current hour is to ending, or how close the current day is to ending.

There is nothing fancy in either the clock or the code.  This was just a little programming exercise that wound up being quite a bit of fun.



Sunday, February 8, 2026

🖥 Thomas Attactor

This is a port of Kurt Moerman's "Thomas Attactor" QB64pe program ' which he shared with the "BASIC Programming Language" Facebook group ' via this post.

Read about the "Thomas' cyclically symmetric attractor" in this Wikipedia article.



Saturday, February 7, 2026

🖥 Aizawa Attractor

This program is a port and mod of Kurt Moerman's QB64pe program shared with the "BASIC Programming Language" Facebook group via this post.

About "attractors" (from Wikipedia):

In the mathematical field of dynamical systems, an attractor is a set of states toward which a system tends to evolve, for a wide variety of starting conditions of the system. System values that get close enough to the attractor values remain close even if slightly disturbed.

I've modified the program so that 10 seconds after the graph is generated, the screen is cleared and the graph is re-generated with many randomly altered parameters.  (The first graph generated is as per Kurt's QB64pe program.)

My port and mod:






Monday, January 19, 2026

🖥 Klein Bottle Wireframe

EDIT: I had a little bug in the program causing part of the "blue area" of the graph getting painted black because of an out of bound RGB color component.  So I've added the following highlighted line to the  updated version of the program:

ccc = 110 + z * 150
ccc = MAX( MIN( ccc, 255 ), 0 )
COLOR _RGB( ccc, ccc, 255 - ccc )

This "Klein Bottle" program is a port and mod of a QBJS program by "Vince" which was shared with the QB64pe community via this post. (Vince's source code is presented in an embedded QBJS IDE, so you can also run the program "right there".)

Read about the "Klein Bottle" in this Wikipedia article.

You can zoom in/out of the image using the scroll wheel on a mouse.

This BAM version of the program adds color to the image and uses very tiny circles instead of points (at the intersections of lines in the wireframe.)



Thursday, January 1, 2026

🖥 Julia Fractal

This program is a port and mod of a QB64 program by Kurt Moerman, shared with the "BASIC Programming Language" Facebook group (https://www.facebook.com/share/p/1BnaiB8Q67/).

Every 5 seconds, the graph will be regenerated with random parameters.



Saturday, November 15, 2025

🖥 Rolling Clock

Do I ever enjoy investigating/prototyping something that answers the thought (usually from way out in left field): "how would I do this/that in BASIC ?

The question: how would I program a rolling clock?  (A "smooth rolling" clock.)

Well, since I couldn't commit to the full guacamole, I decided to not do the "smooth" bit right away.  Instead, I decided to get the bits I think I'll need for "smooth", while just aiming for a working "choppy" prototype.




🖥 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...