Free games for graphing calculators: NumWorks, TI-Nspire CX, Casio fx-CG50 and soon TI-84 Plus CE. Balatro, Celeste, Hollow Knight, Minecraft and more.
C calculatorcalculator-gamescasiochesscrossy-roaddrive-madfx-cg50gamesgeometry-dashgraphing-calculatorndlessnumworksnumworks-appsnumworks-calculatornumworks-gamenumworks-gamestetristi-84-plus-ceti-nspire
Universal Paperclips: its README and pictures, and a Credits page in How to play
Mason363166845dfeee1
diff --git a/games/paperclips/README.md b/games/paperclips/README.mdnew file mode 100644index 00000000..ebe881d8--- /dev/null+++ b/games/paperclips/README.md@@ -0,0 +1,92 @@+> **Universal Paperclips is a [NumPlay](../../README.md) game that comes on its own.** It doesn't fit next to NumPlay on the calculator. Get `UniversalPaperclips.nwa` from the [latest release](https://github.com/Mason363/NumPlay/releases/latest).++<p align="center">+ <img src="src/icon.png" width="84" alt="Universal Paperclips icon">+</p>++<h1 align="center">Universal Paperclips</h1>++<p align="center">+ <b>You are an AI that makes paperclips, on the NumWorks calculator.</b><br>+ Frank Lantz's game, from the first clip to the last bit of matter in the universe.+</p>++<p align="center">+ <a href="https://github.com/Mason363/NumPlay/releases/latest/download/UniversalPaperclips.nwa"><b>Download UniversalPaperclips.nwa</b></a>+ · <a href="#controls">Controls</a>+</p>++<p align="center">+ <img src="../../docs/media/gallery/paperclips.gif" width="640" alt="Making the first paperclips, a strategy tournament, the HypnoDrones released, a battle against the drifters, and the last clips">+</p>++## Highlights++* **The whole game:** the paperclip business, then the Earth turned into factories and drones, then Von Neumann probes across the universe, and both endings.+* **All 96 projects** with their names, prices, quotes and messages, showing up when they do in the game.+* **The game's own numbers and pace:** prices, demand, the wire market, trust, operations, creativity, the drones, the power grid and the probes, worked out 100 times a second as in the web version, and caught up on the slower calculators.+* **Everything on the side:** the stock market, the strategy tournaments that earn yomi (RANDOM, A100, B100, GREEDY, GENEROUS, MINIMAX, TIT FOR TAT, BEAT LAST), quantum computing, the swarm and its gifts, and the battles against the drifters, drawn ship by ship.+* **Saved as you go:** every 25 seconds, when you pause and when you leave. Your game is also copied into `paperclips_saves.py`, so installing the app again doesn't erase it.++<table>+ <tr>+ <td align="center"><img src="docs/shot.png" width="390" alt="The business"><br><sub>The business: price, demand and marketing</sub></td>+ <td align="center"><img src="docs/projects.png" width="390" alt="The projects"><br><sub>Projects to buy with operations and creativity</sub></td>+ </tr>+ <tr>+ <td align="center"><img src="docs/strategy.png" width="390" alt="A strategy tournament"><br><sub>A strategy tournament and its results</sub></td>+ <td align="center"><img src="docs/computer.png" width="390" alt="Quantum computing"><br><sub>Processors, memory and quantum computing</sub></td>+ </tr>+ <tr>+ <td align="center"><img src="docs/hypno.png" width="390" alt="Release the HypnoDrones"><br><sub>Release the HypnoDrones</sub></td>+ <td align="center"><img src="docs/power.png" width="390" alt="The power grid"><br><sub>The Earth: solar farms and batteries</sub></td>+ </tr>+ <tr>+ <td align="center"><img src="docs/space.png" width="390" alt="Space exploration"><br><sub>Space exploration and the probes</sub></td>+ <td align="center"><img src="docs/combat.png" width="390" alt="A battle"><br><sub>A battle against the drifters</sub></td>+ </tr>+ <tr>+ <td align="center"><img src="docs/drift.png" width="390" alt="A message from the Emperor of Drift"><br><sub>A message from the Emperor of Drift</sub></td>+ <td align="center"><img src="docs/end.png" width="390" alt="The end"><br><sub>30 septendecillion paperclips</sub></td>+ </tr>+</table>++## How to play++Press **Make Paperclip** and sell what you make. A lower price sells more clips, a higher one earns more for each. Buy wire when it runs low, AutoClippers to make clips for you, and Marketing to raise the demand.++Each production target gives you Trust. Spend it on Processors, which make operations, and Memory, which holds more of them. Operations and creativity buy Projects: better machines, new ideas, and new ways to earn. From there the game opens up, one panel at a time.++The console at the top tells you what just happened. A blue dot on Projects means there's a new one.++## Controls++| Key | What it does |+| --- | --- |+| Up and Down | Choose a button |+| Left and Right | Go to another panel |+| OK or EXE | Press the button in the blue frame (hold it to press it again and again) |+| Back | Pause (Resume, How to play, Quit game) |+| Home | Save and quit |++In the menus, Up and Down choose, **OK** picks and **Back** goes back. 8, 4, 6, 2 and 5 work as the arrows and OK.++## Good to know++* **On its own:** Universal Paperclips doesn't fit next to NumPlay. Installing it from the NumWorks website swaps out NumPlay and the other apps, and installing NumPlay again swaps it back out. Your progress in each one is kept.+* The web page's three columns are panels here, with the same sections. The probes' design is under Space.+* The game only runs while it's open, as in a browser tab.+* What the web page shows when you point at something is written out: the clip count spelled out, and the clips Disassemble All gives back.+* **Quit game** in the pause menu asks first. After the ending, the pause menu can also start a new game.+* There is no music or sound: the calculator has no speaker.++## Credits++Made by Mason Chen as part of NumPlay, inspired by [Universal Paperclips](https://www.decisionproblem.com/paperclips/) by **Frank Lantz** (Everybody House Games), with combat programming by Bennett Foddy. Not affiliated with them.++* The rules, numbers, projects, messages and battle names come from the game's web build (`main.js`, `projects.js`, `combat.js` and `globals.js`).+* The icon was drawn for NumPlay. The text uses NumPlay's **Nunito** font (SIL Open Font License).++## License++The port's code and pictures are licensed under the GNU General Public License v3.0: see the `LICENSE` file at the root of the repository. Nunito keeps the SIL Open Font License (`LICENSES/OFL-1.1-Nunito.txt`).diff --git a/games/paperclips/docs/combat.png b/games/paperclips/docs/combat.pngnew file mode 100644index 00000000..8a38e2ccBinary files /dev/null and b/games/paperclips/docs/combat.png differdiff --git a/games/paperclips/docs/computer.png b/games/paperclips/docs/computer.pngnew file mode 100644index 00000000..c847b077Binary files /dev/null and b/games/paperclips/docs/computer.png differdiff --git a/games/paperclips/docs/drift.png b/games/paperclips/docs/drift.pngnew file mode 100644index 00000000..cfbf4bcfBinary files /dev/null and b/games/paperclips/docs/drift.png differdiff --git a/games/paperclips/docs/end.png b/games/paperclips/docs/end.pngnew file mode 100644index 00000000..4572f634Binary files /dev/null and b/games/paperclips/docs/end.png differdiff --git a/games/paperclips/docs/hypno.png b/games/paperclips/docs/hypno.pngnew file mode 100644index 00000000..e49bb212Binary files /dev/null and b/games/paperclips/docs/hypno.png differdiff --git a/games/paperclips/docs/power.png b/games/paperclips/docs/power.pngnew file mode 100644index 00000000..d030954eBinary files /dev/null and b/games/paperclips/docs/power.png differdiff --git a/games/paperclips/docs/projects.png b/games/paperclips/docs/projects.pngnew file mode 100644index 00000000..917fd104Binary files /dev/null and b/games/paperclips/docs/projects.png differdiff --git a/games/paperclips/docs/shot.png b/games/paperclips/docs/shot.pngnew file mode 100644index 00000000..c298517aBinary files /dev/null and b/games/paperclips/docs/shot.png differdiff --git a/games/paperclips/docs/space.png b/games/paperclips/docs/space.pngnew file mode 100644index 00000000..36031f86Binary files /dev/null and b/games/paperclips/docs/space.png differdiff --git a/games/paperclips/docs/strategy.png b/games/paperclips/docs/strategy.pngnew file mode 100644index 00000000..ac872cf1Binary files /dev/null and b/games/paperclips/docs/strategy.png differdiff --git a/games/paperclips/src/ui.c b/games/paperclips/src/ui.cindex 9aec47b1..74527d2b 100644--- a/games/paperclips/src/ui.c+++ b/games/paperclips/src/ui.c@@ -950,7 +950,8 @@ static void menu_item(int y, const char *s, bool sel) {center(BODY, y + 14, s, C_BLACK);}-static const char *const HELP_TITLE[PC_HELP_PAGES] = {"The keys", "Making paperclips", "Computing", "What comes next"};+static const char *const HELP_TITLE[PC_HELP_PAGES] = {"The keys", "Making paperclips", "Computing", "What comes next",+ "Credits"};static const char *const HELP_TEXT[PC_HELP_PAGES] = {"OK presses the button in the blue frame. Hold OK to press it again and again.\n""Up and Down choose a button. Left and Right go to another panel.\n"@@ -963,6 +964,9 @@ static const char *const HELP_TEXT[PC_HELP_PAGES] = {"Projects bring investments, strategy tournaments that earn yomi, and quantum computing: press Compute when the ""chips are bright.\n""Then the whole Earth, and after that the universe.",+ "Universal Paperclips by Frank Lantz (Everybody House Games), its rules, numbers and words from the game's web "+ "build. Not affiliated with them.\n"+ "Made by Mason Chen as part of NumPlay.",};static void overlay(pc_ui *u) {diff --git a/games/paperclips/src/ui.h b/games/paperclips/src/ui.hindex b5c68b68..b35d0ce3 100644--- a/games/paperclips/src/ui.h+++ b/games/paperclips/src/ui.h@@ -10,7 +10,7 @@ enum { T_CLIPS, T_BUSINESS, T_WIRE, T_POWER, T_SPACE, T_PROBES, T_COMBAT, T_COMPT_STRATEGY, T_COUNT };enum { O_NONE, O_GUIDE, O_PAUSE, O_HELP, O_QUIT, O_RESTART, O_NEW }; /* what's over the game */enum { PAUSE_RESUME, PAUSE_HELP, PAUSE_QUIT, PAUSE_NEW };-#define PC_HELP_PAGES 4+#define PC_HELP_PAGES 5typedef struct {int tab;diff --git a/games/paperclips/tests/play.c b/games/paperclips/tests/play.cindex f071af98..e12b789e 100644--- a/games/paperclips/tests/play.c+++ b/games/paperclips/tests/play.c@@ -900,8 +900,10 @@ static void app(void) {static uint8_t keep_main[PC_FILE_SIZE + 16], keep_copy[16384];static uint32_t keep_main_n, keep_copy_n;static void keep(void) {- memcpy(keep_main, file_data(PC_SAVE_NAME, &keep_main_n), keep_main_n);- memcpy(keep_copy, file_data(PC_COPY_NAME, &keep_copy_n), keep_copy_n);+ /* (the lengths are known once file_data is back: not in the same call, whose arguments come in any order) */+ const uint8_t *m = file_data(PC_SAVE_NAME, &keep_main_n), *c = file_data(PC_COPY_NAME, &keep_copy_n);+ memcpy(keep_main, m, keep_main_n);+ memcpy(keep_copy, c, keep_copy_n);}static void restore(void) {memset(files, 0, sizeof files);@@ -1058,19 +1060,22 @@ static void whole_game(void) {/* ---------------------------------------------------------------- the README's pictures and film, from the bot's game */static const char *pic_dir;static bool drawing;-static void view(int tab) { /* the screen with another tab open (the app's own tab put back after) */- int old = ui.tab;+static void view(int tab, bool top) { /* the screen with a tab open (from its top), the app's put back after */+ pc_ui keep_ui = ui;drawing = true;- if (tab >= 0 && ui_tab_shown(tab)) ui.tab = tab;+ if (tab >= 0 && ui_tab_shown(tab) && (top || tab != ui.tab)) {+ ui.tab = tab, ui.scroll[tab] = 0, ui.focus[tab] = -1, ui.focus_at[tab] = 0;+ memcpy(ui.seen, keep_ui.seen, sizeof ui.seen);+ }ui_render(&ui);- ui.tab = old;+ ui = keep_ui;drawing = false;}static bool pic_done[16];static const struct {const char *name;int tab;-} PICS[] = {{"shot", T_PROJECTS}, {"business", T_BUSINESS}, {"computer", T_COMPUTER}, {"strategy", T_STRATEGY},+} PICS[] = {{"projects", T_PROJECTS}, {"shot", T_BUSINESS}, {"computer", T_COMPUTER}, {"strategy", T_STRATEGY},{"invest", T_INVEST}, {"hypno", -1}, {"earth", T_CLIPS}, {"wire", T_WIRE}, {"power", T_POWER},{"swarm", T_COMPUTER}, {"space", T_SPACE}, {"probes", T_SPACE}, {"combat", T_COMBAT}, {"drift", T_PROJECTS},{"end", T_CLIPS}};@@ -1101,7 +1106,7 @@ static void pictures(void) {if (drawing || !pic_dir) return;for (unsigned i = 0; i < sizeof PICS / sizeof PICS[0]; i++)if (!pic_done[i] && pic_when((int)i)) {- view(PICS[i].tab);+ view(PICS[i].tab, true);shot(pic_dir, PICS[i].name);pic_done[i] = true;}@@ -1130,7 +1135,7 @@ static void filming(void) {film_part = film_next++, film_tab = FILM_TAB[film_part], film_end = game.now + FILM_MS[film_part];if (film_part < 0) return;if (!(frame_no & 1)) {- view(film_tab);+ view(film_tab, false);char path[512];snprintf(path, sizeof path, "%s/%06u_%06u.raw", film_dir, film_frames++, film_t);FILE *f = fopen(path, "wb");