Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

There are 0 hard problems in computer science: off-by-1 errors #46

Open
emorrp1 opened this issue Jul 18, 2020 · 3 comments
Open

There are 0 hard problems in computer science: off-by-1 errors #46

emorrp1 opened this issue Jul 18, 2020 · 3 comments

Comments

@emorrp1
Copy link

emorrp1 commented Jul 18, 2020

/area_info: "You can protect areas spanning up to 64x128x64."
/list_areas: (-32,-64,-32) (32,64,32)
markers:land_title_register: "It spans 65x65 = 4225 m^2. Height: 129 m."

Now, I can see how this might be deliberate to make mental maths easier, but one of those two statements is wrong - either the spanning is 65x129x65 (perhaps written as +/-32,+/-64,+/-32) or the protection should be one less.

@FeXoR-o-Illuria
Copy link

FeXoR-o-Illuria commented May 15, 2021

Not really since none of the statements is telling if it talks about coordinates(zero volume points)/distance between nodes(one node has 0 distance to itself) or nodes (with volume and width of 1).
If /area info speaks about the distance between the node's centers in all directions and markers:land_title_register about the volume covered by all those nodes they can be both correct.

Example:
An area with corner coordinates 0 0 0 to 1 1 1 contains only one node with center at 0.5 0.5 0.5 (Probably identified as node 000).
But if node identifiers are meant those are 8 nodes (000, 001, 010, 011, 100, 101, 110, 111).
The volume of those 8 nodes is 8 but the maximum distance from one node's center to the furthest away in each direction is still only 1 (1.5 - 0.5 = 1) so in terms of node identifiers it "spans" 1x1x1.

@S-S-X
Copy link

S-S-X commented Jun 3, 2022

Protection size is always full nodes which should make this fairly simple... you cannot protect just single point, you have to protect full nodes.

@FeXoR-o-Illuria
Copy link

AFAIK the size of the area one can protect now is what /area_info states.
(And one should no longer be able to protect the example area with the stated info text because that's one larger in each dimension)
Too lazy to check for the commit though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants