Retired

Where's Waldo? (retired)

Description:

Introduction:

"Where's Waldo?" is a British series of children's 
puzzle books created by English illustrator Martin Handford. 
The books consist of a series of detailed double-page 
spread illustrations depicting dozens or more people 
doing a variety of amusing things at a given location. 
Readers are challenged to find a character named Waldo hidden in the group.

Task:

Your task is to find Waldo in a given array of people and objects and return the nearest object.

Rules:

1. The input is a 2D array representing the scene with various people and objects.
2. The array will contain both names of people and objects.
3. Your goal is to find the position of "Waldo" in the array.
4. Once you find Waldo, you need to determine the nearest object.
5. You'll be provided with a list of possible objects that Waldo could stand next to.
6. You should check the element to the left, right, above, and below Waldo's position. 
7. There will not be more than one object next to Waldo.
8. If a valid object is found, return "Waldo is next to the [object]." where [object] is the name of the found element.
9. If no valid object is found around Waldo, return "Waldo is in the crowd."
10. If "Waldo" is not in the array, return "Can not find Waldo."

Input:

array =  [["Wilhelm", "Waldo", "Cafe", "Car"], 
["Park", "Robert", "Annabelle", "Maria"],
["Anna", "Lake", "Tim", "Tom"],
["Field", "Plant", "School", "Wilfred"]]

Result:

"Waldo is next to the Cafe."

Here's the list of possible objects:

objects = ["Tree", "House", "Car", "Park", "Lake", "Field", "Plant", "Bus", "Cafe", "Museum", "Beach", "School", "Bridge", "Supermarket", "Library"];
Arrays
Games
Fundamentals

Similar Kata:

Stats:

CreatedNov 8, 2023
Warriors Trained17
Total Skips0
Total Code Submissions65
Total Times Completed12
JavaScript Completions12
Total Stars1
% of votes with a positive feedback rating50% of 7
Total "Very Satisfied" Votes2
Total "Somewhat Satisfied" Votes3
Total "Not Satisfied" Votes2
Total Rank Assessments7
Average Assessed Rank
7 kyu
Highest Assessed Rank
6 kyu
Lowest Assessed Rank
7 kyu
Ad
Contributors
  • CodingManu Avatar
Ad