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..?
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.
Very fun problem Thanks!
Islander Code injection :)
Shame on you, LY Cao, for that hack. :)
Nice way to minimize number of queries!
Find the peak 3n+1 sequence value
1121 Solvers
381 Solvers
Test if a Number is a Palindrome without using any String Operations
181 Solvers
Back to basics 13 - Input variables
234 Solvers
149 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!