// CODE & GAMES
Code & Games
Small programs and games I build to learn — and because they're fun to share. Play them right here in the browser; the source is on GitHub.
STACK // PythonJavaScriptPyScriptHTML5 CanvasGit
Astro Shooter
A top-down 2D space shooter game. Control your spaceship, dodge incoming asteroids, and blast them with lasers to score points!
Classic Snake
The classic grid-based arcade game built with HTML5 Canvas and JavaScript. Features score tracking, WASD/arrow controls, and increasing speed.
Tower Defense
A strategic game where you place defensive turrets to defend your base against waves of incoming robot enemies.
Click on the grid to build Turrets (Cost: 50 Gold). They will auto-fire at enemies!
Unit Converter (Python)
A lightweight python script running in-browser via PyScript. Converts between metric and imperial units (temperature, distance, and weight).
// READOUT: Unit Converter (Python)
SOURCE CODE
def convert_temp(val, to_unit):
if to_unit.lower() == 'c':
return (val - 32) * 5/9
return (val * 9/5) + 32
def convert_dist(val, to_unit):
if to_unit.lower() == 'm': # meters to feet
return val * 3.28084
return val / 3.28084 # feet to meters
print("--- PYTHON CONVERTER ---")
print("Converting 100 Fahrenheit to Celsius:")
print(f"100 F = {convert_temp(100, 'c'):.2f} C")
print("\nConverting 10 Meters to Feet:")
print(f"10 m = {convert_dist(10, 'm'):.2f} ft")
print("\nConverting 32 Feet to Meters:")
print(f"32 ft = {convert_dist(32, 'f'):.2f} m") CONSOLE OUTPUT
Ready. Click "RUN PROGRAM" above.