Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
*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.
  1. 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.
  2. 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.)
  3. 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.

In reply to Re{9}: Modules: Building blocks for the Daft Adventure by dragonchild
in thread Modules: Building blocks for the Daft Adventure by Tiefling

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • 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.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (3)
As of 2024-04-19 05:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found