Changes

1,013 bytes added ,  00:08, 11 September 2013
Created page with "Will return the name and location of the closest city to the specified point in space. To do this correctly, you may want to use an algorithm using a PriorityQueue, such as [..."
Will return the name and location of the closest city to the specified point in space. To do this correctly, you may want to use an algorithm using a PriorityQueue, such as [http://www.cs.umd.edu/users/meesh/cmsc420/Notes/neighbornotes/incnear.pdf this] or [http://www.cs.umd.edu/users/meesh/cmsc420/Notes/neighbornotes/incnear2.pdf this] - otherwise, you might not be fast enough.

== Parameters (In output order) ==
* x
* y

== Possible ''<output>'' ==
The output will contain one city tag which is the nearest city. This is an example of a city tag:
<code>
<city name="city1" x="coordx" y="coordy" color="color1" radius="radius1"/>
</code>

== Possible ''<error>'' types ==
* mapIsEmpty

== ''<success>'' Example ==
<code>
<success>
<command name="nearestCity"/>
<parameters>
<x value="1"/>
<y value="2"/>
</parameters>
<output>
<city name="Annapolis" x="20" y="30" color="red" radius="12"/>
</output>
</success>
</code>
editor
68

edits