/cs50-ai-knights

Knights and Knaves puzzle

Primary LanguagePython

CS50 - Introduction to AI with Python

Project 1 - Knights/Knights and Knaves puzzle


Description

In a Knights and Knaves puzzle, the following information is given: Each character is either a knight or a knave. A knight will always tell the truth: if knight states a sentence, then that sentence is true. Conversely, a knave will always lie: if a knave states a sentence, then that sentence is false. The objective of the puzzle is, given a set of sentences spoken by each of the characters, determine, for each character, whether that character is a knight or a knave.

How to run

  1. Clone this repo.
  2. Run the file: python3 puzzle.py
  3. You'll get answers in terminal window.