<div dir="ltr"><div><div>If you are thinking of it as a 3d grid, you might just have a (Map (Integer, Integer, Integer) Contents, where every room in this 3d grid that has something in it is in the map and every room that is empty space has no corresponding entry in the map.<br><br></div>Then when you enter a room you can quickly look up what is in that room, then reasonably quickly check the neighbors in every direction to see what the ship might be able to sense were it to travel in that direction.<br><br></div>In this case, space is infinite, but the datastructure is only as big as the amount of content you have.<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Aug 14, 2015 at 4:34 PM, Michael Litchard <span dir="ltr"><<a href="mailto:michael@schmong.org" target="_blank">michael@schmong.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Star Wars MUD has a 3-D coordinate system such that (0,0,0) is some planet. I'm curious as to how one might model this system that could simulate a ship's movement through a 3-D grid. Matrix, 3-D array, graph. None of these? Ideas?<br></div>
<br>_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe</a><br>
<br></blockquote></div><br></div>