larger of two valuesthe absolute value of the difference of the two coordinates and the absolute value of the difference of the two coordinates that means you should subtract the sonar device' coordinate and treasure chest' coordinateand then take the absolute value of this number do the same for the sonar device' coordinate and treasure chest' coordinate the larger of these two values is the distance for exampleconsider the sonar' and coordinates are and like in figure - the first treasure chest' and coordinates (that isfirst in the list [[ ][ ][ ]]are and for the coordinates evaluates to - and the absolute value of - is for the coordinates evaluates to and the absolute value of is comparing the two absolute values and the larger value is so should be the distance between the sonar device and the treasure chest at coordinates we can look at the board in figure - and see that this algorithm worksbecause the treasure chest at is in the sonar device' nd ring let' quickly compare the other two chests to see if the distances work out correctly also let' find the distance from the sonar device at and the treasure chest at abs( evaluates to abs( evaluates to is larger than so the distance from the sonar device at and the treasure chest at is let' find the distance from the sonar device at and the last treasure chest at abs( evaluates to abs( evaluates to is larger than so the distance is looking at figure - you can see all three distances worked out correctly it seems this algorithm works the distances from the sonar device to the three sunken treasure chests are and on each guessyou want to know the distance from the sonar device to the closest of the three treasure chest distances to do thisuse variable called smallestdistance let' look at the code again smallestdistance any chest will be closer than post questions to