Demo3 – Quadword

A five-letter word-guessing game with a Dyalog APL backend served by Jarvis.

How it was made

The entire demo, front end and back end, was generated by Claude. There were no manual changes to the APL code (Source/Quadword.apln, Tests/RunAll.apls, Demo3.apls) or to the HTML, CSS and JavaScript (HTML/). The requirements it worked from are in docs/plans/design.md.

Running

From the demo3 folder (the script finds its files relative to the current directory):

dyalogscript Demo3.apls

Then browse to http://localhost:8889. Press Ctrl+C to stop the server. Server settings (port, code location, HTML folder, endpoints, hooks) are in jarvisconfig.json; relative paths in it are relative to the file’s folder. Set DYALOG_JARVIS_PORT to override the port without editing the file.

The page loads its font from Google Fonts. Without internet access the game still works, using a fallback font.

Testing

From the demo3 folder:

dyalogscript Tests/RunAll.apls

It prints PASS or FAIL for each test and exits with a non-zero code if any test fails.

Layout

Path Contents
Demo3.apls Starts Jarvis using jarvisconfig.json and keeps running until stopped
Jarvis.dyalog Jarvis web service framework
jarvisconfig.json Jarvis configuration
Source/Quadword.apln Game logic, word list, endpoints and the SSE encouragement stream
HTML/ Front end (index.html, style.css, app.js) served by Jarvis’s HTML interface
Tests/RunAll.apls Unit tests for the game logic
docs/plans/design.md The original requirements for the application

API

All endpoints use HTTP POST with a JSON body, except Encourage.

The answer stays on the server until the game is over.

Try it from the command line:

curl -X POST -H 'Content-Type: application/json' -d '{}' http://localhost:8889/NewGame
curl -X POST -H 'Content-Type: application/json' -d '{"gameId":"<id from NewGame>","guess":"crane"}' http://localhost:8889/Guess
curl -N http://localhost:8889/Encourage

Game rules