A Python-based logic puzzle solver built by Swayam Sharma as part of Harvard’s CS50’s Introduction to Artificial Intelligence with Python.
This script determines the roles of characters in logical scenarios—whether they are Knights (who always tell the truth) or Knaves (who always lie).
This project uses propositional logic to analyze and solve a series of logical puzzles involving characters A, B, and C. Each character is either a knight or a knave, and their statements provide clues to uncover their identities.
- Python 3
- Custom logic engine (logic.py)
- Propositional logic tools:
Symbol
,And
,Or
,Not
,Implication
,Biconditional
- Model checking to evaluate truthfulness
- Make sure Python 3 is installed.
- Clone or download the project files.
- In your terminal, run:
python puzzle.py