By the way, with either version, notice how the BASIC program creates 1 session storage item.
As the program is running, you can alter that “Depth” item at any time, and the BASIC program will pick that value up just before drawing a new tree.
The default “depth” value for the program is 10. If you want a different default on subsequent launch of the program, create in local storage an item with the same key name as the one in session storage, but with a value that you prefer.
What you do there manually with local storage and session storage, that can be done via widgets in TiddlyWiki.
So that’s how a TiddlyWiki instance can communicate with a hosted BASIC Anywhere Machine program.
That’s also how a BASIC Anywhere Machine program can communicate with the host TiddlyWiki.