Skip to content

Commit

Permalink
chore: swap ranks and files
Browse files Browse the repository at this point in the history
  • Loading branch information
raklaptudirm committed Dec 16, 2024
1 parent 7243494 commit 7a0bc76
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
4 changes: 2 additions & 2 deletions games/src/isolation/bitboard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ bitboard_type! {
Universe = Self(0xffffffffffff);

// BitBoards containing the squares of the first file and the first rank.
FirstFile = Self(0x0041041041041);
FirstRank = Self(0x000000000003f);
FirstFile = Self(0x0000010101010101);
FirstRank = Self(0x00000000000000ff);
}
}

Expand Down
18 changes: 8 additions & 10 deletions games/src/isolation/square.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,12 @@ representable_type!(
/// Square represents all the squares present on an Ataxx Board.
/// The index of each Square is equal to `rank-index * 8 + file-index`.
enum Square: u8 {
A1 "a1", B1 "b1", C1 "c1", D1 "d1", E1 "e1", F1 "f1",
A2 "a2", B2 "b2", C2 "c2", D2 "d2", E2 "e2", F2 "f2",
A3 "a3", B3 "b3", C3 "c3", D3 "d3", E3 "e3", F3 "f3",
A4 "a4", B4 "b4", C4 "c4", D4 "d4", E4 "e4", F4 "f4",
A5 "a5", B5 "b5", C5 "c5", D5 "d5", E5 "e5", F5 "f5",
A6 "a6", B6 "b6", C6 "c6", D6 "d6", E6 "e6", F6 "f6",
A7 "a7", B7 "b7", C7 "c7", D7 "d7", E7 "e7", F7 "f7",
A8 "a8", B8 "b8", C8 "c8", D8 "d8", E8 "e8", F8 "f8",
A1 "a1", B1 "b1", C1 "c1", D1 "d1", E1 "e1", F1 "f1", G1 "G1", H1 "H1",
A2 "a2", B2 "b2", C2 "c2", D2 "d2", E2 "e2", F2 "f2", G2 "G2", H2 "H2",
A3 "a3", B3 "b3", C3 "c3", D3 "d3", E3 "e3", F3 "f3", G3 "G3", H3 "H3",
A4 "a4", B4 "b4", C4 "c4", D4 "d4", E4 "e4", F4 "f4", G4 "G4", H4 "H4",
A5 "a5", B5 "b5", C5 "c5", D5 "d5", E5 "e5", F5 "f5", G5 "G5", H5 "H5",
A6 "a6", B6 "b6", C6 "c6", D6 "d6", E6 "e6", F6 "f6", G6 "G6", H6 "H6",
}
);

Expand All @@ -39,13 +37,13 @@ impl SquareType for Square {
representable_type!(
/// File represents a file on the Ataxx Board. Each vertical column of Squares
/// on an Ataxx Board is known as a File. There are 7 of them in total.
enum File: u8 { A "a", B "b", C "c", D "d", E "e", F "f", }
enum File: u8 { A "a", B "b", C "c", D "d", E "e", F "f", G "g", H "h", }
);

representable_type!(
/// Rank represents a rank on the Ataxx Board. Each horizontal row of Squares
/// on an Ataxx Board is known as a Rank. There are 7 of them in total.
enum Rank: u8 {
First "1", Second "2", Third "3", Fourth "4", Fifth "5", Sixth "6", Seventh "7", Eighth "8",
First "1", Second "2", Third "3", Fourth "4", Fifth "5", Sixth "6",
}
);

0 comments on commit 7a0bc76

Please sign in to comment.