Talk:Wireworld

From Rosetta Code
Revision as of 19:45, 10 September 2009 by rosettacode>Dkf (→‎Performance: new section)

Ruby Problem

Consider the top left cell in the initial generation which is a 't'. The only thing that a 't' can change to is a '.', yet the next generation shows it as a 'H' ? --Paddy3118 20:09, 9 September 2009 (UTC)

P.S. Does the Forth or TCL output agree with the Python? It would be good to know that at least two agree :-) --Paddy3118 20:14, 9 September 2009 (UTC)

Python and Forth are correct. I've marked Ruby incorrect. --IanOsgood 20:22, 9 September 2009 (UTC)

At a guess, the Ruby code is changing a tail into a head directly. Not quite what the transition table states... —Donal Fellows 20:37, 9 September 2009 (UTC)
Indeed. I read the transition table incorrectly. --glennj 00:57, 10 September 2009 (UTC)

Python libraries

I tried running the python implementation, but I don't seem to have the requisite libraries installed on my Ubuntu laptop. Use of Template:Libheader and filling of the subsequent links would be helpful for visitors in the same boat. --Michael Mol 06:41, 10 September 2009 (UTC)

Hi Michael, check your installation as I just executed it on Python 2.6 and 3.1 on Windows. It uses only standard modules, and I would expect it to work, unchanged, on full installations of those versions of Python on Mac and *nix too. --Paddy3118 07:05, 10 September 2009 (UTC)
It does use the namedtuple class factory though, which is new to 2.6 and 3.x. --Paddy3118 07:14, 10 September 2009 (UTC)

Performance

Many years ago, I built an implementation of this task in Pascal (specifically Turbo Pascal) that used a number of tricks to go much faster. The source to that code is now long lost, but IIRC it used a ring-buffer of cell coordinates so that scans through the set of cells only needed to handle those cells with potential to change. This meant that the code could rapidly (15-20fps) process problems up to about the 300k cell mark (i.e., 640x480) which was a size capable of performing interesting calculations. Not bad for a 16MHz 386SX computer with less than 640kB available memory. :-) I do not remember all the details, but I presume that someone will be able to use this sort of hint/memory to come up with something equally amazing. —Donal Fellows 19:45, 10 September 2009 (UTC)