From 7a0bc761f40e27cfd6596cac7cd0200ffc7625aa Mon Sep 17 00:00:00 2001 From: Rak Laptudirm Date: Mon, 16 Dec 2024 14:42:30 +0530 Subject: [PATCH] chore: swap ranks and files --- games/src/isolation/bitboard.rs | 4 ++-- games/src/isolation/square.rs | 18 ++++++++---------- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/games/src/isolation/bitboard.rs b/games/src/isolation/bitboard.rs index e95959f..03b7e09 100644 --- a/games/src/isolation/bitboard.rs +++ b/games/src/isolation/bitboard.rs @@ -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); } } diff --git a/games/src/isolation/square.rs b/games/src/isolation/square.rs index a58f863..5fe8a26 100644 --- a/games/src/isolation/square.rs +++ b/games/src/isolation/square.rs @@ -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", } ); @@ -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", } );