Here is an oscillator (p2) in some totalistic rule with this property in both phases:
Code:
Select all
#C [[ AUTOSTART GPS 2 ZOOM 16 WIDTH 480 THEME 1 ]]
x = 9, y = 10, rule = B345678/S
bobobobo$2ob3ob2o2$2ob3ob2o$bobobobo$bobobobo$2ob3ob2o2$2ob3ob2o$bobob
obo!
And it can easily be expanded in trivial ways in any direction.
EDIT Here is another infinite family:
Code:
Select all
#C [[ AUTOSTART GPS 1 ZOOM 16 WIDTH 480 THEME 1 ]]
x = 15, y = 15, rule = B345678/S
obobobobobobobo$2bobobobobobo$3obobobobob3o$4bobobobo$5obobob5o$6bobo$
7ob7o2$7ob7o$6bobo$5obobob5o$4bobobobo$3obobobobob3o$2bobobobobobo$obo
bobobobobobo!
And here are results for 6x6 of modified search for such oscilators:
Code:
Select all
#C [[ AUTOSTART GPS 1 ZOOM 3 WIDTH 480 THEME 1 ]]
x = 6, y = 276, rule = B345678/S
obobo$2bob2o$4o$2bob2o$2obo$bobobo5$obobo$2bob2o$4o$3b3o$2obo$bobobo5$
obobo$2bob2o$4o$4b2o$2obo$bobobo5$obobo$2bob2o$3o$2b4o$2obo$bobobo5$ob
obo$2bob2o$3o$2bob2o$2obo$bobobo5$obobo$2bob2o$3o$3b3o$2obo$bobobo5$ob
obo$2bob2o$3o$4b2o$2obo$bobobo5$obobo$2bob2o$2obo$2b4o$2obo$bobobo5$ob
obo$2bob2o$2obo$2bob2o$2obo$bobobo5$obobo$2bob2o$2obo$3b3o$2obo$bobobo
5$obobo$2bob2o$2obo$4b2o$2obo$bobobo5$obobo$2bob2o$2o$2b4o$2obo$bobobo
5$obobo$2bob2o$2o$2bob2o$2obo$bobobo5$obobo$2bob2o$2o$3b3o$2obo$bobobo
5$bobobo$2obo$2b4o$3o$2bob2o$obobo5$bobobo$2obo$2b4o$2obo$2bob2o$obobo
5$bobobo$2obo$2b4o$2o$2bob2o$obobo5$bobobo$2obo$2bob2o$4o$2bob2o$obobo
5$bobobo$2obo$2bob2o$3o$2bob2o$obobo5$bobobo$2obo$2bob2o$2obo$2bob2o$o
bobo5$bobobo$2obo$2bob2o$2o$2bob2o$obobo5$bobobo$2obo$3b3o$4o$2bob2o$o
bobo5$bobobo$2obo$3b3o$3o$2bob2o$obobo5$bobobo$2obo$3b3o$2obo$2bob2o$o
bobo5$bobobo$2obo$3b3o$2o$2bob2o$obobo5$bobobo$2obo$4b2o$4o$2bob2o$obo
bo5$bobobo$2obo$4b2o$3o$2bob2o$obobo5$bobobo$2obo$4b2o$2obo$2bob2o$obo
bo!
Code: Select all
#include <stdio.h>
#include <time.h>
#define M 8
#define N 8
#define YES 1
#define NO 0
void print(int arr[])
{
printf("\n");
for(int i = 0; i < N; i++)
{
for(int j = 0; j < M; j++)
{
int val = arr[M * i + j];
if(val == 0)
printf(".");
if(val == 1)
printf("*");
if(val == 2)
printf("?");
}
printf("\n");
}
printf("\n");
}
int contradict(int x, int y, int evolved, int val)
{
if(x == 0 || y == 0 || x == M - 1 || y == N - 1)
{
if(evolved == 1 || val == 1)
return YES;
return NO;
}
if(evolved == 2 || val == 2)
return NO;
if(evolved == 1 - val)
return NO;
return YES;
}
int value(int arr[], int x, int y)
{
if(x < 0 || y < 0 || x >= M || y >= N)
return 0;
return arr[x + M * y];
}
int evolved(int arr[], int x, int y)
{
int cnt0 = 0;
int cnt1 = 0;
int cnt2 = 0;
for(int i = -1; i <= 1; i++)
{
for(int j = -1; j <= 1; j++)
{
if(i == 0 && j == 0)
continue;
int val = value(arr, x + i, y + j);
if(val == 0)
cnt0++;
if(val == 1)
cnt1++;
if(val == 2)
cnt2++;
}
}
int curval = value(arr, x, y);
if(curval == 2)
return 2;
if(curval == 1)
return 0;
int min = cnt1;
int max = cnt1 + cnt2;
if(min >= 3)
return 1;
if(max < 3)
return 0;
return 2;
}
//n is the last index of the array
int contradict(int arr[], int x, int y, int val)
{
arr[x + M * y] = val;
for(int i = -1; i <= 1; i++)
{
for(int j = -1; j <= 1; j++)
{
int ev = evolved(arr, x + i, y + j);
int val = value(arr, x + i, y + j);
if(contradict(x + i, y + j, ev, val) == YES)
return YES;
}
}
return NO;
}
int movexy(int *x, int *y)
{
if((*x) >= M - 2 && (*y) >= N - 2)
return NO;
(*x)--;
(*y)++;
if((*x) > 0 && (*y) < N - 1)
return YES;
(*x)++;
while((*y) > 1 && (*x) < M - 2)
{
(*x)++;
(*y)--;
}
return YES;
}
int oscp2(int arr[])
{
int arr1[M * N];
for(int i = 0; i < N; i++)
{
for(int j = 0; j < M; j++)
{
if(i == 0 || j == 0 || j == M - 1 || i == N - 1)
arr1[j + M * i] = 0;
else
arr1[j + M * i] = evolved(arr, i, j);
}
}
for(int i = 1; i < N - 1; i++)
{
for(int j = 1; j < M - 1; j++)
{
if(evolved(arr1, i, j) != arr[j + M * i])
return NO;
}
}
return YES;
}
void recurse(int arr[], int x, int y)
{
//print(arr);
//getchar();
int initx = x;
int inity = y;
if(contradict(arr, x, y, 1) == NO)
{
if(movexy(&x, &y) == YES)
{
recurse(arr, x, y);
}
else
{
if(oscp2(arr))
{
print(arr);
//getchar();
}
}
}
x = initx;
y = inity;
if(contradict(arr, x, y, 0) == NO)
{
if(movexy(&x, &y) == YES)
{
recurse(arr, x, y);
}
else
{
if(oscp2(arr))
{
print(arr);
//getchar();
}
}
}
arr[initx + M * inity] = 2;
}
int main()
{
int arr[M * N];
for(int i = 0; i < N; i++)
{
for(int j = 0; j < M; j++)
{
if(i == 0 || j == 0 || j == M - 1 || i == N - 1)
arr[j + M * i] = 0;
else
arr[j + M * i] = 2;
}
}
clock_t begin, end;
double time_spent;
begin = clock();
recurse(arr, 1, 1);
end = clock();
printf("Total time = %f", (double)(end - begin) / CLOCKS_PER_SEC);
getchar();
return 0;
}
EDIT2 Chess board stabilized:
Code:
Select all
#C [[ AUTOSTART GPS 1 ZOOM 16 WIDTH 480 THEME 1 ]]
x = 13, y = 13, rule = B345678/S
obobobobobobo$2bo3bo3bo$13o$2bobobobobo$ob2obobob2obo$2bobobobobo$4obo
bob4o$2bobobobobo$ob2obobob2obo$2bobobobobo$13o$2bo3bo3bo$obobobobobob
o!