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 16, 2026

🖥 Stratagem Icons for Blitzkrieg! World War Two in 20 Minutes

I created this little program to show 16x16 pixel icons created with 2x2 groups of custom characters.




📚 Custom Characters Tool Use Case: 16x16 bit (or 2x2 character) graphics

I'm building some 16x16 bit icons for a program I'd like to create (a randomly generated stratagem chooser for the solo variant of "Blitkrieg! World War Two In 20 Minutes".

To keep things simple, I will be using the Custom Characters Tool to create, for each icon, the four character definitions (in a 2x2 grid of characters) to give me (when the four characters are PRINTed together, a 16x16 pixel icon.

From the board game's documentation, here is the "Big Guns" stratagem token:


Using the Custom Characters Tool, I created each of the 8x8 bit quadrants:





Using those "LETCHR$" snippets, I created the following program:

BigGuns1$ = ".......................................................X......XX"
BigGuns2$ = "............X......XXX....XXX....XXXX...XXXX....XXX.....XX......"
BigGuns3$ = ".....XXX......XX.....XXX.....XXX.XXXXXXX........................"
BigGuns4$ = "X.XXX....XXXXX...XXXXX...XXXXX..X.XXX..........................."
SCREEN _NEWIMAGE(100,80,14)
COLOR 63,60
LETCHR$( 1, BigGuns1$ ) : LETCHR$( 2, BigGuns2$ )
LETCHR$( 3, BigGuns3$ ) : LETCHR$( 4, BigGuns4$ )
PRINT CHR$(1) + CHR$(2) 
PRINT CHR$(3) + CHR$(4) 

And the 16 bit graphic looks like this:


This is a good enough 16-bit icon for my needs.  No fuss, no muss.  Rock'n roll !



 

Friday, May 15, 2026

🪲 Fixed: Custom Characters Tool

At some point, I did something that broke the Custom Characters Tool, and I only noticed the problem tonight a few hours after releasing a new version of BAM.

Seeing as I've fixed the problem, why would I wait to release the fix at any other date/time than now?

BAM provides the ability to assign new custom 8 x 8 characters (defined via simple strings) to ASCII codes.  You do this with a LETCHR$ statement.  For example:

LETCHR$ (1, "........" _
          + "........" _
          + "..XXXX.." _
          + ".XX  XX." _
          + ".XX  XX." _
          + "..XXXX.." _
          + "........" _
          + "........")
PRINT CHR$(1);



Use the "Custom Characters" tool to graphically design your custom characters.


Clicking on the menu item will open a "Custom Characters Manager" dialog.


You will see that I'm in the process of creating multiple characters.  I want to create some 16x16 bit icons, each icon using 2x2 characters.

Clicking an edit button will open the character editor in a brand new window.  (This allows you to edit any number of characters simultaneously, each character in its own character editor window.)


Click a square in the grid to toggle pixels on/off.

As you create your character, you will find templates for the equivalent LETCHR$ statement that creates the same character.  (one statement with a horizontal layout, and one statement with a vertical layout.)  You can then copy whichever statement you prefer into your program.  Just replace the "???" with an ASCII character code you don't mind changing.






🎉 New Version of BASIC Anywhere Machine

EDIT: ARG!  Shortly after releasing this new version of BAM, I discovered a problem with the Custom Characters Tool.  So I updated the released version of BAM below with the fix described in this follow-up post: 🪲 Fixed: Custom Characters Tool

Although the BAM IDE, as per the TiddlyWiki instance it is, always behaved on touch devices, running BAM programs never behaved correctly with touch devices.  (The same applied to programs running from BAM and to programs exported from BAM for running as stand-alone web pages.)

Today's new version of BAM should produce programs that behave well on touchscreen devices.

Well, all works well with my cheapo Android tablet running the Chrome web browser.

Time will tell if all works well on other devices and/or web browsers, and time will tell if anybody reports such problems?

Please note that BAM programs disable multi-touch and double-taps.

  • The new version of BASIC Anywhere Machine
  • The previous version of BASIC Anywhere Machine
Thank-you:
  • "issues37" for letting me know touch-handling was not working with BAM programs
  • "dbox" for giving me the javascript "preventDefault" tip

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:



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