Loading ...
Sorry, an error occurred while loading the content.

RE: [PBML] You asked to see the code I am working on....

Expand Messages
  • Charles K. Clarkson
    Luinrandir Hernsen wrote: Top and bottom posting. You re killing me here ... [best spoken with a Brooklyn accent.] ... You should
    Message 1 of 16 , Sep 1, 2004
    • 0 Attachment
      Luinrandir Hernsen <Luinrandir@...> wrote:

      Top and bottom posting. You're killing me here ...
      [best spoken with a Brooklyn accent.]


      : : Are you using the castle names in any part
      : : of the existing code? How are they used? Can you
      : : show me the c ode?

      : all 8000 lines?

      You should probably send it to me off-list, but, yes,
      I'd like to look at it. I do not guarantee I won't run
      away screaming.


      : this is just the part i am working on now...
      : what I need to do is figure out how to read
      : and write hashes.

      A hash is like an array except the indexes are named
      and not kept in any particular order. Just as you can
      list the indexes to an array:

      foreach my $index ( 0 .. $#array ) {

      and its values:

      foreach my $element ( @array ) {


      You can do the same for a hash:

      foreach my $key ( keys %hash ) {

      and its values

      foreach my $value ( values %hash ) {

      : well here i am bottom posting... and as usual i can't get
      : rid of the damn line in the side.....

      What line in the side? Oh, wait, default your replies
      to plain text. Then you can intersperse your comments in
      the response.


      : the castle names are also the city names. Each city will
      : have a .db file
      : ie Avalon.db......

      I figured you'd use something like that. I foresee a problem
      when you want to add a new city. What you have shown so far looks
      like the cities are hard coded into the code. It would be more
      robust if any amount of cities could be added or deleted anytime.


      : so my choice now is, write to the file using arrays of
      : hashes.... since i know how to read/write arrays.. guess that
      : is how i will do it.

      You sound like the guy at the hardware store who is looking
      at the power drills knowing that is what he needs to drill his
      fastener into the slab. Unfortunately he is totally unaware of
      the Hilti Gun on the next aisle.

      A hash will probably do what you need, but an introduction
      to data structures might be more worthwhile reading.

      BTW, does the game already have castles and cities? I took
      a look at the map, but I couldn't tell. I think it may only
      work in IE.


      HTH,

      Charles K. Clarkson
      --
      Mobile Homes Specialist
      254 968-8328
    Your message has been successfully submitted and would be delivered to recipients shortly.