Problem 1189. Knights and Knaves (part 3)
35.0% Correct | 65.0% Incorrect
Last Solution submitted on Apr 14, 2023
Show 1 older comment
Eran Greenberg on 10 Jan 2013
If the guard is a knave, and I ask him what the password is, what response do I get? Do I still get an array of chars? Does he replace 'A' with 'Z', 'B' with 'Y', etc..?
Alfonso Nieto-Castanon on 10 Jan 2013
questions can only be statements that evaluate to a scalar logical value (yes/no questions), so you can ask things like QUESTION('PASSWORD(1)==''A'''); or QUESTION('strcmp(PASSWORD,''ASDF'')'); but if you ask a question that returns a vector you will simply get an error.
Nikolaos Nikolaou on 16 May 2020
Very fun problem Thanks!
Pat Schimoler on 4 Dec 2021
Thank you for taking the time to make up this series of problems.
Solution CommentsShow comments
Problem Recent Solvers32
Make an N-dimensional Multiplication Table
More from this Author38
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!