\ ********** for defining the rule tables **************** 00 00 == ul0 01 01 == ur0 02 02 == ll0 03 03 == lr0 04 04 == ul1 05 05 == ur1 06 06 == ll1 07 07 == lr1 08 08 == ul2 09 09 == ur2 10 10 == ll2 11 11 == lr2 12 12 == ul3 13 13 == ur3 14 14 == ll3 15 15 == lr3 00 03 == pln0 04 07 == pln1 08 11 == pln2 12 15 == pln3 create-lut even-table create-lut odd-table create-lut reverse-table \* Utilities for defining the odd table and/or the reverse table to be the same as the even table. *\ : even>odd even-table buffer odd-table buffer length /w* cmove ; : even>reverse even-table buffer reverse-table buffer length /w* cmove ; \* Rather than shift the 2x2 blocks back and forth to change the grouping of the cell bits, we instead will identify the blocks with the cells, and rock the data back and forth. This means that data bits will alternate between different roles on even and odd steps: an upper left corner bit will play the role of a lower-right corner bit on the next step, etc. *\ : propagate update ul0 <-> lr0 ll0 <-> ur0 ul1 <-> lr1 ll1 <-> ur1 ul2 <-> lr2 ll2 <-> ur2 ul3 <-> lr3 ll3 <-> ur3 ; create-lut propagate-table ?rule>table propagate propagate-table define-step propagate-step lut-data propagate-table switch-luts lut-src site site-src lut kick run end-step \* We do the even and odd steps together here, so that after rocking the data both ways, all the block neighborhood bits will again play their original roles. Note that only three of the four bits in each bit-plane move, since one of the four bits will already be in the correct block. Note that the first thing we will do here is rock the data before running. Thus the first update will occur on the odd blocking, and the data should be prepared as if the even step has just completed, i.e., with the propagate associated with the even step already done! (See "propagate-step" above). *\ define-step odd-even-step lut-src site site-src lut kick lr0 field -1 x -1 y ur0 field -1 x 0 y ll0 field 0 x -1 y lr1 field -1 x -1 y ur1 field -1 x 0 y ll1 field 0 x -1 y lr2 field -1 x -1 y ur2 field -1 x 0 y ll2 field 0 x -1 y lr3 field -1 x -1 y ur3 field -1 x 0 y ll3 field 0 x -1 y run switch-luts kick ul0 field 1 x 1 y ll0 field 1 x 0 y ur0 field 0 x 1 y ul1 field 1 x 1 y ll1 field 1 x 0 y ur1 field 0 x 1 y ul2 field 1 x 1 y ll2 field 1 x 0 y ur2 field 0 x 1 y ul3 field 1 x 1 y ll3 field 1 x 0 y ur3 field 0 x 1 y run switch-luts end-step this is update-step \ ******************* run the experiment ******************** \* Note that if a propagate step is run during the loading of the experiment, or as part of a experiment key definition, then the lookup table used there will be replaced by the even and odd tables used for the updating whenever you start to run in the key interpreter. As usual, if you want to run steps outside of the key-interpreter, you should execute "when-starting" explicitly before executing any steps. *\ define-step odd-even-tables full-space lut-data even-table switch-luts lut-data odd-table end-step this is when-starting : density-map 0 >color ul0 ur0 ll0 lr0 + + + bright 4 / * dup >green >red ul1 ur1 ll1 lr1 + + + bright 4 / * >blue ; colormap density-map