randomly transpose top with bottom or left with right or both; caller controls which transpositions are allowed */
| 964 | /* randomly transpose top with bottom or left with right or both; |
| 965 | caller controls which transpositions are allowed */ |
| 966 | void |
| 967 | flip_level_rnd(int flp, boolean extras) |
| 968 | { |
| 969 | int c = 0; |
| 970 | |
| 971 | /* TODO? |
| 972 | * Might change rn2(2) to !rn2(3) or (rn2(5) < 2) in order to bias |
| 973 | * the outcome towards the traditional orientation. |
| 974 | */ |
| 975 | if ((flp & 1) && rn2(2)) |
| 976 | c |= 1; |
| 977 | if ((flp & 2) && rn2(2)) |
| 978 | c |= 2; |
| 979 | |
| 980 | if (c) |
| 981 | flip_level(c, extras); |
| 982 | } |
| 983 | |
| 984 | |
| 985 | staticfn void |
no test coverage detected