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!
Thank you for taking the time to make up this series of problems.
Islander Code injection :)
Shame on you, LY Cao, for that hack. :)
Nice way to minimize number of queries!
Encode Roman Numerals
It dseon't mettar waht oedrr the lrettes in a wrod are.
Project Euler: Problem 1, Multiples of 3 and 5
Back to basics 5 - Clipboard
Find the largest value in the 3D matrix
Say something funny
Five steps to enlightenment
German tank problem
Clockwise or Counterclockwise
Find the treasures in MATLAB Central and discover how the community can help you!
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Contact your local office