pisan-labs

Elevator Algorithm Lab — Development skill for Claude Code

Development community

Write an elevator dispatch policy in JavaScript, run it on seeded traffic in an animated building, and flip to a disk view showing that FCFS, SSTF, SCAN and LOOK are disk-scheduling algorithms, with w.

How to install Elevator Algorithm Lab

This entry records only its repository, not the path inside it, so there is no exact command to give. Open pisan-labs/elevator-algorithm-lab and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

What Elevator Algorithm Lab does

Write an elevator dispatch policy in JavaScript, run it on seeded traffic in an animated building, and flip to a disk view showing that FCFS, SSTF, SCAN and LOOK are disk-scheduling algorithms, with wait, starvation and energy metrics. Built with Claude Code.

Alternatives in Development

  • JS To TS — JavaScript to TypeScript Migration Command 74.5k ★
  • JWT Scan — JWT attack toolkit (offline) — alg:none forgery, RS256→HS256 algorithm confusion, weak-secret crack, static cl 4.5k ★
  • Developing Genkit JS — Firebase GenKit development with JavaScript 171 ★

README

Elevator Algorithm Lab

**Write an elevator dispatch policy in JavaScript, run it against seeded traffic in an animated building, and flip to the disk view to see that FCFS, SSTF, SCAN and LOOK are elevator algorithms.** Operating systems courses teach disk scheduling as lists of cylinder numbers; here the same policies move a car past waiting passengers, every run reports mean, p95 and max wait (starvation) plus energy, two policies can be replayed side by side on the same trace, and the identical run can be drawn as a head sweeping across cylinders with time flowing down, the textbook diagram. Everything runs in the browser; nothing is uploaded.

Live: [elevator-algorithm-lab.hintwise.org](https://elevator-algorithm-lab.hintwise.org)

![The textbook disk trace runs LOOK and SSTF side by side, first as a disk head moving like an elevator car, then in disk view as the classic sweep diagram, ending on the metrics: 208 versus 236 cylinders of head movement](demo.gif)

Implements idea #2 ("Elevator Algorithm Lab") from the [2026-09-29 ideas day](https://github.com/pisanuw/daily-project-ideas) of `pisanuw/daily-project-ideas`.

What it does

  • A policy is one function. dispatch(car, state) is called whenever a car is idle or has just finished a stop and returns the next floor (or null to stay). It sees the car (floor, direction, load, destinations aboard), every other car, and the hall calls grouped by floor and direction with counts and ages. Helpers pending, nearest and heading are prepended to the code and shown in the API panel. Top-level variables persist between calls, which is how C-LOOK remembers its sweep direction.
  • Six presets to start from, all written in the same student-facing JavaScript: FCFS, SSTF, SCAN, LOOK, C-LOOK and a zoned LOOK for several cars. On the textbook trace (200 cylinders, head at 53 moving toward 0, queue 98 183 37 122 14 124 65 67) they move 640, 236, 236, 208 and 326 cylinders, the numbers fr