Learn Tinybasic - 10 Code Examples & CST Typing Practice Test
Tiny BASIC is a minimalist implementation of the BASIC programming language, designed to run on early microcomputers and extremely resource-constrained systems. It focuses on simplicity, small memory footprint, and easy interpretive execution.
Learn TINYBASIC with Real Code Examples
Updated Nov 21, 2025
Code Sample Descriptions
TinyBasic Button Press Counter
10 LET count = 0
20 GOSUB 1000
30 GOSUB 2000
40 GOSUB 2000
50 END
1000 REM UpdateUI
PRINT "Button Count: "; count
RETURN
2000 REM ButtonPress
count = count + 1
GOSUB 1000
RETURN
Counts button presses and updates the display.
TinyBasic Theme Toggle
10 LET isDark = 0
20 GOSUB 1000
30 GOSUB 2000
40 GOSUB 2000
50 END
1000 REM UpdateUI
IF isDark THEN PRINT "Theme: Dark" ELSE PRINT "Theme: Light"
RETURN
2000 REM ToggleTheme
isDark = 1 - isDark
GOSUB 1000
RETURN
Toggles between Dark and Light themes.
TinyBasic Score Tracker
10 LET score = 0
20 GOSUB 1000
30 GOSUB 2000
40 GOSUB 3000
50 GOSUB 4000
60 END
1000 REM UpdateUI
PRINT "Score: "; score
RETURN
2000 REM Increment
score = score + 10
GOSUB 1000
RETURN
3000 REM Decrement
score = score - 5
GOSUB 1000
RETURN
4000 REM Reset
score = 0
GOSUB 1000
RETURN
Tracks a score with increment, decrement, and reset.
TinyBasic Simple Timer
10 LET time = 0
20 GOSUB 1000
30 GOSUB 2000
40 GOSUB 2000
50 END
1000 REM UpdateUI
PRINT "Time: "; time; " sec"
RETURN
2000 REM Tick
time = time + 1
GOSUB 1000
RETURN
Counts time in seconds and prints elapsed time.
TinyBasic Health Tracker
10 LET health = 100
20 GOSUB 1000
30 GOSUB 2000
40 GOSUB 3000
50 END
1000 REM UpdateUI
PRINT "Health: "; health
RETURN
2000 REM Damage
health = health - 20
GOSUB 1000
RETURN
3000 REM Heal
health = health + 10
GOSUB 1000
RETURN
Tracks health with damage and healing.
TinyBasic Level Tracker
10 LET level = 1
20 GOSUB 1000
30 GOSUB 2000
40 GOSUB 2000
50 GOSUB 3000
60 END
1000 REM UpdateUI
PRINT "Level: "; level
RETURN
2000 REM NextLevel
level = level + 1
GOSUB 1000
RETURN
3000 REM ResetLevel
level = 1
GOSUB 1000
RETURN
Tracks game levels with increment and reset.
TinyBasic Coin Counter
10 LET coins = 0
20 GOSUB 1000
30 GOSUB 2000
40 GOSUB 2000
50 GOSUB 3000
60 END
1000 REM UpdateUI
PRINT "Coins: "; coins
RETURN
2000 REM CollectCoin
coins = coins + 1
GOSUB 1000
RETURN
3000 REM LoseCoin
coins = coins - 1
GOSUB 1000
RETURN
Counts coins collected and lost in a game.
TinyBasic Ammo Tracker
10 LET ammo = 10
20 GOSUB 1000
30 GOSUB 2000
40 GOSUB 2000
50 GOSUB 3000
60 END
1000 REM UpdateUI
PRINT "Ammo: "; ammo
RETURN
2000 REM Shoot
ammo = ammo - 1
GOSUB 1000
RETURN
3000 REM Reload
ammo = 10
GOSUB 1000
RETURN
Tracks ammo usage with shoot and reload actions.
TinyBasic Star Collector
10 LET stars = 0
20 GOSUB 1000
30 GOSUB 2000
40 GOSUB 2000
50 GOSUB 3000
60 END
1000 REM UpdateUI
PRINT "Stars: "; stars
RETURN
2000 REM CollectStar
stars = stars + 1
GOSUB 1000
RETURN
3000 REM LoseStar
stars = stars - 1
GOSUB 1000
RETURN
Counts collected stars and displays progress.
TinyBasic Power-Up Timer
10 LET powerTime = 10
20 GOSUB 1000
30 GOSUB 2000
40 GOSUB 2000
50 GOSUB 3000
60 END
1000 REM UpdateUI
PRINT "Power-Up Time: "; powerTime
RETURN
2000 REM Tick
powerTime = powerTime - 1
GOSUB 1000
RETURN
3000 REM Reset
powerTime = 10
GOSUB 1000
RETURN
Counts down power-up duration and resets.
Frequently Asked Questions about Tinybasic
What is Tinybasic?
Tiny BASIC is a minimalist implementation of the BASIC programming language, designed to run on early microcomputers and extremely resource-constrained systems. It focuses on simplicity, small memory footprint, and easy interpretive execution.
What are the primary use cases for Tinybasic?
Learning programming basics on tiny hardware. Hobbyist and retrocomputing projects. Embedded systems with very small memory. Educational demonstrations of interpreters. Prototyping simple logic on microcontrollers
What are the strengths of Tinybasic?
Tiny memory footprint (under 4 KB). Fast and simple to interpret. Great for teaching programming fundamentals. Easily portable across minimal microcontrollers. Works on systems without modern OS or libraries
What are the limitations of Tinybasic?
Very limited language features. No floating-point in many variants. No advanced data structures or libraries. No modern networking or file I/O. Unsuitable for complex or commercial applications
How can I practice Tinybasic typing speed?
CodeSpeedTest offers 10+ real Tinybasic code examples for typing practice. You can measure your WPM, track accuracy, and improve your coding speed with guided exercises.