*laughs* Tiefling, my friend. That is one very good reason why OO is better (at some things) than top-down. Coding something up like this in an OO language would be an extremely simple thing.
- Define what each point knows about and knows how to do. Does it know about the wind direction? Does it know about temperature? What about composition (earth, stone, water, air, etc)? I'm sure you can come up with some 30-40 things each grid point knows about.
- Create a grid object containing, say, 50x50x10 of these objects. The grid needs to be able to coordinate between the various points, for things like wind changing direction or a warm front moving through. Heck, just for things like daybreak. :-) (There's a number of niftykeen Perl tricks that can be done here to reduce the number of lines and increase the readability.)
- Populate said grid.
Here's the neat part - you have a Map::Grid class and a Map::Point class. The Grid will have, maybe, 500 lines of code and the Point might have 1000 or so. Not all that much, if you think about the fact that that's your entire 3-D world.
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|