/knights

Knights - CS50 AI

Primary LanguagePython

Knights - CS50 AI

Knights Write a program to solve logic puzzles.

Puzzle 0 is the puzzle from the Background. It contains a single character, A.

  • A says “I am both a knight and a knave.”

Puzzle 1 has two characters: A and B.

  • A says “We are both knaves.”
  • B says nothing.

Puzzle 2 has two characters: A and B.

  • A says “We are the same kind.”
  • B says “We are of different kinds.”

Puzzle 3 has three characters: A, B, and C.

  • A says either “I am a knight.” or “I am a knave.”, but you don’t know which.
  • B says “A said ‘I am a knave.’”
  • B then says “C is a knave.”
  • C says “A is a knight.”