![]() ![]() What happened before was that if you for example clicked on "add" and then "swap" consecutively before iterating, the "swap" would affect the state prior to the "add" modification. Also now the "add", "remove" and "swap" messages retrive the state from the data structure rather than from the last state list. ![]() Here is a new version of the patch with some fixes, including the open fix by Now the response from the messages is faster and they all work properly. This also hides the indication that the patch is altered and won't ask if you want to save on close if you alter the patch manually and than [dirty 0( is send, so caution is needed while developing with this! This prevents Pd from asking the user if she wants to save the patch on closing, which is the usual behavior after donecanvasdialog changes the patch. In both versions i added [dirty 0( after the donecanvasdialog messages. So the second method maybe not possible here, the fist one should be alright. i changed the bordersize to 2, so it will look the same, but the reason that this is necessary is also the reason for the bug: The 1 pixel polygons share borders with their neighbors, or to say they overlap, so it is possible to click two or even four polygons at once. ![]() But the range is now only 10 x 10, so the 1 pixel filledpolygons will be stretched to 15 x 15 pixel each and will still fill the whole gop. If you have a 10 x 10 grid with cellsize 15, the size of the gop is set to 150 x 150. Here the filledpolygons have a fixed size of one pixel and the range is set only to height and width values. This works, but with a bug: conway1.1c.zip I've got to say that for a first project with data structures I definitely could've gone for something simpler, but I'm happy with the way it's turned out and I've learnt a Maybe i promised to much. UPDATE: the latest working patch v2.0 is a few posts downĪ big thanks to who's helped me developing this, as well as everybody else who's given me advice on the topic. I suspect this is due to the constant update of lots of scalars, but I have no experience with this. One hiccup with this implementation is that the bigger the gird the slower it is at updating the cells, so much so that for some big size/high speed combinations it's very sluggish indeed and borderline unusable, despite cpu levels being close to zero. It works with Pd 0.47.1 vanilla although it uses some abstractions from list-abs. The initial state is set by clicking some cells, and new cells can be added or removed at any time and will be included in the calculation for the next generation. It's resizable and has outlets for values which I think are meaningful. I'm aware that this has been attempted before but here's my take on implementing Conway's Game of Life using data structures. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |