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
Imposter: the same screen for every role, only the words tell
Mason363d9cd06578a05
diff --git a/README.md b/README.mdindex 5db9850f..8ddc7ed7 100644--- a/README.md+++ b/README.md@@ -28,7 +28,7 @@</p><p align="center">- <a href="#how-to-install"><b>How to install</b></a> · <a href="#other-calculators"><b>Other calculators</b></a> · <a href="docs/play.md"><b>How to play</b></a> · <a href="https://github.com/Mason363/NumPlay/releases/latest"><b>All downloads</b></a> · <a href="CHANGELOG.md"><b>What's new</b></a> · <a href="#roadmap"><b>Roadmap</b></a> · <a href="docs/make-a-game.md"><b>Make a game</b></a>+ <a href="#how-to-install"><b>How to install</b></a> · <a href="#pick-your-calculator"><b>Pick your calculator</b></a> · <a href="docs/play.md"><b>How to play</b></a> · <a href="https://github.com/Mason363/NumPlay/releases/latest"><b>All downloads</b></a> · <a href="CHANGELOG.md"><b>What's new</b></a> · <a href="#roadmap"><b>Roadmap</b></a> · <a href="docs/make-a-game.md"><b>Make a game</b></a></p><p align="center">@@ -38,7 +38,7 @@⭐ **Enjoying NumPlay?** Give it a star at the top of this page: it takes a second and helps other people find it.<br>💡 **Want a game that isn't here?** Check the [roadmap](#roadmap) first, then [ask for it in an issue](https://github.com/Mason363/NumPlay/issues/new/choose).-## Other calculators+## Pick your calculator<p align="center"><img src="docs/media/calcs/lineup.png" width="720" alt="A NumWorks, a TI-84 Plus CE, a TI-Nspire CX II, a Casio fx-CG50 and a Casio Graph 35+E II"></p>@@ -47,10 +47,11 @@<table><tr>- <td align="center" width="25%"><a href="docs/calculators/ti-84-plus-ce.md"><img src="docs/media/calcs/ti84ce.png" height="150" alt="TI-84 Plus CE"><br><b>TI-84 Plus CE</b></a><br><sub>and TI-83 Premium CE<br>15 games</sub></td>- <td align="center" width="25%"><a href="docs/calculators/ti-nspire.md"><img src="docs/media/calcs/nspire.png" height="150" alt="TI-Nspire CX II"><br><b>TI-Nspire CX</b></a><br><sub>CX and CX II, with Ndless<br>78 games</sub></td>- <td align="center" width="25%"><a href="docs/calculators/casio-fx-cg50.md"><img src="docs/media/calcs/casio_cg50.png" height="150" alt="Casio fx-CG50"><br><b>Casio fx-CG50</b></a><br><sub>and Graph 90+E, fx-CG10, fx-CG20<br>73 games</sub></td>- <td align="center" width="25%"><a href="docs/porting.md"><img src="docs/media/calcs/raspberrypi.png" height="110" alt="A Raspberry Pi 5"><br><b>Anything else</b></a><br><sub>a computer, a Raspberry Pi,<br>a board with a screen</sub></td>+ <td align="center" width="20%"><a href="docs/calculators/numworks.md"><img src="docs/media/calcs/numworks.png" height="150" alt="NumWorks"><br><b>NumWorks</b></a><br><sub>N0110, N0115, N0120<br>29 games, 48 big games</sub></td>+ <td align="center" width="20%"><a href="docs/calculators/ti-84-plus-ce.md"><img src="docs/media/calcs/ti84ce.png" height="150" alt="TI-84 Plus CE"><br><b>TI-84 Plus CE</b></a><br><sub>and TI-83 Premium CE<br>15 games</sub></td>+ <td align="center" width="20%"><a href="docs/calculators/ti-nspire.md"><img src="docs/media/calcs/nspire.png" height="150" alt="TI-Nspire CX II"><br><b>TI-Nspire CX</b></a><br><sub>CX and CX II, with Ndless<br>78 games</sub></td>+ <td align="center" width="20%"><a href="docs/calculators/casio-fx-cg50.md"><img src="docs/media/calcs/casio_cg50.png" height="150" alt="Casio fx-CG50"><br><b>Casio fx-CG50</b></a><br><sub>and Graph 90+E, fx-CG10, fx-CG20<br>73 games</sub></td>+ <td align="center" width="20%"><a href="docs/porting.md"><img src="docs/media/calcs/raspberrypi.png" height="110" alt="A Raspberry Pi 5"><br><b>Anything else</b></a><br><sub>a computer, a Raspberry Pi,<br>a board with a screen</sub></td></tr></table>@@ -382,13 +383,8 @@ Read **[Make your own NumWorks game](docs/make-a-game.md)** to go from there, an- [x] Kingdom Rush: the heroes- [x] Retro-Go: ROMs trimmed of their padding, so more of them fit- [x] More of Retro-Go: Game & Watch and Mega Drive-- [ ] Full Minecraft 1.18.2 as a standalone app- [ ] Into the Breach- [ ] A racing game: F1 or GT3-- [ ] Ori and the Blind Forest-- [ ] Hades-- [ ] Super Smash Bros-- [ ] Rocket League- [ ] Deltarune: the rest of Chapter 1 (the Forest, the shops, the Card Castle, Jevil, the King), and each later chapter as an app of its own- [ ] Hollow Knight: more of Hallownest past Mantis Village (the rest of the Fungal Wastes, the City of Tears and on)- [ ] Hill Climb Racing: the stages and vehicles added after version 1.10.2@@ -399,9 +395,7 @@ Read **[Make your own NumWorks game](docs/make-a-game.md)** to go from there, an- [ ] Hotline Miami- [ ] Brawl Stars, against bots- [ ] Papers, Please, with the story and Endless-- [ ] Mario Kart- [ ] OMORI-- [ ] The Legend of Zelda: Ocarina of Time- [ ] florr.io- [ ] Rider Worlds- [ ] Hollow Knight: Godhome, its boss fights in an app of their own@@ -410,8 +404,6 @@ Read **[Make your own NumWorks game](docs/make-a-game.md)** to go from there, an- [ ] Getting Over It- [ ] Hill Climb Racing 2- [ ] Hill Climb Racing in 3D, with a scooter, a BMX, a skateboard and roller skates-- [ ] Advance Wars-- [ ] Half-Life- [ ] Dog Hotel- [ ] Kingdom Rush: Frontiers, Origins and Vengeance- [ ] Cult of the Lambdiff --git a/docs/calculators/numworks.md b/docs/calculators/numworks.mdnew file mode 100644index 00000000..e75e329f--- /dev/null+++ b/docs/calculators/numworks.md@@ -0,0 +1,115 @@+# NumPlay on the NumWorks++<img src="../media/calcs/numworks.png" height="200" align="right" alt="NumWorks">++29 free games in one app, NumPlay.nwa, and 48 big games that install on their own. For the N0110, N0115 and N0120.++## Install++You need your calculator, its USB cable, and a computer with **Google Chrome** or **Microsoft Edge**.++1. **Download** [NumPlay.nwa](https://github.com/Mason363/NumPlay/releases/latest/download/NumPlay.nwa), or a big game below. Want other games in it? Pick them in [NumPlay Studio](https://mason363.github.io/NumPlay/customize/) and it makes a NumPlay.nwa with just those.+2. **Plug** your calculator into the computer and turn it on.+3. **Go to** [my.numworks.com/apps](https://my.numworks.com/apps) and log in. No account? Sign up there, it's free.+4. Click **Connect**, then pick your calculator in the small window that opens.+5. **Add** the file you downloaded, then click **Install**. Keep the calculator plugged in until it's done.+6. **Play!** Press **Home**, go to the end of the apps and open **NumPlay**.++Updating? Install the new file the same way: your progress comes back by itself. On Upsilon, see [Other versions](../../README.md#how-to-install).++## Keys++The games use the calculator's own keys: arrows to move, **OK** and **EXE** to act, **Back** to pause or go back, and **Home** to save and quit.++## The 29 games in NumPlay.nwa++| Game | |+| --- | --- |+| [NumDash](../../games/numdash/README.md) | Jump to the beat |+| [Crossy Road](../../games/crossyroad/README.md) | Hop, dodge, survive |+| [NumBlocks](../../games/numblocks/README.md) | Mine, craft, survive |+| [NumDrive](../../games/numdrive/README.md) | Drive, flip, finish |+| [Balatro](../../games/balatro/README.md) | Poker hands, wild jokers |+| [Buckshot Roulette](../../games/buckshot/README.md) | You, the Dealer, one shotgun |+| [Block Blast](../../games/blockblast/README.md) | Fit the blocks, blast the lines |+| [Suika Game](../../games/suika/README.md) | Merge the fruit into a watermelon |+| [Portal Returns](../../games/portal/README.md) | Think with portals |+| [Tetris](../../games/tetris/README.md) | Stack and clear lines |+| [Chrome Dino](../../games/dinorun/README.md) | Jump, duck, survive |+| [Doodle Jump](../../games/doodlejump/README.md) | Bounce as high as you can |+| [Chess](../../games/chess/README.md) | Bots, puzzles, 2 players |+| [Flappy Bird](../../games/flappybird/README.md) | Flap through the pipes |+| [Flappy Dunk](../../games/flappydunk/README.md) | Flap the ball down through every hoop |+| [Tower Blocks](../../games/towerblock/README.md) | Stack the blocks as high as you can |+| [Core Ball](../../games/coreball/README.md) | Stick every ball to the spinning core |+| [Pac-Man](../../games/pacman/README.md) | Eat dots, dodge ghosts |+| [Snake](../../games/snake/README.md) | Eat apples, grow long |+| [Connect Four](../../games/connectfour/README.md) | Four in a row wins |+| [Solitaire](../../games/solitaire/README.md) | The classic card game |+| [2048](../../games/g2048/README.md) | Slide, merge, reach 2048 |+| [Minesweeper](../../games/minesweeper/README.md) | Clear the field, flag the mines |+| [Block Breaker](../../games/breakout/README.md) | Break every brick |+| [2 Players](../../games/twoplayer/README.md) | Pong and more, side by side |+| [Space Invaders](../../games/invaders/README.md) | Stop the invasion, one cannon |+| [Sudoku](../../games/sudoku/README.md) | Fill the grid, 1 to 9 |+| [Ultimate Tic-Tac-Toe](../../games/uttt/README.md) | Tic-tac-toe in tic-tac-toe |+| [Sokoban](../../games/sokoban/README.md) | Push every box home |++## The 48 big games++Each one installs on its own, the same way.++| Game | | Download |+| --- | --- | --- |+| [Hollow Knight](../../games/hollowknight/README.md) | Explore Hallownest | [HollowKnight.nwa](https://github.com/Mason363/NumPlay/releases/latest/download/HollowKnight.nwa) |+| [Celeste](../../games/celeste/README.md) | Climb the mountain | [Celeste.nwa](https://github.com/Mason363/NumPlay/releases/latest/download/Celeste.nwa) |+| [Undertale](../../games/undertale/README.md) | Fall into the Underground | [Undertale.nwa](https://github.com/Mason363/NumPlay/releases/latest/download/Undertale.nwa) |+| [Friday Night Funkin'](../../games/fnf/README.md) | Win the rap battles, note by note | [FridayNightFunkin.nwa](https://github.com/Mason363/NumPlay/releases/latest/download/FridayNightFunkin.nwa) |+| [Angry Birds](../../games/angrybirds/README.md) | Fling the birds at the pigs | [AngryBirds.nwa](https://github.com/Mason363/NumPlay/releases/latest/download/AngryBirds.nwa) |+| [Subway Surfers](../../games/subway/README.md) | Dodge the trains | [SubwaySurfers.nwa](https://github.com/Mason363/NumPlay/releases/latest/download/SubwaySurfers.nwa) |+| [Jetpack Joyride](../../games/jetpackjoyride/README.md) | Fly Barry through the lab | [JetpackJoyride.nwa](https://github.com/Mason363/NumPlay/releases/latest/download/JetpackJoyride.nwa) |+| [Monkey Mart](../../games/monkeymart/README.md) | Run a grocery mart as a monkey | [MonkeyMart.nwa](https://github.com/Mason363/NumPlay/releases/latest/download/MonkeyMart.nwa) |+| [Plants vs. Zombies](../../games/pvz/README.md) | Plant your lawn | [PlantsVsZombies.nwa](https://github.com/Mason363/NumPlay/releases/latest/download/PlantsVsZombies.nwa) |+| [Tomb of the Mask](../../games/tombofthemask/README.md) | Dash through the tomb ahead of the lava | [TombOfTheMask.nwa](https://github.com/Mason363/NumPlay/releases/latest/download/TombOfTheMask.nwa) |+| [Stickman Hook](../../games/stickmanhook/README.md) | Swing from hook to hook | [StickmanHook.nwa](https://github.com/Mason363/NumPlay/releases/latest/download/StickmanHook.nwa) |+| [Dune](../../games/dune/README.md) | Roll down the dunes and fly over the line | [Dune.nwa](https://github.com/Mason363/NumPlay/releases/latest/download/Dune.nwa) |+| [Doom](../../games/doom/README.md) | Rip and tear | [Doom.nwa](https://github.com/Mason363/NumPlay/releases/latest/download/Doom.nwa) |+| [UNO](../../games/uno/README.md) | Match the cards, shout UNO | [UNO.nwa](https://github.com/Mason363/NumPlay/releases/latest/download/UNO.nwa) |+| [Mahjong](../../games/mahjong/README.md) | Match free tiles, clear the board | [Mahjong.nwa](https://github.com/Mason363/NumPlay/releases/latest/download/Mahjong.nwa) |+| [Five Nights at Freddy's](../../games/fnaf/README.md) | Survive five nights | [FiveNightsAtFreddys.nwa](https://github.com/Mason363/NumPlay/releases/latest/download/FiveNightsAtFreddys.nwa) |+| [Donkey Kong](../../games/donkeykong/README.md) | Climb the girders and save Pauline | [DonkeyKong.nwa](https://github.com/Mason363/NumPlay/releases/latest/download/DonkeyKong.nwa) |+| [NumPowder](../../games/numpowder/README.md) | Sand, water, fire and more | [NumPowder.nwa](https://github.com/Mason363/NumPlay/releases/latest/download/NumPowder.nwa) |+| [Sonic the Hedgehog](../../games/sonic/README.md) | Run through six zones | [SonicTheHedgehog.nwa](https://github.com/Mason363/NumPlay/releases/latest/download/SonicTheHedgehog.nwa) |+| [The Binding of Isaac](../../games/isaac/README.md) | Cry through the basement | [BindingOfIsaac.nwa](https://github.com/Mason363/NumPlay/releases/latest/download/BindingOfIsaac.nwa) |+| [Hill Climb Racing](../../games/hillclimb/README.md) | Drive up, don't flip | [HillClimbRacing.nwa](https://github.com/Mason363/NumPlay/releases/latest/download/HillClimbRacing.nwa) |+| [PolyTrack](../../games/polytrack/README.md) | Time trials on 17 low-poly tracks | [PolyTrack.nwa](https://github.com/Mason363/NumPlay/releases/latest/download/PolyTrack.nwa) |+| [Champion Island](../../games/championisland/README.md) | Seven sports, one island | [ChampionIsland.nwa](https://github.com/Mason363/NumPlay/releases/latest/download/ChampionIsland.nwa) |+| [The Final Earth 2](../../games/finalearth2/README.md) | Build a city in space | [FinalEarth2.nwa](https://github.com/Mason363/NumPlay/releases/latest/download/FinalEarth2.nwa) |+| [Level Devil](../../games/leveldevil/README.md) | Run to the door | [LevelDevil.nwa](https://github.com/Mason363/NumPlay/releases/latest/download/LevelDevil.nwa) |+| [Cookie Clicker](../../games/cookieclicker/README.md) | Bake billions of cookies | [CookieClicker.nwa](https://github.com/Mason363/NumPlay/releases/latest/download/CookieClicker.nwa) |+| [Universal Paperclips](../../games/paperclips/README.md) | Turn everything into paperclips | [UniversalPaperclips.nwa](https://github.com/Mason363/NumPlay/releases/latest/download/UniversalPaperclips.nwa) |+| [Bad Time Simulator](../../games/badtime/README.md) | Dodge Sans' 24 attacks | [BadTimeSimulator.nwa](https://github.com/Mason363/NumPlay/releases/latest/download/BadTimeSimulator.nwa) |+| [Rider](../../games/rider/README.md) | Ride, flip, land on both wheels | [Rider.nwa](https://github.com/Mason363/NumPlay/releases/latest/download/Rider.nwa) |+| [Snow Rider 3D](../../games/snowrider/README.md) | Sled down the endless slope | [SnowRider3D.nwa](https://github.com/Mason363/NumPlay/releases/latest/download/SnowRider3D.nwa) |+| [Temple Run](../../games/templerun/README.md) | Run from the temple, turn, jump, slide | [TempleRun.nwa](https://github.com/Mason363/NumPlay/releases/latest/download/TempleRun.nwa) |+| [Five Nights at Freddy's 2](../../games/fnaf2/README.md) | Survive the new pizzeria | [FiveNightsAtFreddys2.nwa](https://github.com/Mason363/NumPlay/releases/latest/download/FiveNightsAtFreddys2.nwa) |+| [Famidash](../../games/famidash/README.md) | Geometry Dash for the NES: 173 levels | [Famidash.nwa](https://github.com/Mason363/NumPlay/releases/latest/download/Famidash.nwa) |+| [Five Nights at Freddy's 3](../../games/fnaf3/README.md) | Survive Fazbear's Fright | [FiveNightsAtFreddys3.nwa](https://github.com/Mason363/NumPlay/releases/latest/download/FiveNightsAtFreddys3.nwa) |+| [Five Nights at Freddy's 4](../../games/fnaf4/README.md) | Survive the bedroom | [FiveNightsAtFreddys4.nwa](https://github.com/Mason363/NumPlay/releases/latest/download/FiveNightsAtFreddys4.nwa) |+| [Clash Royale](../../games/clashroyale/README.md) | Knock down the towers | [ClashRoyale.nwa](https://github.com/Mason363/NumPlay/releases/latest/download/ClashRoyale.nwa) |+| [Cat Ninja](../../games/catninja/README.md) | Wall jumps, traps and 50 crystals | [CatNinja.nwa](https://github.com/Mason363/NumPlay/releases/latest/download/CatNinja.nwa) |+| [Kingdom Rush](../../games/kingdomrush/README.md) | Defend the realm with towers | [KingdomRush.nwa](https://github.com/Mason363/NumPlay/releases/latest/download/KingdomRush.nwa) |+| [Deltarune](../../games/deltarune/README.md) | Chapter 1: into the Dark World | [Deltarune.nwa](https://github.com/Mason363/NumPlay/releases/latest/download/Deltarune.nwa) |+| [FNAF World](../../games/fnafworld/README.md) | Battle through the world | [FiveNightsAtFreddysWorld.nwa](https://github.com/Mason363/NumPlay/releases/latest/download/FiveNightsAtFreddysWorld.nwa) |+| [Mr Bullet](../../games/mrbullet/README.md) | Bounce the bullets, get the spies | [MrBullet.nwa](https://github.com/Mason363/NumPlay/releases/latest/download/MrBullet.nwa) |+| [NumPico](../../games/numpico/README.md) | Your own PICO-8 carts | [NumPico.nwa](https://github.com/Mason363/NumPlay/releases/latest/download/NumPico.nwa) |+| [Moto X3M](../../games/motox3m/README.md) | Flip the bike, beat the clock | [MotoX3M.nwa](https://github.com/Mason363/NumPlay/releases/latest/download/MotoX3M.nwa) |+| [Among Us](../../games/amongus/README.md) | Find the Impostor, or be one | [AmongUs.nwa](https://github.com/Mason363/NumPlay/releases/latest/download/AmongUs.nwa) |+| [Imposter](../../games/imposter/README.md) | One of you doesn't know the word | [Imposter.nwa](https://github.com/Mason363/NumPlay/releases/latest/download/Imposter.nwa) |+| [2 3 4 Players](../../games/fourplayer/README.md) | One key each, 14 party games | [FourPlayers.nwa](https://github.com/Mason363/NumPlay/releases/latest/download/FourPlayers.nwa) |+| [Hollow Knight: Fungal Wastes](../../games/hkfungal/README.md) | Hallownest past Greenpath | [HollowKnightFungalWastes.nwa](https://github.com/Mason363/NumPlay/releases/latest/download/HollowKnightFungalWastes.nwa) |+| [circloO](../../games/circloo/README.md) | Roll the ball, grow the circle | [CircloO.nwa](https://github.com/Mason363/NumPlay/releases/latest/download/CircloO.nwa) |++<br clear="right">++[All calculators](../../README.md#pick-your-calculator) · [How to play each game](../play.md)diff --git a/docs/media/readme/thumb_imposter.png b/docs/media/readme/thumb_imposter.pngindex c152c9f0..35f58a3d 100644Binary files a/docs/media/readme/thumb_imposter.png and b/docs/media/readme/thumb_imposter.png differdiff --git a/docs/media/thumb_imposter.png b/docs/media/thumb_imposter.pngindex 0f394116..954e9274 100644Binary files a/docs/media/thumb_imposter.png and b/docs/media/thumb_imposter.png differdiff --git a/games/imposter/docs/imposter.png b/games/imposter/docs/imposter.pngindex 1b872e2c..40cc1edd 100644Binary files a/games/imposter/docs/imposter.png and b/games/imposter/docs/imposter.png differdiff --git a/games/imposter/docs/shot.png b/games/imposter/docs/shot.pngindex 10f9f3cb..1790166b 100644Binary files a/games/imposter/docs/shot.png and b/games/imposter/docs/shot.png differdiff --git a/games/imposter/src/ui.c b/games/imposter/src/ui.cindex 11e8f781..33b69f94 100644--- a/games/imposter/src/ui.c+++ b/games/imposter/src/ui.c@@ -633,13 +633,12 @@ static bool role_key(uint32_t hit) {static void draw_role(void) {char w[WORD_MAX + 1], h[WORD_MAX + 8];int c = word_text(sv.word, w);+ background(BG_TOP, BG_BOT); /* (the same screen for everyone: only the words tell, so no one sees it from across the room) */if (is_imposter(sv.turn)) {- background(0xE3343F, 0x7A0D1B);gfx_text_center(&np_font_title, 160, 66, "You are the", WHITE, 256);- big_text("Imposter", 160, 114, 296, 64, 768, WHITE);+ big_text("Imposter", 160, 114, 296, 64, 768, RED_TEXT);if (sv.hint) cat(cat(h, "Hint: "), categories[c].name), chip(160, 160, h, WHITE, 60);} else {- background(0x2C6CE3, 0x14388C);gfx_text_center(&np_font_body, 160, 46, "The secret word", HEX(0xDCE6FF), 256);big_text(w, 160, 108, 296, 96, 720, WHITE);chip(160, 166, categories[c].name, WHITE, 60);diff --git a/games/imposter/tests/check.py b/games/imposter/tests/check.pyindex 1ebdb6fd..820699ff 100644--- a/games/imposter/tests/check.py+++ b/games/imposter/tests/check.py@@ -154,11 +154,16 @@ st = state(out)check(st and st["names"] == NAMES, "names typed with the letter keys: %s" % (st and st["names"]))check(st and st["imposters"] == 2 and st["hint"] == 1, "two imposters, the category as a hint")word, imps = check_round(out, NAMES, 2, True, "round 1")-colours_ok = True-for i in range(len(NAMES)):- r, g, b = pixel(pics["role%d" % i], 4, 120)- colours_ok &= (r > 150 and g < 100) if i in imps else (b > 150 and r < 100)-check(colours_ok, "imposter screens red, the others blue")+def reds(path, y0, y1):+ """The red text's pixels in rows y0 to y1: only the Imposter's word is red."""+ return sum(1 for y in range(y0, y1) for x in range(0, 320, 2)+ if (lambda c: c[0] > 200 and c[1] < 150 and c[2] < 150)(pixel(path, x, y)))+++same_bg = len({pixel(pics["role%d" % i], 4, 120) for i in range(len(NAMES))}) == 1+check(same_bg, "every role screen has the same background, so it can't be seen from across the room")+check(all((reds(pics["role%d" % i], 85, 145) > 50) == (i in imps) for i in range(len(NAMES))),+ "only the Imposter's screen has red text")r, g, b = pixel(pics["pass0"], 4, 120)check(b > r and r < 100, "the pass screen keeps the secret (the game's own colours)")diff --git a/tools/calc_pages.py b/tools/calc_pages.pyindex 136555b2..1b9b5b0b 100644--- a/tools/calc_pages.py+++ b/tools/calc_pages.py@@ -5,6 +5,8 @@ games that run on it (games/games.json "ports"). Run it after a game gets a newpython3 tools/calc_pages.py"""import jsonimport os+import re+import subprocessROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))REL = "https://github.com/Mason363/NumPlay/releases/latest"@@ -41,6 +43,17 @@ Or pick just the games you want in [NumPlay Studio](https://mason363.github.io/N"casio-cg", "An add-in can be 2 MB at most, so Celeste, FNAF World and Champion Island aren't here."),]+INSTALL_NW = f"""You need your calculator, its USB cable, and a computer with **Google Chrome** or **Microsoft Edge**.++1. **Download** [NumPlay.nwa]({REL}/download/NumPlay.nwa), or a big game below. Want other games in it? Pick them in [NumPlay Studio](https://mason363.github.io/NumPlay/customize/) and it makes a NumPlay.nwa with just those.+2. **Plug** your calculator into the computer and turn it on.+3. **Go to** [my.numworks.com/apps](https://my.numworks.com/apps) and log in. No account? Sign up there, it's free.+4. Click **Connect**, then pick your calculator in the small window that opens.+5. **Add** the file you downloaded, then click **Install**. Keep the calculator plugged in until it's done.+6. **Play!** Press **Home**, go to the end of the apps and open **NumPlay**.++Updating? Install the new file the same way: your progress comes back by itself. On Upsilon, see [Other versions](../../README.md#how-to-install)."""+KEYS = {"ti84ce": [("Arrows", "move"), ("2nd", "OK"), ("enter", "EXE"), ("clear", "Back"), ("mode", "Home (save and quit)"),("del", "⌫"), ("y=", "shift"), ("alpha", "alpha"), ("math", "toolbox"), ("vars", "var"),@@ -54,11 +67,40 @@ KEYS = {}+def numworks(games, out):+ """The NumWorks's page: NumPlay.nwa's games (the Makefile's GAMES) and the big games, each with its download."""+ mk = open(os.path.join(ROOT, "Makefile")).read()+ apps = dict(re.findall(r"^APP_(\w+) = \S+:(\S+\.nwa)$", mk, re.M))+ made = subprocess.run(["make", "-s", "-p", "-n", "check"], cwd=ROOT, capture_output=True, text=True).stdout+ inside = re.search(r"^GAMES := (.*)$", made, re.M).group(1).split()+ byid = {g["id"]: g for g in games}+ small = [byid[i] for i in inside]+ big = [g for g in games if g.get("xl") and g["id"] in apps]+ lines = ["# NumPlay on the NumWorks", "",+ '<img src="../media/calcs/numworks.png" height="200" align="right" alt="NumWorks">', "",+ f"{len(small)} free games in one app, NumPlay.nwa, and {len(big)} big games that install on their own. "+ "For the N0110, N0115 and N0120.", "",+ "## Install", "", INSTALL_NW, "", "## Keys", "",+ "The games use the calculator's own keys: arrows to move, **OK** and **EXE** to act, **Back** to pause or go back, "+ "and **Home** to save and quit.", "",+ f"## The {len(small)} games in NumPlay.nwa", "", "| Game | |", "| --- | --- |"]+ lines += [f"| [{g['title']}](../../games/{g['id']}/README.md) | {g['tagline']} |" for g in small]+ lines += ["", f"## The {len(big)} big games", "", "Each one installs on its own, the same way.", "",+ "| Game | | Download |", "| --- | --- | --- |"]+ lines += [f"| [{g['title']}](../../games/{g['id']}/README.md) | {g['tagline']} | [{apps[g['id']]}]({REL}/download/{apps[g['id']]}) |"+ for g in big]+ lines += ["", '<br clear="right">', "",+ "[All calculators](../../README.md#pick-your-calculator) · [How to play each game](../play.md)", ""]+ open(os.path.join(out, "numworks.md"), "w").write("\n".join(lines))+ print(f"docs/calculators/numworks.md: {len(small)} games, {len(big)} big games")++def main():games = json.load(open(os.path.join(ROOT, "games", "games.json")))games.sort(key=lambda g: g["rank"])out = os.path.join(ROOT, "docs", "calculators")os.makedirs(out, exist_ok=True)+ numworks(games, out)for slug, target, name, photo, models, install, keys, note in PAGES:on = [g for g in games if target in g.get("ports", [])]lines = [f"# NumPlay on the {name}", "",