谁能解释这个过程。提前致谢。答案非常感谢。 [英] can someone explain the process. thanks in advance. answers are greatly appreciated.

查看:109
本文介绍了谁能解释这个过程。提前致谢。答案非常感谢。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

private int NegaMax(int p) {
        int End = GameOver();
        if (End != 0)
            return End;

        int best_value = (p == 1) ? 512 : 2048;
        for (int b = 1; b <= 256; b = b << 1) {
            int move = (~(X | O) & b);
            if (move != 0) {
                put(p * move);
                int s = NegaMax(-p);
                best_value = p * (s & 0xfffffe00) > p
                        * (best_value & 0xfffffe00) ? ((s & 0xfffffe00) | move)
                        : best_value;
                clear(move);
            }

        }
        return best_value;
    }

推荐答案

没有足够的信息可以确定它是什么。最好的办法是运行代码并逐步完成。它确实适用于游戏,可能与决定移动位置的游戏AI有关。
There isn't enough information to know for sure what it is. The best thing to do is run the code and step through it. It does appear to be for a game and may have something to do with the AI of the game deciding where to move.


这篇关于谁能解释这个过程。提前致谢。答案非常感谢。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆