Giter VIP home page Giter VIP logo

Comments (7)

yaneurao avatar yaneurao commented on July 29, 2024

うおー。そうでした…(´ω`)
修正しておきます。

from yaneuraou.

yaneurao avatar yaneurao commented on July 29, 2024

あと、受け方が王手回避で逆王手になったときに、これは詰みを逃れているという判定にする必要があって、以下のようにコードを修正したのですけど、3手詰めを入れるとメモリを破壊しているのか、undo_move()で落ちるようになりました。原因を調査している時間がないので…何かわかったら教えてください。(他力本願)

        for (auto m2 : MoveList<EVASIONS>(*this))
        {
            // この指し手で逆王手になるなら、不詰めとして扱う
            if (gives_check(m2))
                goto NEXT_CHECK;

from yaneuraou.

yaneurao avatar yaneurao commented on July 29, 2024

legal()判定忘れてました(´ω`) 修正しておきました。

from yaneuraou.

tttak avatar tttak commented on July 29, 2024

修正後の下記の部分、「!」が足りないような気がいたします。
「敵玉以外に敵の利きが無ければ」だと思いますので...

// toに利かせている駒から玉を取り除いて、toに利かせている駒があれば。
(attackers_to(them,to,pieces()) ^ king_square(them))

from yaneuraou.

yaneurao avatar yaneurao commented on July 29, 2024

うおー、ほんまですね!私の日本語が不自由でした(´ω`) その不自由な日本語をそのままソースコードに落として間違ったコードになってました。申し訳ない。時間なくてテストしてないもんで…。

from yaneuraou.

tttak avatar tttak commented on July 29, 2024

電王トーナメント直前のお忙しいところ、度々の追記になりましてすいません。
もしN手詰めはそれほど重要ではない場合は無視してください。

weak_mate_n_ply()は「利きのある場所への取れない近接王手からのN手詰め」とのことですが、
味方の利きのeffected_to(us, to)についても意図と異なる結果になっているように思えてきました。

 ・駒打ち以外の移動手の場合、toには移動した駒の利きがあったはずなので、effected_to(us, to)は常にtrueになってしまう。
  → attackers_to()の結果からfrom_sqを除外する。
 ・飛車先の歩を突いた場合など、長い利きの影の利きを考慮する。
  → from_sqを除外したoccupied bitboardをattackers_to()に渡す。

LONG_EFFECT_LIBRARYを使う場合を含めて、effected_to(us, to)の部分は以下のように書き換えられるかと考えましたが、いかがでしょうか?
もしバグがありましたらすいません。

#ifndef LONG_EFFECT_LIBRARY
    (is_drop(m) ? effected_to(us, to) : (attackers_to(us, to, pieces() ^ from_sq(m)) ^ from_sq(m)))
#else
    (is_drop(m) ? effected_to(us, to) :
        board_effect[us].effect(to) >= 2 ||
        (long_effect.directions_of(us, from_sq(m)) & Effect8::directions_of(from_sq(m), to)) != 0)
#endif

from yaneuraou.

yaneurao avatar yaneurao commented on July 29, 2024

うおー。ほんまですね。修正します(´ω`) ご指摘、感謝!!
N手詰め入れて、強くなるのかどうかはよくわからんですが、npsだだ下がり(10%ぐらい下がる?)なので、たぶん弱くなります…。

from yaneuraou.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.