All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars    
perplexus dot info

Home > Logic
The Right Key (Posted on 2024-02-01) Difficulty: 3 of 5
After recent events, Question Mark is annoyed with his brother, Skid Mark. Skid thought it would be funny to hide Question's wallet. He told Question that he would get it back if he finds it.

So, first off, Skid laid five colored keys in a row. One of them is a key to a room where Skid is hiding Question's wallet. Using the clues, can you determine the order of the keys and which is the right key?

Red: This key is somewhere to the left of the key to the door.
Blue: This key is not at one of the ends.
Green: This key is three spaces away from the key to the door (2 between).
Yellow: This key is next to the key to the door.
Orange: This key is in the middle.

See The Solution Submitted by K Sengupta    
Rating: 5.0000 (1 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
Solution computer solution | Comment 1 of 6
colorCodes=perms('rbgyo');
for key=1:5
  for i=1:length(colorCodes)
    colors=colorCodes(i,:);
    red=strfind(colors,'r');
    blue=strfind(colors,'b');
    green=strfind(colors,'g');
    yellow=strfind(colors,'y');
    orange=strfind(colors,'o');
    if red<key
      if blue>1 && blue < 5
        if abs(green-key)==3
          if abs(yellow-key)==1
            if orange==3
              disp(key)
              disp(colors)
            end
          end
        end
      end
    end
  end
end

finds

>> theRightKey
     4
groby
>> 

meaning the blue key, in the 4th position, is the right key.

The order of the colors is green, red, orange, blue, yellow.

  Posted by Charlie on 2024-02-01 08:59:37
Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (0)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (8)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox:
Copyright © 2002 - 2024 by Animus Pactum Consulting. All rights reserved. Privacy Information