Skip to content

Commit

Permalink
Merge branch 'dev-crossteaser' of github.com:GamesCrafters/GamesmanNo…
Browse files Browse the repository at this point in the history
…va into dev-crossteaser
  • Loading branch information
michael-wsp committed Apr 17, 2024
2 parents 575bfb3 + 297bdb7 commit 804c08d
Showing 1 changed file with 46 additions and 46 deletions.
92 changes: 46 additions & 46 deletions src/game/crossteaser/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,30 +78,30 @@ struct UnhashedState {
/// The format of the packed orientation is front_top_right
/// Each of these will be a value from 0-5, and have 3 bits allotted.
const ORIENTATION_MAP: [u64; 24] = [
0b000_010_100, // 1
0b000_100_011, // 2
0b000_001_010, // 3
0b000_011_001, // 4
0b001_010_000, // 5
0b001_000_011, // 6
0b001_101_010, // 7
0b001_011_101, // 8
0b010_100_000, // 9
0b010_000_001, // 10
0b010_101_100, // 11
0b010_001_101, // 12
0b011_000_100, // 13
0b011_100_101, // 14
0b011_001_000, // 15
0b011_101_001, // 16
0b100_000_010, // 17
0b100_010_101, // 18
0b100_011_000, // 19
0b100_101_011, // 20
0b101_100_010, // 21
0b101_010_001, // 22
0b101_011_100, // 23
0b101_001_011, // 24
0b000_010_100, // 1
0b000_100_011, // 2
0b000_001_010, // 3
0b000_011_001, // 4
0b001_010_000, // 5
0b001_000_011, // 6
0b001_101_010, // 7
0b001_011_101, // 8
0b010_100_000, // 9
0b010_000_001, // 10
0b010_101_100, // 11
0b010_001_101, // 12
0b011_000_100, // 13
0b011_100_101, // 14
0b011_001_000, // 15
0b011_101_001, // 16
0b100_000_010, // 17
0b100_010_101, // 18
0b100_011_000, // 19
0b100_101_011, // 20
0b101_100_010, // 21
0b101_010_001, // 22
0b101_011_100, // 23
0b101_001_011, // 24
];

/// Defines a sequence of axis-wise rotations which will return an orientation
Expand All @@ -115,30 +115,30 @@ const ORIENTATION_MAP: [u64; 24] = [
/// NOTE: This can likely be improved by combining transformations in a
/// clever way.
const TRANSFORM_MAP: [u64; 24] = [
0b0, // 1
0b000_01, // 2
0b000_11, // 3
0b000_01_000_01, // 4
0b010_01, // 5
0b010_01_001_01, // 6
0b000_11_010_01, // 7
0b0, // 1
0b000_01, // 2
0b000_11, // 3
0b000_01_000_01, // 4
0b010_01, // 5
0b010_01_001_01, // 6
0b000_11_010_01, // 7
0b000_01_000_01_011_11, // 8
0b010_01_000_01, // 9
0b010_01_000_01, // 9
0b010_01_001_01_000_01, // 10
0b000_11_010_01_101_11, // 11
0b000_11_001_11, // 12
0b100_11, // 13
0b100_11_011_01, // 14
0b100_11_010_11, // 15
0b000_11_001_11, // 12
0b100_11, // 13
0b100_11_011_01, // 14
0b100_11_010_11, // 15
0b000_01_000_01_001_01, // 16
0b000_11_010_11, // 17
0b010_11, // 18
0b000_11_010_11, // 17
0b010_11, // 18
0b000_01_000_01_011_01, // 19
0b000_01_011_01, // 20
0b000_01_011_01, // 20
0b100_11_011_01_100_11, // 21
0b010_01_010_01, // 22
0b001_01_001_01, // 23
0b000_01_011_01_011_01 // 24
0b010_01_010_01, // 22
0b001_01_001_01, // 23
0b000_01_011_01_011_01, // 24
];

// Constant bitmask values that will be commonly used for hashing/unhashing
Expand Down Expand Up @@ -367,7 +367,7 @@ mod mov {
front: o.right,
top: o.top,
right: 5 - o.front,
}
};
}

/// Transforms an individual piece orientation as if it was rotated
Expand All @@ -377,7 +377,7 @@ mod mov {
front: 5 - o.right,
top: o.top,
right: o.front,
}
};
}

/// Transforms an individual piece orientation as if it was rotated
Expand All @@ -387,7 +387,7 @@ mod mov {
front: 5 - o.top,
top: o.front,
right: o.right,
}
};
}

/// Transforms an individual piece orientation as if it was rotated
Expand All @@ -397,7 +397,7 @@ mod mov {
front: o.top,
top: 5 - o.front,
right: o.right,
}
};
}

/// Performs a clowckwise orientation on an orientation
Expand Down

0 comments on commit 804c08d

Please sign in to comment.