Wednesday, May 31, 2023
Saturday, May 6, 2023
✏ _MOUSEBUTTON and GETMOUSE
For both functions, "1" would be returned to indicate that a mouse button is pressed.
Now, both functions return "-1" (i.e. the system constant TRUE) to indicate that a mouse button is pressed.
Unchanged: a "0" (i.e. the system constant FALSE) is returned to indicate that a mouse button is NOT pressed.
In any previously created BAM programs, you will need to change things like "IF _MOUSEBUTTON = 1" to one of:
- "IF _MOUSEBUTTON = TRUE"
- "IF _MOUSEBUTTON = -1"
- "IF _MOUSEBUTTON"
Thursday, April 27, 2023
🆕 _GETCHR$ to get a string representation of the 8x8 pixels for the character assigned to an ascii code
The _GETCHR$ function does the reverse of the recently added _LETCHR$ statement.
Checkout a sample application:
The _GETCHR$ statement returns the string representation of the 8x8 pixel definition for a character that matches the specified ascii code.
Syntax
_GETCHR$( ASCII_code%)
- return value: a 64-character string representing 8x8 pixels
- an "X" represents an "on" pixel
- a "." represents an "off" pixel
- ASCII_code%
- An integer number that represents an ASCII character.
- As simple as a literal number, a constant/variable number, or a numeric expression of any complexity.
- characterTemplate$
Wednesday, April 26, 2023
💩 Oh poop. Screen mode changes done 3 months ago.
About three months ago, I made changes to BASIC Anywhere Machine's screen modes, rolling out the update and completely forgetting to make any kind of heads-up announcement about it.
And I forgot to update a whole bunch of programs to use the new screen modes.
Surprise?
The previous screen modes were the as-is screen modes as implemented in wwwBASIC (as found on Github Dec 27, 2020. I wanted something more to my liking, so I adjusted them to the ones described in this post.
You can still access the last version of BASIC Anywhere Machine with the old screen modes here (and the documentation for that version here.)
You can compare with the current version of BASIC Anywhere Machine here (and the current version of the documentation here.) If you had noticed any programs not working: I updated these programs in BASIC Anywhere Machine yesterday to use the new screen modes. (list of those further down below.)
Also, for your convenience, you can compare the previous screen modes (info below) to the current screen modes in this post.
| Mode | Screen Width | Screen Height | Columns | Rows | Screen Aspect | Font Height | Colour Scheme | Bits Per Pixel | |
|---|---|---|---|---|---|---|---|---|---|
| 0 | 640 | 200 | 80 | 25 | 2.4 | 8 | rgba | 4 | |
| Alternative width: 40 | (See the statement) | ||||||||
| 1 | 320 | 200 | 40 | 25 | 1.2 | 8 | screen1 | 2 | |
| 2 | 640 | 200 | 80 | 25 | 2.4 | 8 | monochrome | 1 | |
| 7 | 320 | 200 | 40 | 25 | 1.2 | 8 | rgba | 4 | |
| 640 | 200 | 80 | 25 | 2.4 | 8 | rgba | 4 | ||
| 640 | 350 | 80 | 25 | 480/350 | 14 | rgba | 4 | ||
| 640 | 350 | 80 | 25 | 480/350 | 14 | monochrome | 2 | ||
| 11 | 640 | 480 | 80 | 30 | 1 | 16 | monochrome | 2 | |
| 12 | 640 | 480 | 80 | 30 | 1 | 16 | rgba | 4 | |
| 13 | 320 | 200 | 25 | 1.2 | 8 | undefined | 24 | ||
| 14 | 320 | 240 | 15 | 1 | 16 | undefined | 24 | ||
| 15 | 400 | 300 | 18 | 1 | 16 | undefined | 24 | ||
| 16 | 512 | 384 | 24 | 1 | 16 | undefined | 24 | ||
| 17 | 640 | 400 | 80 | 25 | 1.2 | 16 | undefined | 24 | |
| 18 | 640 | 480 | 80 | 30 | 1 | 16 | undefined | 24 | |
| 19 | 800 | 600 | 100 | 37 | 1 | 16 | undefined | 24 | |
| 20 | 1024 | 768 | 128 | 48 | 1 | 16 | undefined | 24 | |
| 21 | 1280 | 1024 | 160 | 64 | 1 | 16 | undefined | 24 | |
- Barnsley Fern (Fractal)
- Based on PRINT CHR$(205.5+RND(1)); : GOTO 10
- Bouncing Circle and Square Screen Painter
- BouncingBall
- BouncingBall 2
- Bubble Universe
- CALCULATOR
- Cannoneer
- Catch 88
- Chaotic Scatter
- CIRCLE to Draw Pie Charts
- Curve Stitching in a Circle
- Cute 40-line-ish game
- Cute 50-line-ish game
- donkey.bas
- Easy Spiral
- Ever-Changing Mandala II (less CPU intensive)
- File Open, Print, Close Tester
- Flower Wheel
- LINE remembers the last pen position
- Mouse testing 1
- Munching Squares
- Pendulum
- Rotating Lorenz Attractor
- Semi-random PSET art
- Ski Slope Challenge (Charlie's Version)
- Snowflake
- Sound Tester
- Spheres
- Tank
- Tester: _DISPLAY and _AUTODISPLAY
- Tester: DRAW commands A and TA
- Tester: Logical Operators
- Tester: PRINT, WRITE, PRINT#, WRITE#, OPEN, CLOSE
- Tester: Screen Scrolling (Mirage Maker?)
- Wumpus
- Yahtzee
- Akalabeth
- Akalabeth (BAM!)
- Archimedean spiral
- ASCII Character Set
- Background Generator
- Box Color Varied
- circles
- Conway's Game of Life
- Diagonals on SCREEN 2
- draw graphics test
- DrawSquare
- Easter Egg Decorating
- Easter Egg Decorating 2
- Ever-Changing Mandala
- Fedora Hat
- FLIPPER
- Fractal Tree
- GW-BASIC (Amiga) Get + Put Sample
- GW-BASIC-3D
- Hailstone sequence
- Hello World Horizontal Marquis
- INSTR tester
- Julia set (GW-BASIC)
- Julia set (Locomotive)
- Julia set (QBasic)
- line graphics test
- lines.bas
- Mandelbrot set
- Mesmerizer 1
- MID$ (statement) tester
- mishka's clock
- Polar Grapher.bas
- Put - Get
- PUT color action sample
- PUT color action sample II
- Qb64 Draw Example
- Regeya's CIRCLES
- Rotating Circle
- Rotating Pyramid
- Simple Animation XOR test
- SimpleRandomHillsMaker
- Sine Art 1
- Spinny Cube
- Summation of primes
- Sunshine
- Tester _width _height
- Tester DRAW
Tuesday, April 25, 2023
📚 The SCREEN modes
| Mode | Width X Height (Pixels) | Columns X Rows (Characters) | Screen Aspect | Font Height | Colour Mode | Bits Per Pixel |
|---|---|---|---|---|---|---|
| 0 | 640 X 200 | 80 X 25 | 2.4 | 8 | p16 | 4 |
| 1 | 320 X 200 | 40 X 25 | 1.2 | 8 | p4 | 2 |
| 2 | 640 X 200 | 80 X 25 | 2.4 | 8 | p2 | 1 |
| 7 | 320 X 200 | 40 X 25 | 1.2 | 8 | p16 | 4 |
| 8 | 640 X 200 | 80 X 25 | 2.4 | 8 | p16 | 4 |
| 9 | 640 X 350 | 80 X 25 | 480/350 | 14 | p16 | 4 |
| 10 | 640 X 350 | 80 X 25 | 480/350 | 14 | p2 | 1 |
| 11 | 640 X 480 | 80 X 30 | 1 | 16 | p2 | 1 |
| 12 | 640 X 480 | 80 X 30 | 1 | 16 | p16 | 4 |
| 13 | 320 X 200 | 40 X 25 | 1.2 | 8 | p256 | 8 |
| 14 | 320 X 200 | 40 X 25 | 1 | 8 | p256 | 8 |
| 15 | 320 X 200 | 40 X 25 | 2.4 | 8 | p256 | 8 |
| 16 | 320 X 200 | 40 X 25 | 1.2 | 16 | p256 | 8 |
| 17 | 320 X 200 | 40 X 25 | 1 | 16 | p256 | 8 |
| 23 | 640 X 400 | 80 X 25 | 1.2 | 8 | pRGB | 24 |
| 24 | 640 X 400 | 80 X 25 | 1 | 8 | pRGB | 24 |
| 25 | 640 X 400 | 80 X 25 | 2.4 | 8 | pRGB | 24 |
| 26 | 640 X 400 | 80 X 25 | 1.2 | 16 | pRGB | 24 |
| 27 | 640 X 400 | 80 X 25 | 1 | 16 | pRGB | 24 |
| Mode | Number of Colour Attributes | Bits Per Pixel |
|---|---|---|
| p2 | 2 | 1 |
| p4 | 4 | 2 |
| p16 | 16 | 4 |
| p256 | 256 | 16 |
| pRGB | undefined | 24 |
- Note: p2, p4, p16 and p256: references to colour attributes allow "Colour attribute looping".
About Colour Attribute Looping
In BASIC Anywhere Machine, when working with colour modes that have colour attributes, we normally refer to those attributes as attributes zero to whatever maximum for that colour mode. (For example, attributes 0 to 15 in colour mode p16.)
When we refer to attributes with numbers outside of the range, BASIC Anywhere Machine loops around (treating the list of attributes like a circle.) So in colour mode p16, attribute 16 means attribute 0, and attribute 17 means attribute 1.
The same works in the other direction. In colour mode p16, attribute -1 means attribute 15, and attribute -2 means attribute 14.
The following statements and functions have been tested to make sure that works:
- COLOR
- CIRCLE
- LINE
- PAING
- PSET
Monday, April 24, 2023
🆕 _LETCHR$ to redefine 8x8 characters assigned to ascii codes
The _LETCHR$ statement redefines the 8x8 character assigned to an ASCII code.
Syntax
_LETCHR$( ASCII_code%, characterTemplate$ )
- ASCII_code%
- An integer number that represents an ASCII character.
- As simple as a literal number, a constant/variable number, or a numeric expression of any complexity.
- characterTemplate$
- A 64-character string that represents the "on" pixels of an 8x8 character
- any "X" (must be uppercase) represents an "on" pixel
- any other characters in the string represent "off" pixels
- As simple as a literal string, a constant/variable number, or a numeric expression of any complexity.
- A 64-character string that represents the "on" pixels of an 8x8 character
Monday, April 17, 2023
Experimenting with Unicode Characters in Identifiers and Line Labels
Finding emojis useful for sporadic "grab-you by the jugular" icons, I'm now experimenting with Unicode characters for more numerous things I want grabbing my attention without doing so obnoxiously.
Note: I am experimenting with these as a way to help folk with cognitive/visual disabilities, to make it easier to locate/identify sections of code.
Emojis are pretty quick to access, at least on my Chromebook: right-click and click on emojis to access them in a dialog.
Unicode character access was requiring too many steps, so I've added a section for Unicode characters in the Lookups Window (in the menu: Tools - Lookups). This brings up the List of Unicode characters Wikipedia page, and provides a field in which you can copy/paste frequently used Unicode characters. (IF IT IS SOMETHING YOU WANT TO EXPERIMENT WITH TOO !!!)
EDIT:
A big reason I'm using GOTO's in this sample: getting old non-structured BASIC programs working in BASIC Anywhere Machine is a ton of fun, especially when exported programs can be shared as small HTML files on the web.
I see Unicode characters and emojis as a way to help see parts of these old BASIC programs in order to create structured versions of them.
The arrows make it a little easier to find/identify branching/flow, and that "STOP" character makes it really easy to pinpoint the END of the program.
🖥 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...
-
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 v...
-
This program is a port and mod of Steve Justice's program presented in the "Fractals in Focus" article found in the May 1985 i...
-
A port and mod of a program shared by Ardi Ardi with the "BASIC Programming Language" Facebook group via this post . This program ...



