News for hackers. Stuff that matters.
Re:Worldle by function_seven on Wednesday February 16, 2022 @09:53PM (#30369020)
So what is the percentage indicate separately from the distance?

I think the "right" way to display the distance would be from the closest points in the guessed and target territories. So United States and Canada, sharing a border, would be "0 km", while Canada and Mexico would be whatever the shortest path from border to border would be (like 2,000km?)

I have a feeling that's a bit more difficult than centers, though. But it wouldn't be a problem as far as outlying territories go; the image is of a contiguous landmass, not the entire country.

Re:Worldle by mypalmike on Thursday February 17, 2022 @03:46AM (#30370881)
> I have a feeling that's a bit more difficult than centers, though.

This is quite an understatement.

Re:Worldle by 3np on Thursday February 17, 2022 @04:00AM (#30370982)
Given it's a static dataset of countries, the distance of all country pairs could all be precomputed and loaded in memory, I guess ¯\_(ツ)_/¯
Re:Worldle by mypalmike on Thursday February 17, 2022 @04:55AM (#30371358)
True. But to perform that precomputation, you have to find a database of country geometry outlines. And (manually?) filter out things like Hawaii and Guam from these. Then, assuming country geometry is given as lat lon polygons, it seems you then are computing either O(n^2 * m^2) distances where n is the number of countries and m is the average number of vertices per country. Or you might come up with some space partitioning algorithm on the vertices to reduce that to maybe O(n^2 * m log(m)). It's doable, but my comment was merely pointing out that it's much more complex than comparing country centers.
Re:Worldle by Aeolun on Thursday February 17, 2022 @06:00AM (#30371790)
Oh, good point. Getting an SVG of the world and just brute forcing every country would be near instant.
Re:Worldle by mypalmike on Thursday February 17, 2022 @11:50AM (#30375296)
Hmm. What issue might you encounter trying to solve this problem using an SVG?
Re:Worldle by mcorning on Thursday February 17, 2022 @02:15AM (#30370372)
It's really a shame the developer didn't add this feature. One might be scared off by the large number of geometry files involved with this, but actually this is a great example of when hard coding can supersede dynamic/robust code. It would be better to simply store an object of all countries borders and the their relative direction to one another. I could see this being a slight issue with countries that share a border with another that is many directions of their border (Lesotho and South Africa, for example), but it would still be much less deceptive than saying "the USA is 2000km south of Canada."
Re:Worldle by midasuni on Thursday February 17, 2022 @03:54AM (#30370940)
France would be fascinating
Re:Worldle by midasuni on Thursday February 17, 2022 @04:13PM (#30378751)
(For context France has borders with Brazil for example, and is only a few miles from Canada and not far from Austrailia)
Re:Worldle by Ansil849 on Thursday February 17, 2022 @10:23PM (#30381804)
Yes, the fangs of colonialism bite deep.
Re:Worldle by polishdude20 on Thursday February 17, 2022 @01:05AM (#30370032)
But then you get Canada and you instantly know it's the USA next.
Re:Worldle by Ansil849 on Thursday February 17, 2022 @01:36AM (#30370170)
> But then you get Canada and you instantly know it's the USA next.

So in your hypothetical scenario....this hypothetical player would know that the only country Canada has a land border with is the USA, but not know what the USA looks like so as to be able to solve this without first guessing Canada?

This seems improbable to me. Chances are that if someone knows enough about a country that it's a 'single neighbor' country, or that it has a 'single neighbor' country, they will also know what the country looks like.

For example, if someone instantly knows that if they typed in Haiti it must then be the Dominican Republic, chances are very high that they wouldn't have typed Haiti because they also know what the Dominican Republic looks like. Much like chances are high that if someone knows that Canada only borders the USA, they also wouldn't have typed Canada in the first place, but would have guessed USA right away.

Re:Worldle by laurent92 on Thursday February 17, 2022 @03:01AM (#30370587)
Interesting because, between easy-and-wrong and hard-but-perfect, there is the solution of subtracting the size of each country from their distance.
Re:Worldle by cmeacham98 on Thursday February 17, 2022 @03:04AM (#30370606)
Assuming by "size" you mean something like average/longest distance from the center this is the worst possible answer because it's super non-intuitive and can create crazy results like negative answers.