home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.pascal.borland      Borland Pascal was actually pretty neat      2,978 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 2,371 of 2,978   
   Bart to All   
   Re: How to rotate a 2D array?   
   14 Jan 07 10:52:28   
   
   From: broersma.juda_ANTISPAM_@tiscali.nl   
      
   Hi Femme,   
      
   Op Sat, 13 Jan 2007 21:40:44 +0100 schreef Femme Verbeek   
   :   
      
   >I wrote a life game long ago. If it is of any use for you I can send it   
   >by mail.   
      
   I'd like that. My mail is in my signature (remove the obvious parts).   
      
   I'm curious how other people implement the "world", that is, what kind   
   of data structure do they use.   
   In my first attempt I used a array[x,y] of byte (it was still 16 bit   
   time). Now I use a structur that contains pointers to all neighbours.   
   Setting up the board becomes more complicated, especially when   
   implementing a wrapping strategy, but the advantage is that you, most   
   of the time, have to do this only once in the game. Calculating   
   neighbours becomes less complex and even a little bit faster.   
      
   And how do they optimize the next-generation calculation?   
   For example, if you look at a board ad see a large section with all   
   celss dead, you immediately know that in the next generation these   
   cells will be dead also. Yet in my current coed I still have to   
   iterate all cells to determine their next status.   
      
   I recently came across some life implementation (made apparantly in   
   Delphi) that has a world occupying as much as 1 million by 1 million   
   celss (I guess this one sees each cell as a bit, so 16 cells in a   
   2-byte integer value, this would easiliy allow for a world 64 times   
   larger than mine, using the same memory footprint). Althoug this   
   approaches an indefinite large world (as Conway intended it to be)   
   more than my current one (max. 1280 x 1024), and so gives more   
   opportunity to studie for example large methusalehs, given current   
   screen sizes it does not seem very practical to actually see what's   
   going on.   
      
   Groetjes,   
      
   Bart   
   --   
   Bart Broersma   
   broersma.juda_ANTISPAM_@tiscali.nl   
   (ff _ANTISPAM_ wegpoetsen uit dit adres natuurlijk)   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca