#N canvas 606 0 641 412 10; #X obj 13 51 tgl 15 0 empty empty empty 0 -6 0 8 -24198 -1 -1 1 1; #X obj 13 264 #out window; #X obj 184 122 loadbang; #X obj 13 109 #store; #X obj 33 88 bng 15 250 50 0 empty empty empty 0 -6 0 8 -14981 -1 -1 ; #X obj 13 147 t a a; #X text 49 86 next; #N canvas 0 0 450 632 game 0; #X obj 28 64 inlet matrix; #X obj 28 141 outlet matrix; #X text 18 14 this part at the left defines the rule of the game (this is my own rewriting of the rules. it is equivalent to the original but faster to compute.); #X obj 28 83 # << (b # 1); #X obj 28 122 # < (b # 3); #X obj 28 103 #convolve (3 3 b # 0 0 0 0 1) \, op >> \, seed (b # 251) ; #X text 26 173 This is about the fastest you can get in GridFlow. This solution uses all the advanced dirty tricks you can imagine (and perhaps some you can't).; #X text 26 221 First I changed the convolution to use << so that *1 becomes <<0 and *2 becomes <<1 \, because << is faster than *. Then I changed << to >> so that \, with a preceding <<1 \, <<0 becomes >>1 and <<1 becomes >>0. This is because #convolve knows that >>0 is doing nothing (just like *1) and we want to have as many of those do-nothing operations because they all get removed.; #X text 25 322 Then the check for whether the result is 5 \, 6 or 7 is reduced to a subtraction of 5 \, and a check for whether the result is 0 \, 1 or 2 This can be made by a single < by using the "b" (uint8) type \, in which negative numbers don't exist (-1 = 255). I can include the subtraction in the #convolve by using the seed \, but -5 can't be written with a b type \, so you need to write 256-5 = 251 instead. ; #X text 25 423 Those are all optional accelerations. You may want to undo a few of those so that you have a patch that is more tweakable \, but then you'd realise that it is the nature of the game of life to not be very tweakable. This is one of the most sensitive formulas you can find: most any change will completely destroy the pattern \, changing it into either an explosion of noise or sudden death. There are some difficult-to-find interesting tweaks \, but so far \, none of them has given rich results like the game of life has.; #X text 25 548 The original (3 3 # 2 2 2 2 1 2 2 2 2) is itself a shortcut I devised so that I don't have to have separate rules for lit cells and unlit cells. This is the only shortcut I'd keep in all versions of this patch no matter how much tweaking I'd do.; #X connect 0 0 3 0; #X connect 3 0 5 0; #X connect 4 0 1 0; #X connect 5 0 4 0; #X restore 13 128 pd game of life; #X text 182 95 init with a random map; #X text 183 107 10% white dots; #X text 15 215 convert this 1-bit matrix to standard RGB \; 1 becomes -1 becomes 255 \, but 0 stays 0; #X obj 184 160 # rand (b #); #X obj 184 179 # == (b # 0); #X obj 13 283 fps; #X floatatom 13 302 5 0 0 0 - - -; #X obj 0 0 doc_demo; #X obj 13 245 # inv+ (b #); #X text 89 240 (yes \, this is a crazy trick to avoid a multiplication) ; #X obj 13 68 metro 16.6666; #X msg 184 141 480 640 3 b # 10; #X text 2 24 Copyright 2001 \, ... by Mathieu Bouchard; #X text 268 28 this is 3 simultaneous boards of game of life at 480*640 ; #X text 268 41 at 60 fps \, this is 55 million cells per second.; #X text 269 54 (this patch used to be monochrome); #X text 269 67 it's also easy to make it run with more than 3 channels \, but then it becomes tricky to display that many :); #X connect 0 0 18 0; #X connect 1 0 13 0; #X connect 2 0 19 0; #X connect 3 0 7 0; #X connect 4 0 3 0; #X connect 5 0 16 0; #X connect 5 1 3 1; #X connect 7 0 5 0; #X connect 11 0 12 0; #X connect 12 0 5 0; #X connect 13 0 14 0; #X connect 16 0 1 0; #X connect 18 0 3 0; #X connect 19 0 11 0;