开发者

Represent grid as an object

开发者 https://www.devze.com 2023-02-13 13:01 出处:网络
What\'s reasonable way to represent a grid in terms of an object? It\'s part of a two dimensional graphic programming exercise where at the center of the grid is \"me\".

What's reasonable way to represent a grid in terms of an object? It's part of a two dimensional graphic programming exercise where at the center of the grid is "me".

The object needs to be scalable up to 20,20.

So if I have a 3,3 grid I need to know that I am in grid 1,1 (center) and that 0,0 is lower right. And if I have an grid of 5,5 I need to know t开发者_StackOverflow社区hat 2,2 is the center and 0,0 is the center.


If you need a reduction of the complexity and another order of the grid you can use space-filling-curve like a z-curve, a hilbert-curve, a peano-curve.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号