Code Monkey home page Code Monkey logo

claps_game's Introduction

拍手游戏的简单实现

目前包括

  • 一个随机 AI random_play.py
  • 一个(伪)MCTS AI mcts_pure.py
  • 人类游玩接口 human_play.py

为啥想做这个

晚自习无聊(是的大一有晚自习,太离谱了)

本来看到个 MCTS+DL 实现的五子棋想依葫芦画瓢实现下顺便学习下 DL 结果发现不对称博弈(五子棋)和对称博弈(同时出招的拍手)有巨大多区别,所以这个 MCTS 的实现是非常不正确的(感觉和随机差不多了),(但是可以吊打真随机) 希望有大佬来修正(以及因此加入 DL 的想法就咕咕咕了)

拍手游戏的规则

编号 动作 消耗气数
0 聚气 -1
1 防御 0
2 小枪 1
3 小弹 1
4 竖切 2
5 中弹 2
6 3
7 鹰眼 1
8 大弹 3
9 地裂 4
10 飞天 1

中文描述太麻烦直接看代码:

def kill(x, y):
    if (x==y): return False
    if (y==0) and (x in [2,4,6,9]): return True
    if (x==2) and (y in [0, 7, 10]): return True
    if (x==3) and (y==2): return True
    if (x==4) and (y in [0,2,3,7,10]): return True
    if (x==5) and (y in [2,4]): return True
    if (x==6) and (y in [0,1,2,3,4,10]): return True
    if (x==8) and (y in [2,4,6]): return True
    if (x==9) and (y in [0,1,2,3,4,5,6,7]): return True
    return False

或者说是:

聚气最弱,防御可以防两口气及以下攻击

任意”X弹“可以弹同级攻击及抵挡多一口气的攻击

鹰眼可以防关,飞天可以防地裂

如何使用

直接查看 __init__.py 里主函数及注释掉的代码

claps_game's People

Contributors

buzhibujuelb avatar

Watchers

 avatar

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.