Ore In The Desert

Ore In The Desert

Challenging
English RU

During their adventure, the Robo-trio came across a desert, and the ships sensors have registered ore in the region. The desert has a size of 10x10 cells and can be represented as a 2D array. The ship has four probes which can be used to help us find the ore. At each step you will need to return the coordinates of a cell (as [row, column]) for the probe to travel to. If the cell contains ore, then you can finish; else the probe will give a distance to the location of the ore cell (it will be the Euclidean distance between cells' centers). The perception of probe is not very good and it will give you a result rounded to the closest integer (1.41 ≈ 1; 2.83 ≈ 3). At each step you receive information from the previous probes as a list of list. Each list will be in the following format: [row, column, distance]. At the beginning of the mission, you will only receive an empty list.

ore-in-the-desert ore-in-the-desert

Input: Information of the previous probes as a list of lists. Each list contains three integers.

Output: The coordinate of the next probe as a list of two integers.

Example:

checkio([])
checkio([[5, 3, 4]])
checkio([[5, 3, 4], [2, 9, 3]])

How it is used: This task illustrates trilateration. Trilateration is the process of determining absolute or relative locations of points by measurement of distances, using the geometry of circles, spheres or triangles. In addition to being an interesting geometric problem, trilateration does have practical applications in surveying and navigation and is an important part of the equations making global positioning systems (GPS) possible.

Precondition:
len(desert) == 10
all(len(row) == 10 for row in desert)
There is always exist an ore cell in the desert.

You should be an authorized user in order to see the full description and start solving this mission.
45
Settings
Code:
Other:
Invalid hot key. Each hot key should be unique and valid
Hot keys:
CheckiO Extensions

CheckiO Extensions allow you to use local files to solve missions. More info in a blog post.

In order to install CheckiO client you'll need installed Python (version at least 3.8)

Install CheckiO Client first:

pip3 install checkio_client

Configure your tool

checkio --domain=py config --key=

Sync solutions into your local folder

checkio sync

(in beta testing) Launch local server so your browser can use it and sync solution between local file end extension on the fly. (doesn't work for safari)

checkio serv -d

Alternatevly, you can install Chrome extension or FF addon

checkio install-plugin
checkio install-plugin --ff
checkio install-plugin --chromium

Read more here about other functionality that the checkio client provides. Feel free to submit an issue in case of any difficulties.

Pair Programming (Beta-version)

Welcome to Pair Programming! Engage in real-time collaboration on coding projects by starting a session and sharing the provided unique URL with friends or colleagues. This feature is perfect for joint project development, debugging, or learning new skills together. Simply click 'Start Session' to begin your collaborative coding journey!

Waiting for Pair Programming to start...

You are trying to join a pair programming session that has not started yet.

Please wait for the session creator to join.

Waiting for Pair Programming to reconnect...

It looks like the creator of the pair programming session closed the editor window.

It might happen accidentally, so that you can wait for reconnection.

×
 
 
<< <
> >>
exec show

Whats Next?

Free accounts will see Best CheckiO solutions with some delay.
Best Solutions will be opened in a moment
Become Awesome and Don't wait
The next stage is ""
Will be activated in
View More Solutions Random Review Solutions Go to the next mission