Giter Club home page Giter Club logo

foreigncheckers's Introduction

ForeignCheckers

一个西洋跳棋小游戏,写成桌面Java程序,实现了人机对战,对博弈树的遍历进行了极大极小值的alpha-beta剪枝算法进行优化

功能

进入游戏

含游戏开始和游戏规则子项,点游戏开始则重新开始游戏,点游戏规则弹出系统对话框说明游戏规则。

游戏等级

分为简单,一般,困难三个等级,由用户选择,从而设置机器人的博弈树算法搜索深度。

游戏音效

简单地开启和关闭游戏的下棋声音。

棋盘背景

用四张不同的背景图来由用户选择更换背景。

算法优化

对博弈树的遍历进行了极大极小值的alpha-beta剪枝算法进行优化

**算法的本质**是:**一方总是寻找对己方最有利的的走法,而另一方总是寻找对对方最不利的走法。

一般应用在博弈搜索中,比如:围棋,五子棋,象棋等。结果有三种可能:胜利、失败和平局。暴力搜索,如果想通过暴力搜索,把最终的结果得到的话,搜索树的深度太大了,机器不能满足,一般都是规定一个搜索的深度,在这个深度范围内进行深度优先搜索。 假设:A和B对弈,轮到A走棋了,那么我们会遍历A的每一个可能走棋方法,然后对于前面A的每一个走棋方法,遍历B的每一个走棋方法,然后接着遍历A的每一个走棋方法,如此下去,直到得到确定的结果或者达到了搜索深度的限制。当达到了搜索深度限制,此时无法判断结局如何,一般都是根据当前局面的形式,给出一个得分,计算得分的方法被称为评价函数,不同游戏的评价函数差别很大,需要很好的设计。

界面

1)游戏开始界面调试情况

2)走棋调试情况

3)胜负判断调试情况

foreigncheckers's People

Contributors

xujiaojie avatar

Stargazers

 avatar  avatar  avatar Muyuan Guo avatar libijk avatar  avatar  avatar cz avatar  avatar  avatar  avatar  avatar Jackey  avatar  avatar  avatar  avatar  avatar

Watchers

James Cloos avatar  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.