let transition_rule_rrcs2d rule_num =
let table = id_to_array rule_num in
fun neighbours configuration cell ->
let n = neighbours.(cell) in
assert (Array.length n = 4);
let index =
int_of_bool configuration.(cell)
+ int_of_bool configuration.(n.(0)) lsl 1
+ int_of_bool configuration.(n.(1)) lsl 2
+ int_of_bool configuration.(n.(2)) lsl 3
+ int_of_bool configuration.(n.(3)) lsl 4 in
table.(index)