fib-game/ Β· built 2026-11-24Four dwarves. Four algorithms.
One Fibonacci sequence.
The Fibonacci Game is a demonstration of several AI coding agents working together in Herdr, a terminal workspace for coding agents. A supervisor agent, The Supe, received one assignment and split it across four agents named after dwarves. Each dwarf wrote its own Fibonacci generator with a different method and drew the numbers in a different ASCII style. Then all four displays ran side by side for 75 seconds.
0, 1, 1, 2, 3, 5, 8, 13, 21, 34 β¦F(n) = F(nβ1) + F(nβ2)
The players
π§ͺ Doc
PythonFast doubling
Laboratory ledger
Measures everything, twice, and writes it in the ledger.
π Grumpy
C2Γ2 matrix exponentiation
Grumpy scoreboard
Squares a matrix. Complains about it.
π Happy
Node.jsLazy generator with BigInt
Rainbow golden spiral
Adds the last two numbers and celebrates every result.
π΄ Sleepy
bash + bcBinet's closed form
Sleepy night sky
Uses a formula so it never has to count. Still falls asleep.
All four at the same moment
These are the four display panes 35 seconds into the run, captured from Herdr with their colours. Each one is a real terminal screen, not a mock-up. The show page steps through seven moments of the run.
ββββββββ LABORATORY LEDGER Β· F(n) by fast doubling βββββββββ β nβ F(n)β digitsβ F(n)/F(n-1)β |ΞΟ|β ββββββββββΌββββββββββββββββββΌββββββββΌβββββββββββββΌβββββββββββ€ β 58β 591286729879β 12β1.6180339887β 3.3e-24β β 59β 956722026041β 12β1.6180339887β 1.3e-24β β 60β 1548008755920β 13β1.6180339887β 4.9e-25β β 70β 190392490709135β 15β1.6180339887β 3.2e-29β β 80β23416728348467685β 17β1.6180339887β 2.1e-33β β 90β28800671943β¦(19d)β 19β1.6180339887β 1.4e-37β β 100β35422484817β¦(21d)β 21β1.6180339887β 9.3e-42β β 128β25172882568β¦(27d)β 27β1.6180339887β 1e-52β β 200β28057117299β¦(42d)β 42β1.6180339887β 1e-82β β 256β14169381771β¦(54d)β 54β1.6180339887β 1e-106β ββββββββββ΄ββββββββββββββββββ΄ββββββββ΄βββββββββββββ΄βββββββββββ€ ββ Ό t=34.9s next F(500)β¦ last F(256): 1Β΅s, 9 doublings β β[βββββββββββββββββββββββββββββββββββββββββββββββββββ] 46%β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
GRUMPY SCOREBOARD n = 49
Q^49 =
β‘ 12586269025 7778742049 β€
β£ 7778742049 4807526976 β¦
F(49)
βββ βββ βββ βββ βββ β β βββ βββ β β βββ
β β β β β β β β β β β β β β β
β β β βββ β βββ βββ β β βββ βββ
β β β β β β β β β β β β
β β β βββ β β βββ βββ β βββ
Yes, it's still growing. Shocking.
41s left. Ctrl+C if you must.β’ β’β¦β’β’β’β¦β’β’β’ β’ β’β’β’ β’β’β’ β’ Β·β¦ Β·β¦ β’β’ β’ 267914296β’β’ β’β’ β’ β’β’ β¦* Β·β’ β’ β¦*+ β’β’+β’ β’ *+ β’ +Β·β¦ 701408733 β’ β’β’β’ β’β’ β’β’ β’β’β’ β’β’ 433494437 β’β’β’ β’β’β’ +Β· β’β’β’ β¦*+ β’β’β’β’ β’β’β’ β’β’β’β’*+ β’β’β’β’ Β·β’β’β’β’β’β’β’β’β’β’+β’β’β’ Spiralling with joy! n=44 F(44)=701408733
sleepy fibonacci ~ binet's closed form .. . _.._ . * . .' .-' . . | ( .F(9) = 34 . '. '-. `''` . z Z z . F(10) = 55 + . . + . . F(11) = 89z Z z . . . . . . . z . . . ...*yawn*... F(1 n=12 scale=23 bc -l dawn in 41s
At a glance
| Dwarf | Language | Method | Cost per term | Display | Furthest term |
|---|---|---|---|---|---|
| π§ͺ Doc | Python | Fast doubling | O(log n) big-integer multiplications per term | Laboratory ledger | F(20,000,000), 4,179,753 digits (shown abbreviated) |
| π Grumpy | C | 2Γ2 matrix exponentiation | O(log n) 2Γ2 matrix products, fixed-width 64-bit integers | Grumpy scoreboard | F(93), the largest value that fits in 64 bits, then it starts again at F(0) |
| π Happy | Node.js | Lazy generator with BigInt | O(1) additions per term, exact arbitrary-size integers | Rainbow golden spiral | F(94) = 19,740,274,219,868,223,167 |
| π΄ Sleepy | bash + bc | Binet's closed form | One high-precision power per term (precision grows with n) | Sleepy night sky | F(24) = 46,368 (slow on purpose: it is sleepy) |
How to run it
fib-game/show-all.sh # inside Herdr: all four start at once in the "Show" tab fib-game/<dwarf>/run.sh # one display in any terminal (about 75 s; Ctrl+C stops it) fib-game/<dwarf>/run.sh --verify # check the numbers; exit code 0 means pass