Skip to content

quinniscoding/fluency-drill

Repository files navigation

fluency-drill

Terminal practice tool for building muscle memory and fluency with the syntax and idioms of a programming language. Drill methods, work through progressively harder exercises, and resume mid-session.

npx fluency-drill

or install globally with your package manager of choice:

npm i -g fluency-drill        # or: pnpm add -g fluency-drill
fluency-drill

Requires Node.js ≥ 18. The Python curricula additionally need python3 on your PATH; the data-science / research curricula optionally need numpy, pandas, scipy, or matplotlib for their exercises (the drills work without them).

What it does

For each language, the game exposes a list of fluency entries — one per method, idiom, or quirk. For each entry you can:

  1. Drill — type the entry's canonical syntax and 2–7 common variations, 10× per variation by default (5× in "quick" mode). Matching is fuzzy: whitespace, quote style, and trailing semicolons are normalized. Each variation shows an input and the resulting output, so you're not typing in the dark.

  2. Exercises — a worked example, then progressively harder problems that end at "real-world repo usage". Your code is sandboxed, run, and compared to the expected output.

  3. Both — drill, then exercises, in one go.

Progress saves per-curriculum after every successful rep. :quit mid-drill and resume from the same variation + rep number next session.

Languages and curricula

Out of the box:

  • JavaScript — arrays, strings, objects, Map/Set, promises, JSON, quirks (sort default, == vs ===, closure capture, …), interview syntax drills (counter idioms, set-visited, grid init, bit tricks, binary search building blocks).

  • Python — iterables / comprehensions, strings (f-strings), dicts, sequence slicing, collections (Counter / defaultdict / deque), itertools, functools, pathlib, datetime, json, asyncio.gather, quirks (mutable defaults, is vs ==, late-binding closures, …), interview syntax drills (Counter, set, grid init, bisect, heapq).

  • Python · Data Sciencenumpy array basics; pandas DataFrame basics (filtering, new columns).

  • Python · Data Engineering — stdlib csv (Reader / DictWriter); stdlib sqlite3 (parameterized queries, executemany, group-by).

  • Python · Researchscipy.stats / scipy.optimize; matplotlib.pyplot.

The menu detects missing prerequisites and gracefully skips exercises that need an uninstalled library (drills always work).

In-game commands

In drill:

  • :show peek the target syntax for the current variation
  • :skip move on to the next variation
  • :quit exit (state is saved — resume next session)

In exercises:

  • :hint show the entry's hint, if any
  • :solve reveal the expected output and move on
  • :skip skip this exercise
  • :quit exit

In menus:

  • R reset all progress for the current language
  • x (submenu) reset progress for one method
  • L switch language

Adding a curriculum

Each language is one file in src/curriculum/. Drop a file and add an import in src/curriculum/index.js — the menu auto-detects. See CLAUDE.md for the full data shape and the requires schema for gating exercises behind installable prerequisites.

License

MIT

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors