If you thought https://guessthiscode.com/ is fun but just too easy you have come to the right place. We leverage a large set of example programs on Rosetta Code to create a much more challenging (thousands of programs, hundreds of different languages!) programming language guessing game.
-
Download an XML file containing all the "Programming Tasks" category pages from Rosetta Code: https://rosettacode.org/wiki/Special:Export

-
Create a virtual environment to install Python dependencies in (for example
python3 -m virtualenv venv) -
pip install lxmlwhich is used to parse the XML file -
python3 parse_to_db.py ROSETTA_EXPORT.xmlto parse the solutions into a sqlite3 databaserosettacodes.db -
(Optional)
sqlite3 rosettacodes.db -init cleanup.sqlto clean up the database (removes the most niche languages and extremely short solutions, fixes some inconsistent naming, etc.) -
pip install sanic[ext]which is used to serve the API and static files -
sanic --dev --port 8001 server.appto run the server (in development mode) -
VITE_API_URL="http://localhost:8001" cd frontend && npm run devto run the frontend locally (you may need to uncomment the line that allows cross-origin requests from localhosts inserver.py)