[board] Implement KingMoveGenerator
Generate moves for kings. This struct is trying out a different approach to iterators where the type itself isn't one, but it has an iter() method that returns an iterator over all the move lists. This struct also builds all the moves up front, in new() before the new instance is returned.
This commit is contained in:
parent
af36b75df7
commit
4a54d8b877
4 changed files with 260 additions and 0 deletions
|
|
@ -14,10 +14,18 @@ macro_rules! sq_constructor {
|
|||
}
|
||||
|
||||
impl Square {
|
||||
sq_constructor!(a1);
|
||||
sq_constructor!(a2);
|
||||
sq_constructor!(b1);
|
||||
sq_constructor!(b2);
|
||||
sq_constructor!(d3);
|
||||
sq_constructor!(d4);
|
||||
sq_constructor!(d5);
|
||||
sq_constructor!(e2);
|
||||
sq_constructor!(e3);
|
||||
sq_constructor!(e4);
|
||||
sq_constructor!(e5);
|
||||
sq_constructor!(f3);
|
||||
sq_constructor!(f4);
|
||||
sq_constructor!(f5);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue