nozaq / shogi-rs

A Bitboard-based shogi library in Rust. Board representation, move generation/validation and time control utilities.
https://docs.rs/shogi/latest/shogi/
MIT License
46 stars 3 forks source link

Is there any reason why `find_king()` is private? #38

Closed sugyan closed 2 years ago

sugyan commented 3 years ago

I appreciate that you've been maintaining the great library. I'm trying to write some code to solve tsume-shogi with this.

I'm looking for an efficient way to generate legal Drop moves. I'm trying to consider the area only around of king's position so that I don't have to try make_move() for useless drop moves. So I'm happy if the pos.find_king() method is public and available.

https://github.com/sugyan/tsumeshogi-solver/blob/0.1.0/dfpn-solver/src/lib.rs#L190-L263

Is there any reason why this method is currently private?

my blog: https://memo.sugyan.com/entry/2021/11/11/005132

nozaq commented 2 years ago

@sugyan Hi, happy to hear this library is being used for tsume-shogi solver 👍🏼

Is there any reason why this method is currently private?

No strong reason actually, I was trying to make public interfaces as small as possible for future maintainability. I'll make Position#find_king() public in the coming release.

Please let me know if you have any questions, thanks!

nozaq commented 2 years ago

I've published v0.12.0 for this change (#39).

sugyan commented 2 years ago

Thank you for changing to public! I would like to use the latest version.