Guest User

baba is life

a guest
Mar 26th, 2019
522
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.49 KB | None | 0 0
  1. Strategy:
  2.  
  3. First wrote out survival/birth conditions - for tile T, "tile had baba" Y, and "tile had neighbor" C, we have the following initial conditions:
  4.  
  5. - TY TYC [TYC2 TYC3] TYC4 .. TYC8
  6. - TC TC2 [TC3] TC4 .. TC8
  7.  
  8. We want the bracketed ones to end up as "BABA" which we will call X.
  9.  
  10. The clear solution here was to first combine C into Y on Y tiles to better separate out "survival" versus "propagation" via the rule C ON Y IS Y.
  11.  
  12. - TY TY2 [TY3 TY4] TY5 .. TY9
  13. - TC TC2 [TC3] TC4 .. TC8
  14.  
  15. Then, we have to figure out an efficient and effective way to reduce the counts, move non-bracketed conditions to the zero condition (T) and turn the bracketed conditions into TX.
  16.  
  17. The best technique I've found so far is to use OPEN and SHUT to subtract one at a time.
  18.  
  19. By setting T HAS T IS SHUT, we can use C AND Y IS OPEN twice to obtain:
  20.  
  21. - T [TY TY2] TY3 .. TY7
  22. - T [TC] TC3 .. TC6
  23.  
  24. At this point we can "rescue" the lowest-count bracket. Let's turn things into G (Ghost, an arbitrary pre-baba tile) so we can make all the final BABA all at once.
  25.  
  26. We use three rules at the same time:
  27.  
  28. - C NOT ON C IS G
  29. - Y NOT ON Y IS G
  30. - Y AND C IS OPEN
  31.  
  32. The NOT ON ... IS takes priority before the subtraction via OPEN, so we end up with:
  33.  
  34. - T [TG TY] TY2 .. TY6
  35. - T [TG] TC2 .. TC5
  36.  
  37. We can repeat a similar operation by then using the following three rules, at the same time turning G into X (BABA), and cleaning up the extra intermediate tiles. As before, NOT ON ... IS takes priority.
  38.  
  39. - G IS X
  40. - Y NOT ON Y IS X
  41. - C AND Y IS EMPTY
  42.  
  43. Producing:
  44.  
  45. - T [TX TX]
  46. - T [TX]
  47.  
  48. After this point, the propagation rules could be made - basically, just a method to get C and Y to the correct locations. MAKE is unsuccessful because it doesn't produce if the tile is covered, so we will just make moving elements that move to the correct locations all at once.
  49.  
  50. Let's arbitrarily define four elements to move up, down, left, and right, called U D L R to distinguish them from the properties UP DOWN LEFT RIGHT. (Of course, we'll need to make the rules U IS UP, D IS DOWN... etc. as well as U&D&L&R IS MOVE)
  51.  
  52. We'll use conversion here to produce Y on existing tiles,
  53.  
  54. 1. BABA IS U AND D AND L AND R AND Y
  55. 2. L AND R IS C + U AND D IS L AND R AND C
  56. 3. L AND R IS C
  57.  
  58. This produces C and Y in the correct spots and cleans up after.
  59.  
  60. ===
  61.  
  62. The rules are:
  63.  
  64. STATIC RULES:
  65. To establish the cycling rules:
  66. CLOUD AND WATER AND LAVA IS TELE AND SHIFT // BELT IS SHIFT
  67. To define boundaries of the board:
  68. WALL EAT ALL
  69. To define the propagation elements (UDLR):
  70. PILLAR IS UP // STATUS IS DOWN // STAR IS LEFT // MOON IS RIGHT
  71. PILLAR AND STATUE AND STAR AND MOON IS MOVE
  72. To convert TYC(n) into TY(n+1), separating survival and propagation:
  73. ROSE ON FRUIT IS FRUIT
  74. To allow count reduction:
  75. FRUIT AND TILE HAS TILE IS SHUT
  76. CYCLING RULES:
  77. == STEP 1 (INIT PROPAGATION) ==
  78. BABA IS PILLAR AND STATUE AND STAR AND MOON AND FRUIT
  79. == STEP 2 (PROPAGATION TO CORNERS) ==
  80. STAR AND MOON IS ROSE ; PILLAR AND STATUE IS STAR AND MOON AND ROSE
  81. == STEP 3 (FINISH PROPAGATION + WAIT FOR TYC -> TY CONVERSION) ==
  82. STAR AND MOON IS ROSE
  83. == STEP 4 (REDUCE COUNTS) ==
  84. FRUIT AND ROSE IS OPEN
  85. == STEP 5 (REDUCE COUNTS) ==
  86. FRUIT AND ROSE IS OPEN
  87. == STEP 6 (CONVERT LOWEST BRACKET TO BABA) ==
  88. ROSE NOT ON ROSE IS GHOST ; FRUIT NOT ON FRUIT IS GHOST ; FRUIT AND ROSE IS OPEN
  89. == STEP 7 (CONVERT TY TO TX, MAKE BABA, CLEANUP) ==
  90. FRUIT NOT ON FRUIT IS BABA ; ROSE AND FRUIT IS EMPTY ; GHOST IS BABA
Advertisement
Add Comment
Please, Sign In to add comment