Little match girl
Christian Andersen

// ❄️ The Little Match Girl — cinematic code story (English version)
const city = new City("OldTown")
.setEra(Year.Around(1890))
.with( Weather.SNOWFALL, Wind.COLD, Light.LANTERNS.glow("amber"));
const littleGirl = new Character("LittleMatchGirl");
const people = Group.of(passersby, children);
people
.moveAlong(streets)
.laugh()
.moveTo(place.random)
.ignore(littleGirl);
const transports = Group.of(carriages, sleds);
transports
.pass(streets)
.clatter()
.throwShadows( littleGirl);
littleGirl
.wear(Clothes.THIN)
.barefoot()
.carry(Matches.BOX(10))
.state({ warmth: 0, hope: 0, wentWithGrandmother: false })
.moveThrough( city.street.main)
.watch( Children.playWith(Snow.BALLS))
.see( Houses.windows.glow( Warmth.GOLD))
.stepBack(Fear.SMALL)
.whisper("It’s warm there… but not for me…")
.shout("Who will buy my matches?");
// simple sequential logic — each match lights a new dream
while ( littleGirl.has( Matches.ANY) && littleGirl.isAlive() && littleGirl.isCold() ) {
enum Dream { BANQUET = "BANQUET", FIREPLACE = "FIREPLACE", TREE = "TREE", GRANDMOTHER = "GRANDMOTHER" }
// First spark — small flame of imagination
littleGirl.light(Matches.FIRST)
.watch(fire)
.imagine(Dream)
.smile(Fleeting.TRUE)
.shiverLess();
// Dream 1: The Banquet
if (Flame.ALIVE) {
Dream.BANQUET:
littleGirl
.eat(Bread.WARM)
.smile(Sweet.TRUE)
.eat(MEAT.ROAST)
.lickFingers()
.drink(Milk.HOT)
.sigh(Content.TRUE)
.reachFor( Fruit.APPLE)
.giggleSoft();
}
littleGirl.light(Matches.NEXT);
// Dream 2: The Cozy Room with Fireplace
if (Flame.ALIVE) {
Dream.FIREPLACE:
littleGirl
.wrapIn(Blanket.SOFT)
.shiverLess()
.sit(Armchair.WARM)
.inhale( Scent.WOOD_FIRE)
.putFeetIn( Slippers.FUZZY)
.relax()
.lookAround()
.smilePeaceful();
}
littleGirl.light(Matches.NEXT);
// Dream 3: The Christmas Tree and Candles
if (Flame.ALIVE) {
Dream.TREE:
littleGirl
.blinkRapid()
.eyesShine()
.touch( Tree.DECORATED)
.laughSoft()
.smell( Candles.VANILLA)
.inhaleDeep()
. heart.Beat(Excited.TRUE);
}
littleGirl.light(Matches.LAST);
// Dream 4: The Loving Grandmother
if (Flame.ALIVE) {
Dream.GRANDMOTHER:
littleGirl
.runTo( Grandmother.ARMS)
.hug(Tightly.TRUE)
.restHead( Grandmother.SHOULDER)
.closeEyes()
.smileSoft()
.tearWell()
.feel(Safety.TRUE)
. heart.rest()
.ascendWith( grandmother)
.into(Light.PEACE)
.as( Stars.SILENT_WITNESS);
break; // final transition — the soul rises
}
// Dawn over the city
city.dawn()
.light( Sky.PALE_BLUE)
.touch(Snow.SOFT);
// People notice the girl
people
.gatherAround( littleGirl)
.hush()
.softVoice().say("She only wanted a little warmth…")
.bowHeads();
// Symbolic ending — she is embraced by love
Heaven.open()
.glow(Light.WARM)
.choir( Sound.GENTLE_HUM)
.garden( Blossoms.WHITE)
.embrace( littleGirl, grandmother);
// Silent world, eternal peace
city.dawn()
.people()
.hush()
.softVoice().say("Now she is warm forever…");
}