Shared leaderboard, a games hub, AGPL, and two new street conditions

The high score table moves out of the browser and into a service, so
every player is on one board. It is a Node process with SQLite, no build
step and no native modules - node:sqlite ships with the runtime and Node
runs the TypeScript directly.

Everything in a request is treated as hostile: names forced to a
printable subset, every number range-checked, and scores refused if they
could not have happened in the days claimed. Bodies capped, submissions
rate limited per address. It still cannot prove a score is real, and
server/README.md says so plainly rather than implying otherwise.

The game degrades properly without it: the board says it cannot reach
town, posting happens behind the closing standings, and play is
untouched.

Deployment is three containers behind the host's nginx - the hub at /,
the game at /lemonade/, the scores service at /api/ - so the game keeps
its own container and a second game is just another service.

Licensing: AGPL-3.0-or-later, Affero because the leaderboard is a network
service. NOTICE.md credits Bob Jamison and Charlie Kellner, records that
this is clean-room work, and is honest about the one thing it is not:
some on-screen wording is quoted from the original and cannot be
licensed by us.

The street can now get better as well as worse. The summer fair brings
the town out and lifts what they will pay; a rival on the next corner
takes a share and lingers. Both show in the art and in the crowd. Over
500 seasons a player who reads the briefing survives every time and
finishes around $25.80; one who ignores it goes broke 70% of the time.
This commit is contained in:
2026-09-08 16:17:47 -07:00
parent 7fcb863771
commit 8a5d0cb6df
30 changed files with 1824 additions and 130 deletions
+82
View File
@@ -0,0 +1,82 @@
# Notice, credits and provenance
## What this is
An independent reimplementation of the lemonade-stand business simulation that
went round schools and home computers from the 1970s onward, written from
scratch in TypeScript in 2026.
## Credit where it is due
- **Bob Jamison**, Minnesota Educational Computing Consortium (MECC), 1973 —
wrote the original *Lemonade Stand* for time-shared systems.
- **Charlie Kellner**, 1979 — wrote the Apple II version that most people
actually remember, distributed by Apple Computer.
- Every magazine and type-in book that carried a listing of it, which is how a
lot of us first met the thing.
This project is not affiliated with, endorsed by, or connected to MECC, its
successors, or Apple. No original source code was used, consulted or copied.
## How this code came to exist
Clean-room, and worth being specific about because it is what makes the licence
below meaningful:
- **The simulation is ours.** The demand curve, the weather profiles, the sign
returns and the event probabilities in `src/game/constants.ts` are a
reconstruction, tuned by running several hundred headless seasons until the
game *behaved* the way it is remembered. It is not the original arithmetic,
and it is documented as a reconstruction in the source.
- **The rules are not ours to own.** Buy glasses, buy signs, set a price, read
the weather — game mechanics are ideas rather than expression, and nobody
gets to fence them off. We use them freely and so may you.
- **The artwork and the music are ours.** Every pixel is SVG drawn in code and
every note is generated by the synth in `src/audio/`. There are no imported
assets of any kind.
## The one place we are standing on someone else's work
Some **on-screen wording** is reproduced from the original from memory, because
it is the part people remember word for word:
| Where | Text |
| --- | --- |
| `IntroScreen.tsx` | "HI! WELCOME TO LEMONSVILLE, CALIFORNIA!" and the paragraph after it |
| `ReportScreen.tsx` | "$$ LEMONSVILLE DAILY FINANCIAL REPORT $$" |
| `TradingScreen.tsx` | the thunderstorm message |
| `BriefingScreen.tsx` | the street-crew and heat-wave messages |
Short functional labels (`GLASSES SOLD`, `WEATHER REPORT: SUNNY`) are hard to
express any other way and are not really anyone's creative property. The longer
passages are a different matter: they are someone's writing, quoted here as
homage rather than authored by us. We cannot license what we did not write, so
that wording is **not** covered by this project's licence and is used on a
fair-use/de-minimis footing.
If that footing is not comfortable for a given use, the fix is small and
self-contained: rewrite those few strings in your own voice. Nothing else in
the project depends on them.
The name *Lemonade Stand* is descriptive and is used descriptively. It is not
claimed as a mark of this project.
## Licence
Copyright (C) 2026 John Coffey.
This program is free software: you can redistribute it and/or modify it under
the terms of the **GNU Affero General Public License** as published by the Free
Software Foundation, either version 3 of the License, or (at your option) any
later version — see [LICENSE](LICENSE).
AGPL rather than plain GPL because the leaderboard is a network service: §13
means anyone who runs a modified copy of this for other people over a network
has to offer them its source. Running the game without the scores service is
entirely supported and imposes nothing extra.
This program is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
*None of the above is legal advice.*