Skip to content

swayam1604/knights-puzzle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

🧠 Knights and Knaves – Logic Puzzle Solver

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).

🔍 About the Project

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.

đź›  Built With

  • Python 3
  • Custom logic engine (logic.py)
  • Propositional logic tools: Symbol, And, Or, Not, Implication, Biconditional
  • Model checking to evaluate truthfulness

🚀 How to Run

  1. Make sure Python 3 is installed.
  2. Clone or download the project files.
  3. In your terminal, run:
python puzzle.py

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages