Code Monkey home page Code Monkey logo

py2048ai's Introduction

Py2048AI

简介

学习Python免不了要用它做各种尝试,这是一个用Python写了一个能够自动运行的2048小游戏,代码全部使用类来实现,具有模块化,易扩展等特点。 目前还未添加AI算法,只是简单地模拟运行,取最高分的方向为该次游戏实际滑动的方向,平均能够玩到六七千分(没有仔细测量过),有很大的概率能够玩到1024,达到2048的概率很小。 目前的设定是:如果你开启自动运行,它会一直运行下去直到某一次游戏结束时里面的数字含有2048。

使用方法:

  • F1:新游戏按钮,按下之后开始新游戏

  • F3:帮助按钮,按下之后格子会自动变换一次

  • F5:自动运行控制按钮(如果正在自动运行,按下将停止,否则自动运行)

  • 方向控制:方向键、W-A-S-D皆可使用。

  • 菜单:如菜单所描述。

  • 另外,电脑上面安装有Monaco字体会使得界面显示效果更好。

  • 开始游戏

2048start

  • 获得2048:

2048won

py2048ai's People

Contributors

absop avatar

Stargazers

 avatar

Watchers

 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.