[board] Fix the King's position in the Position::starting()
I wrote a test of the starting position for DiagramFormatter and discovered that Position::starting() was placing the king incorrectly. Fixed it!
This commit is contained in:
parent
ff59799add
commit
b9ba2629c4
2 changed files with 10 additions and 3 deletions
|
@ -58,4 +58,11 @@ mod tests {
|
|||
let diagram = DiagramFormatter(&pos);
|
||||
println!("{}", diagram);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn starting() {
|
||||
let pos = Position::starting();
|
||||
let diagram = DiagramFormatter(&pos);
|
||||
println!("{}", diagram);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -45,14 +45,14 @@ impl Position {
|
|||
}
|
||||
|
||||
/// Return a starting position.
|
||||
fn starting() -> Position {
|
||||
pub fn starting() -> Position {
|
||||
let white_pieces = [
|
||||
BitBoard::from_bit_field(0x00FF000000000000),
|
||||
BitBoard::from_bit_field(0x4200000000000000),
|
||||
BitBoard::from_bit_field(0x2400000000000000),
|
||||
BitBoard::from_bit_field(0x8100000000000000),
|
||||
BitBoard::from_bit_field(0x1000000000000000),
|
||||
BitBoard::from_bit_field(0x8000000000000000),
|
||||
BitBoard::from_bit_field(0x0800000000000000),
|
||||
];
|
||||
|
||||
let black_pieces = [
|
||||
|
@ -61,7 +61,7 @@ impl Position {
|
|||
BitBoard::from_bit_field(0x0024),
|
||||
BitBoard::from_bit_field(0x0081),
|
||||
BitBoard::from_bit_field(0x0010),
|
||||
BitBoard::from_bit_field(0x0080),
|
||||
BitBoard::from_bit_field(0x0008),
|
||||
];
|
||||
|
||||
Position {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue