Skip to main content

Using online Small Basic to render a bitmap using a 2D array - Toad!

Downloaded: 10

Last edit: 17 August 2022

English Key Stage 16-18 Years (KS5)
Scottish Curriculum Levels S6 Advanced Higher (17-18 years)
Curriculum Topic Programming

Link to online version of Small Basic here.

This example builds on the matrix display programs that I posted to plot simple graphics in Basic (same principle for any language that can work with 2D arrays and colour - can plot different characters if does not work with colour).

This plots a 3 colour image.

Because the image is symmetrical, I only encoded half of the coordinates a 0, 1 or 2 values in the 2D array.

I used a nested loop to copy a mirror image to the right hand side of the array.

Can add delay after each complete row when plotting - simple effect - take this out for full speed.

Can plot left to right columns, rather than top to bottom rows by reversing order of row and col For loops (see Toad Army example).

Works with online version of Small Basic or full version if you have it installed