What I'm working on
Commits
last 12 monthsCurrently open
typescript// a small treehouse utility
import { glow } from "./lantern";
type Room = "study" | "porch" | "nest";
const lantern = {
color: "#FFB347",
lit: true,
};
function light(room: Room): boolean {
if (!lantern.lit) return false;
return glow(room) === lantern.color;
}
// warm every room, one by one
const rooms: Room[] = ["study", "porch", "nest"];
for (const r of rooms) light(r);