Skip to content

TheAlbatross279/Knights-Knaves

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Knights and Knaves is a logic puzzle that deals with a mysterious island of inhabitants who are either knights or knaves. The ones who are knights always tell the truth, while the inhabitants who are knaves always tell lies. The puzzle is to solve which of the inhabitants are knaves and which are knights. This code solves the problem when there are only two inhabitants in question. The correct input looks as follows:

'A very special island is inhabited only by knights and knaves. Knights always tell the truth, and knaves always lie.

You meet two inhabitants: Zoey and Mel. Zoey tells you that Mel is a knave. Mel says, `Neither Zoey nor I are knaves.'

Can you determine who is a knight and who is a knave?'

More examples following valid input come from this site: http://philosophy.hku.hk/think/logic/knight.php

About

A program that solves the Knights & Knaves puzzle with two inhabitants.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages