← Lessons PIXEL PATH Β· 4–6🎟️

Backstage Token Bucket

LESSON 112
🎯 Today's missions
🎀🎟️πŸ₯
STAGE & MUSIC

Backstage Token Bucket

A huge crowd rushed the backstage door! Build a fair gate that uses one ticket token for each entry and refills safely on the beat.

🧠 Before we start

At the Volcano, you checked fresh loads before routing each job. Today, a rate limiter protects one busy door. A token bucket allows quick bursts but makes extra work wait until new tokens arrive.

πŸ₯ Beat refillsβ†’πŸŽŸοΈ Check tokenβ†’πŸšͺ Admit or waitβ†’πŸͺ£ Never overflow
Challenge 1 of 4Build the fair gate program
1

Arrange the backstage rules

Tap five visual instruction blocks in the order the token gate should follow.

MY VISUAL TOKEN-BUCKET PROGRAM
1 Β· REFILL
2 Β· CAP
3 Β· CHECK
4 Β· SPEND
5 Β· WAIT

🌟 What you learned

Come back tomorrow for another advanced visual coding adventure! ✨
🎟️

The Backstage Rush!

The band starts soon, but too many fans reached one tiny door. Build a token-bucket gate that keeps entry quick, fair, and safe.