Skip to content

Andriamanitra/codeguessr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CodeGuessr

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.

Instructions to run locally

  1. Download an XML file containing all the "Programming Tasks" category pages from Rosetta Code: https://rosettacode.org/wiki/Special:Export screenshot of exporting from Rosetta Code

  2. Create a virtual environment to install Python dependencies in (for example python3 -m virtualenv venv)

  3. pip install lxml which is used to parse the XML file

  4. python3 parse_to_db.py ROSETTA_EXPORT.xml to parse the solutions into a sqlite3 database rosettacodes.db

  5. (Optional) sqlite3 rosettacodes.db -init cleanup.sql to clean up the database (removes the most niche languages and extremely short solutions, fixes some inconsistent naming, etc.)

  6. pip install sanic[ext] which is used to serve the API and static files

  7. sanic --dev --port 8001 server.app to run the server (in development mode)

  8. VITE_API_URL="http://localhost:8001" cd frontend && npm run dev to run the frontend locally (you may need to uncomment the line that allows cross-origin requests from localhosts in server.py)

About

Which programming language is that??

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published