CricketScript Team   Open Lesson 1 →

The course

Learn TypeScript through cricket — eleven interactive lessons, about an hour, all in your browser.

What you'll learn. Every beginner TypeScript concept: primitive types, arrays, tuples, interfaces, unions, functions, optional parameters, aliases, enums, basic generics, and type narrowing. By Lesson 11 you can read production TypeScript and write your own with confidence.

How it works. Each lesson maps one TypeScript concept to one cricket moment you already understand. A batter has attributes — that's a type. Two batters at the wicket — that's a tuple. A bowler delivers a ball — that's a function. You tap, drag, and watch the code play out on the field.

What you need. A browser and five spare minutes. No setup, no install, no boilerplate. Try Lessons 1 and 9 free — the rest of the course unlocks for $15 (₹625 in India).

A fictional T20 XI runs through every lesson — three Indians plus two overseas specialists. Meet the team →

11lessons
45–90minutes
0setup
    01
    Meet the players
    string · number · boolean Free Player attributes — name, jersey number, captain.
    ~4 min Start →
    02
    Batting order
    arrays The lineup is a list — any length, any order.
    ~4 min Start →
    03
    At the wicket
    tuples The partnership — exactly two, in that order. Always.
    ~3 min Start →
    04
    The player card
    objects · interfaces Group attributes into a reusable shape — Player.
    ~5 min Start →
    05
    Pick your bowler
    union · literal types A bowler is fast, spin, or medium — nothing else.
    ~4 min Start →
    06
    Bowl one
    functions · params Call bowl(speed) — see the delivery on the pitch.
    ~5 min Start →
    07
    Helmet on?
    optional · default params Some things are optional. Some default to "yes."
    ~4 min Start →
    08
    Runs are limited
    type aliases A Run is 0, 1, 2, 3, 4, or 6. Never 5. Never -1.
    ~4 min Start →
    09
    How they're out
    enums Free Bowled, LBW, Caught, Run-out — a fixed set of options.
    ~4 min Start →
    10
    Test, ODI, or T20
    generics An Innings<T> behaves the same in every format.
    ~6 min Start →
    11
    All-rounders
    type narrowing · guards Some players bat AND bowl. Code that knows the difference.
    ~5 min Start →
    12TH
    MAN
    Bonus · Real IPL data modelling
    all 11 concepts A real-shape T20 match modelled in TypeScript. Every line tagged with which lesson it came from.
    ~8 min Read →
The Honours Board
4 mementos Finish all eleven lessons to claim your honours — a scorecard, a player card, a stadium moment, and a press clipping.
Locked 0 / 11 read
The Umpire's Codebook
PDF · 1 page Every concept, every metaphor, one printable sheet. Tuck it into your laptop case.
Download Open PDF →