Skip to content
all projects

Fall 2023 · Games · Hardware · Education

Stellar Cartography

A bare-metal C program for the Raspberry Pi Pico that generates and smooths maps of space sectors for a class-wide mining competition.

Terminal showing an ASCII sector map

Overview

Stellar Cartography was the end-of-semester competition in my computer architecture course. The premise: we are space rock miners, and whoever maps the most sectors wins rock dollars. Every map had to be fetched from a central data server, processed on a Raspberry Pi Pico in C, and uploaded back. Only maps that were both uploaded and correct counted.

How Mapping Worked

  • Each sector is described by a height, a width, and a topology score (the percent chance any cell holds a feature)
  • First you generate a base map: outer edges are always features, the exact middle is always open ground, and every other cell rolls the dice
  • Then you apply three adjacency rules that smooth the random noise into terrain, checking each cell against its neighbors in a one-block radius
  • Finished maps go back to the server, and correct ones earn rock dollars

The Fun Constraint

All of this had to run bare metal on the Pico, written in C. The suggested approach used a struct pointer for the map measurements and a 2D array for the map itself, storing tiles as numbers instead of characters. Beyond raw map count, the competition also gave style points for flashy extras like extremely minified source code. I wrote a longer post about what this project taught me on the blog.