Git Product home page Git Product logo

2048gameautomovepython's Introduction

2048GameAutoMovePython

使用python3编写2048游戏及自动玩2048

演示视频:https://www.bilibili.com/video/BV1zg411u7tH/

使用pygame模块绘制游戏界面。

一、2048python

2048python目录里是纯python写的。 启动方式:

cd ./2048python
python3 main.py

二、2048python&c

2048python&c目录里是将2048策略算法使用c语言重写,然后编译成so文件,以提高运行速度。

1.编译so文件

项目中的2048.so文件是在我电脑上编译的,如果你的电脑是64位,安装的python也是64位的,且cpu什么的和我差不多,那么可以直接使用我编译的so文件。

需要安装gcc,并且得看你的python是32位还是64位,gcc也得是相应的位数。

编译:

# 进入目录
cd "./2048python&c"
gcc 2048ai.c -shared -o ./2048.so

2.运行

python3 main.py

2048gameautomovepython's People

Contributors

vacanthusky 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.