fix start posytion; some test
This commit is contained in:
1 parent
54c458296d
commit
2c2ccd6770
2 files changed
+11
-21
No files matched your search
@@ -5,7 +5,7 @@ pub const WHITE_WON_ZONE: u64 = 0xff << 56;
|
|||||||
pub const BLACK_WON_ZONE: u64 = 0xff;
|
pub const BLACK_WON_ZONE: u64 = 0xff;
|
||||||
|
|
||||||
pub const START_BOARD: Board<1> = Board::from_layers([
|
pub const START_BOARD: Board<1> = Board::from_layers([
|
||||||
[0xffff << 48, 0xffff],
|
[0xffff, 0xffff << 48],
|
||||||
]);
|
]);
|
||||||
|
|
||||||
pub struct Breakthrough{
|
pub struct Breakthrough{
|
||||||
@@ -29,6 +29,10 @@ impl Breakthrough {
|
|||||||
self.legal_moves = Some(self.generate_legal());
|
self.legal_moves = Some(self.generate_legal());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn get_board(&self) -> Board<1> {
|
||||||
|
self.board.clone()
|
||||||
|
}
|
||||||
|
|
||||||
fn generate_legal(&self) -> HashMap<Move, MaskPatch>{
|
fn generate_legal(&self) -> HashMap<Move, MaskPatch>{
|
||||||
let mut legal: HashMap<Move, MaskPatch> = HashMap::new();
|
let mut legal: HashMap<Move, MaskPatch> = HashMap::new();
|
||||||
|
|
||||||
|
|||||||
+6
-20
@@ -1,32 +1,18 @@
|
|||||||
mod chess_api;
|
mod chess_api;
|
||||||
use chess_api::board::*;
|
use chess_api::*;
|
||||||
|
|
||||||
mod render_bitmask;
|
mod render_bitmask;
|
||||||
use render_bitmask::*;
|
use render_bitmask::*;
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
|
|
||||||
let full: u64 = 0xfefefefefefefefe;
|
let mut game: Breakthrough = Breakthrough::new();
|
||||||
|
|
||||||
let own: u64 = 0xffff002100000000;
|
let b = game.get_board();
|
||||||
|
|
||||||
let wr: u64 = 0x000000000004c83b;
|
println!("move: {}", game.legal_moves().len());
|
||||||
|
|
||||||
let bish: u64 = 0x0000002100000000;
|
render_board(BoardColor::Solid('~'), vec![(b.get_mask(Color::White, 0), 'W'), (0xff << 56, 'f')]);
|
||||||
|
|
||||||
let ans: u64 = trajectory(bish, full, own, wr, -7, None);
|
println!("move: {:?}", game.legal_moves());
|
||||||
|
|
||||||
render_board(BoardColor::Solid(':'), vec![(ans & wr,'t'), (ans, 'm'), (bish, 'a')]);
|
|
||||||
|
|
||||||
print!("\n");
|
|
||||||
|
|
||||||
render_board(BoardColor::Solid(':'), vec![(wr, 'k'), (own, 'w')]);
|
|
||||||
|
|
||||||
print!("\n");
|
|
||||||
|
|
||||||
render_board(BoardColor::Solid('`'), vec![(!mov_mask(3), 'a'), (!mov_mask(-2), 'c')]);
|
|
||||||
|
|
||||||
print!("\n");
|
|
||||||
|
|
||||||
render_board(BoardColor::Solid('`'), vec![(0xffff, 'W'), (0xffff << 48, 'B')]);
|
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user