Skip to content

buzhibujuelb/Claps_game

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

拍手游戏的简单实现

目前包括

  • 一个随机 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 里主函数及注释掉的代码

About

A simple game played by clap hands.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages