This commit is contained in:
Unic-X
2023-08-10 00:34:22 +05:30
parent f654d7288d
commit 79a2b64d9b
5 changed files with 21 additions and 13 deletions

18
src/board.rs Normal file
View File

@@ -0,0 +1,18 @@
macro_rules! get_bit {
($s:expr) => {};
}
pub fn display(bitboard: u64) {
//loop over ranks
for rank in 0..8 {
for file in 0..8 {
//Use ranks and file to convert into Square number
let square = rank * 8 + file;
match bitboard & (1 << square) {
0 => print!("0"),
_ => print!("1"),
}
}
print!("\n");
}
}

BIN
src/main Executable file

Binary file not shown.

View File

@@ -1,14 +1,6 @@
use bevy::prelude::*;
mod board;
use board::display;
fn main() {
App::build().add_resources(Msaa{samples: 4})
.add_resource(WindowDescriptor{
title:"Chess!".to_string(),
width:1600.,
height:1600.,
..Default::default()
})
.add_plugins(DefaultPlugins).run();
display(4);
}

View File

@@ -4,7 +4,6 @@ pub enum Color{
}
struct Position{
x:u32,
y:u32
@@ -19,7 +18,6 @@ pub struct About{
pub enum Piece {
Pawn(About),
Knight(About),
Bishop(About),
Rook(About),
Queen(About),
King(About),

0
src/square.rs Normal file
View File