175k views
2 votes
Tools

[TASK] 5

Which Direction?
Using geospatial logic and considering two processes that run in parallel

IQ tests and similar attempts to define and measure human intelligence, differentiate between different types of logic. So far we’ve looked at verbal logic and mathematical logic. This next puzzle involves using geospatial logic, as well as considering two processes that run in parallel. In coding, keeping track of multiple different components doing different things becomes very important when working with more complex problems. Try the next, visual, puzzle, and see if you can work out how to provide clear logical instructions to your robot team in order to achieve specific goals.




In a warehouse, there are 2 robots that work together. They move in the same direction concurrently, so if one moves North, they both move North. The robots will follow any instructions they’re given and will collect any objects they find along the way. They only take instructions by the points of the compass and can only move in 4 directions (N, E, S, W).

For example, if the 2 robots are given the directions: “N, E, S”, then Robot A will collect a ball and Robot B will collect a hat.


Write the directions the robots would need to follow to collect the following objects, remembering that both robots get the same directions, and assuming that for each question they start off in the same (pictured above) positions:

1. Robot A: ball Robot B: ball
2. Robot A: hat, ball Robot B: box, hat
3. Robot A: ball, ball Robot B: hat, ball

1 Answer

5 votes

The task is to use geospatial logic to direct two robots to collect objects by following simultaneous compass-point directions. The directions vary based on what objects each robot needs to collect, starting from the same initial positions.

The question requires applying geospatial logic to instruct two robots to move concurrently and collect specified objects in a warehouse. The instruction set must consider the simultaneous movement of both robots and use cardinal directions: N, E, S, and W. Here are the direction sets for each task:

For Robot A to collect a ball and Robot B to collect a ball: The directions could be simply "E" as they both need to move East for the closest balls.

For Robot A to collect a hat and ball and Robot B to collect a box and hat: "N, E, E, S" should work. First North to get A's Hat and B's box, then East twice for the balls, and finally South for B to get the second hat.

For Robot A to collect two balls and Robot B to collect a hat and a ball: "E, E, N" would serve the intended purpose. First going East twice for the balls and then North for Robot B to get the hat.

The provided commands assume starting positions are as per the initial scenario presented and that each movement onto a new square results in the collection of an object, if present.

User MANISH ZOPE
by
9.2k points