I think I found a solution to this, if you're still looking for one. See
attached code. It uses a rose tree zipper where tree depth is manhattan
distance from origin and forest width is nodes around concentric
diamonds. The code is straightforward. Polar coords (RK) are stored in
node label,
Henning Thielemann wrote:
A dungeon game? :-)
Yes. :-)
Thank you all for your answers! I especially like David's
no-intermediate-structure solution because it allows for defining the
area in terms of neighbours instead of needing an index on the rooms.
Now that I have core functionality
Hello,
I would like to construct an infinite two-dimensional grid of nodes,
where a node looks like this:
data Node = Node
{ north :: Node
, east :: Node
, south :: Node
, west :: Node
}
in such a way that for every node n in the grid it doesn't matter how I
travel to n, I
On Mon, Dec 29, 2008 at 3:55 PM, Martijn van Steenbergen
mart...@van.steenbergen.nl wrote:
Hello,
I would like to construct an infinite two-dimensional grid of nodes, where
a node looks like this:
data Node = Node
{ north :: Node
, east :: Node
, south :: Node
, west :: Node
}
Martijn van Steenbergen schrieb:
Hello,
I would like to construct an infinite two-dimensional grid of nodes,
where a node looks like this:
data Node = Node
{ north :: Node
, east :: Node
, south :: Node
, west :: Node
}
in such a way that for every node n in the grid it
On Mon, Dec 29, 2008 at 5:55 PM, Martijn van Steenbergen
mart...@van.steenbergen.nl wrote:
Hello,
I would like to construct an infinite two-dimensional grid of nodes, where a
node looks like this:
data Node = Node
{ north :: Node
, east :: Node
, south :: Node
, west :: Node
}
I'm confused how this isn't just tantamount to using Data.Map
(Integer,Integer) a.
The essential problem is that you have an algebra acting on a topology.
The algebra is easily rewritten to an efficient form, but a sequence of
topological actions is not, because it is not sufficiently
On Mon, Dec 29, 2008 at 9:29 PM, Dan Weston weston...@imageworks.com wrote:
I'm confused how this isn't just tantamount to using Data.Map
(Integer,Integer) a.
Data.Map.Map is strict in terms of structure. The number of elements
in the map must be known and less than (maxBound :: Int).
That