OregSamSas / vardle

worldle based geography quiz game with the counties of the old Hungarian Kingdom
https://oregsamsas.github.io/vardle/
MIT License
1 stars 0 forks source link

Farthest territory calculation not working #2

Closed OregSamSas closed 3 months ago

OregSamSas commented 8 months ago

This is a huge problem, but most of the cases it happens. Only if Háromszék is the farthest territory in the real game, it finds it, but otherwise it finds a wrong county instead, which can be even itself (!), but if not, then also one of its neighbours.

OregSamSas commented 8 months ago

image Undefined would be "farthest territory from". And the furthest territory from itself is itself, it says. So 'tere're some problems, that's for sure. Also this undefined thing is not pleasure, because I've no idea, why doesn't it finds the translation.

OregSamSas commented 3 months ago

A few commits ago, I thought I solved the problem with adding the criterium when returning with the farthest territory that it shouldn't be itself.

But it seems, it didn't solved the problem completely, because it can select still a neighbouring county, like here: image

OregSamSas commented 3 months ago

The problem was that on each neighbouring territory, the function broke from the loop, and stopped checking the distance between other points of the outline of the examined territory and the solution territory's outline, BUT it also stopped getting the dimensions of the examined territory, and hence, the farthest territory calculation broke, since it needed the dimension data.

OregSamSas commented 3 months ago

It has been solved since 40e4088

OregSamSas commented 3 months ago

So I'll close it for now, hope won't reopen it while testing...