I found a way to draw 1-bit sketches in TI-BASIC on my calculator using dithering. I used ordered dithering because it is the easiest to implement, and all that is needed on a 96×64 screen. Below is the code I used, with comments.
First, set a 4×4 Bayer matrix to
This will clear drawings, but make sure your graphs are also cleared before running this program.
Iterate through each pixel in range, from the top left to the bottom right .
We are graphing , a function of and , with a range of , where represents lightness and represents darkness. Here, I am graphing .
Note that matrix indices start at
0 in TI-BASIC.
If is greater than the value of the Bayer matrix at , the pixel will be displayed in black.
The program ends here. This is how it came out:
And with more interesting functions, like
If you try this out, get ready for long drawing times, as TI-BASIC for the Z80 chipset is extremely slow.