瞎扯淡 没事的进来玩个游戏吧

Peter · October 20, 2014 · Last by piecehealth replied at October 21, 2014 · 1609 hits

http://chowkafat.net/Bomb.swf

设计一个游戏原来可以这么简单,赢了的贴个图吧。

掌握策略必赢呀。要根据开局炸弹数目,再决定是先手还是后手。

def mine total, max, left
  if total - max <= left
    total - left
  else
    mine total, max, left + max + 1
  end
end

策略就是上面方法,返回 0 就是必输局,必输局就让 AI 先手,然后。。。

You need to Sign in before reply, if you don't have an account, please Sign up first.