Jump to content

One-dimensional cellular automata: Difference between revisions

→‎{{header|C++}}: Actually you don't need a case statement at all here
(→‎{{header|C++}}: removed redundancy)
(→‎{{header|C++}}: Actually you don't need a case statement at all here)
Line 469:
std::cout << "_";
int val = (int)array[i-1] << 2 | (int)array[i] << 1 | (int)array[i+1];
switchtmpArray[i] = (val == 3 || val == 5 || val == 6);
{
case 0:
case 1:
case 2:
case 4:
case 7:
{ tmpArray[i] = false; } break;
case 3:
case 5:
case 6:
{ tmpArray[i] = true; } break;
}
}
array = tmpArray;
973

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.