tf
This commit is contained in:
		
							
								
								
									
										18
									
								
								src/board.rs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										18
									
								
								src/board.rs
									
									
									
									
									
										Normal 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");
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
							
								
								
									
										14
									
								
								src/main.rs
									
									
									
									
									
								
							
							
						
						
									
										14
									
								
								src/main.rs
									
									
									
									
									
								
							@@ -1,14 +1,6 @@
 | 
				
			|||||||
use bevy::prelude::*;
 | 
					mod board;
 | 
				
			||||||
 | 
					use board::display;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
fn main() {
 | 
					fn main() {
 | 
				
			||||||
    App::build().add_resources(Msaa{samples: 4})
 | 
					    display(4);
 | 
				
			||||||
    .add_resource(WindowDescriptor{
 | 
					 | 
				
			||||||
            title:"Chess!".to_string(),
 | 
					 | 
				
			||||||
            width:1600.,
 | 
					 | 
				
			||||||
            height:1600.,
 | 
					 | 
				
			||||||
            ..Default::default()
 | 
					 | 
				
			||||||
        })
 | 
					 | 
				
			||||||
        .add_plugins(DefaultPlugins).run();
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -4,7 +4,6 @@ pub enum Color{
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 | 
				
			||||||
struct Position{
 | 
					struct Position{
 | 
				
			||||||
    x:u32,
 | 
					    x:u32,
 | 
				
			||||||
    y:u32
 | 
					    y:u32
 | 
				
			||||||
@@ -19,7 +18,6 @@ pub struct About{
 | 
				
			|||||||
pub enum Piece {
 | 
					pub enum Piece {
 | 
				
			||||||
    Pawn(About),
 | 
					    Pawn(About),
 | 
				
			||||||
    Knight(About),
 | 
					    Knight(About),
 | 
				
			||||||
    Bishop(About),
 | 
					 | 
				
			||||||
    Rook(About),
 | 
					    Rook(About),
 | 
				
			||||||
    Queen(About),
 | 
					    Queen(About),
 | 
				
			||||||
    King(About),
 | 
					    King(About),
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										0
									
								
								src/square.rs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										0
									
								
								src/square.rs
									
									
									
									
									
										Normal file
									
								
							
		Reference in New Issue
	
	Block a user