@@ 147,17 147,8 @@ GridField allowed_moves_in_column(GridField g, struct Piece p, int x) {
GridField allowed_moves(GridField g, struct Piece p) {
GridField allowed = 0;
- for (int y = 0; y < 9 - p.height + 1; ++y) {
- for (int x = 0; x < 9 - p.width + 1; ++x) {
- int b = y * 9 + x;
- GridField pf = p.field;
-
- pf <<= b;
- GridField mask = (g & pf) == 0;
-
- mask <<= b;
- allowed |= mask;
- }
+ for (int x = 0; x < 9 - p.width + 1; ++x) {
+ allowed |= allowed_moves_in_column(g, p, x);
}
return allowed;