• Blog
  • Docs
  • Pricing
  • We’re hiring!
Log inSign up
kamalnrf

kamalnrf

flag-quiz

Identify country flags — play solo, compete on the leaderboard
Public
Like
flag-quiz
Home
Code
3
lib
4
README.md
H
main.ts
Connections
Environment variables
Branches
1
Pull requests
Remixes
History
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Sign up now
Code
/
README.md
Code
/
README.md
Search
…
Viewing readonly version of main branch: v12
View latest version
README.md

Flag Quiz

Identify country flags — play solo, compete on the leaderboard.

Live: https://kamalnrf-flag-quiz.val.run

API

GET /quiz?n=5        → 5 random flag questions with 4 options each
GET /quiz            → 1 random question
GET /leaderboard     → top 20 scores
POST /score          → submit { name, score, total, speed_bonus, streak_best }

Scoring

  • 1 point per correct answer
  • Up to 2 speed bonus points (faster = more)
  • +1 streak bonus at 3+ consecutive correct
  • 12-second timer per question

Options

ParamDescription
?n=10Number of questions (max 194)
?limit=50Leaderboard entries to return

Limitations

  • Emoji flags may render differently across platforms
  • Leaderboard is global, no auth
FeaturesVersion controlCode intelligenceCLIMCP
Use cases
TeamsAI agentsSlackGTM
DocsShowcaseTemplatesNewestTrendingAPI examplesNPM packages
AboutAlternativesPricingBlogNewsletterCareers
We’re hiring!
Brandhi@val.townStatus
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Open Source Pledge
Terms of usePrivacy policyAbuse contact
© 2026 Val Town, Inc.