简体   繁体   中英

Represent grid as an object

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 that 2,2 is the center and 0,0 is the center.

如果您需要降低复杂性并降低网格的其他顺序,则可以使用空间填充曲线,例如z曲线,hilbert曲线,peano曲线。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM