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

Overview

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
Owner
tiger-wang
tiger-wang
Games: Create interesting games by pure python.

Create interesting games by pure python.

4.2k Jan 06, 2023
Navicella cavallo, gioco 2D stile space shooter

Navicella Cavallo Il miglior gioco in circolazione Navicella cavallo è un gioco 2D basato sullo stile dei giochi space shooter Come installare Navicel

Matteo 6 Jul 03, 2022
中文版本的ai地牢,一个使用GPT-2的文字冒险游戏,使用清源CPM预训练模型finetune而成。

中文版本的ai地牢,一个使用GPT-2的文字冒险游戏,使用清源CPM预训练模型finetune而成。

icybee 178 Jan 03, 2023
Pyxel is a retro game engine for Python.

Pyxel is open source and free to use. Let's start making a retro game with Pyxel!

Takashi Kitao 11.2k Jan 09, 2023
Flappy-Bird AI - Flappy Bird game with AI

FLAPPY BIRD AI Flappy Bird game solved with neat-python, a Python module based o

1 Jan 07, 2022
2DMC is an abrrieviation for 2 Dimensional Minecraft.

2DMC 2DMC is an abrrieviation for 2 Dimensional Minecraft. This idea is originally created and implemented by Griffpatch on Scratch. This is a persona

DaNub 5 Nov 06, 2022
SpiderArcadeGame - A game where the player controls a little spider who is trying to protect herself from other invasive bugs

SpiderArcadeGame - A game where the player controls a little spider who is trying to protect herself from other invasive bugs

Matheus Farias de Oliveira Matsumoto 1 Mar 17, 2022
TetrisAI - Tetris AI Bot using computer vision to play game automatically

Tetris AI Tetris AI Bot using computer vision to play game automatically bot.py

11 Aug 29, 2022
Graphical impimetaion of Conway's Game of Life in Python using pyglet

Conway's Game of Life in Python Konstantin Opora Conway's Game of Life: graphical implementation in python using pyglet. developed in Python 3.10.0 Re

Konstantin Opora 1 Nov 30, 2021
A simple yet powerful Snake Game made with myPygameWorkflow

snakeGame A simple yet powerful Snake Game made with myPygameWorkflow. Requirments python3 Python.org myPygameWorkflow Github Ripo Usage $ cd main $ p

DuskyElf 1 Dec 26, 2021
Logo hitting the corner == best feeling ever!

Bouncing DVD logo - Pygame A little ride back to the 90s. Ah good ol' time! Didn't we all wait for the logo to hit the corners? Best feeling ever!! I

Hoang Nguyen 3 May 25, 2022
Trio Assembly Snakemake Workflow

Trio Assembly Snakemake Workflow Input HiFi reads for child in bam format Either

Juniper A. Lake 1 Jan 28, 2022
Orbital-patterns - A program which plots pattern that revolving planets make

orbital-patterns Click to spawn planets Press "S" to capture screenshot. Image w

Yuvraj.M 11 Dec 24, 2022
Generates and prints proxies for the card game Magic: the Gathering

MTG-Proxy-Generator This program generates proxies for the card game Magic: the Gathering. These proxies can then be printed off and used. These copie

Carl L. 1 Jan 31, 2022
This repository contains the Unix Game challenges and metadata

This repository contains the Unix Game challenges and metadata

Nokia 7 Apr 06, 2022
Setup minecraft server (Tuinity) to your directory

hapeshiva server-setup Setup minecraft server (Tuinity) for you. Support for optimization Create optimized yml Customazible server port and view dista

3 May 11, 2022
A Minecraft clone written in python and pyglet.

PyCraft A Minecraft clone written in python and pyglet. Running PyCraft To run PyCraft, run the following code: git clone https://github.com/TheWebCra

The WebCrafters 17 Dec 29, 2022
I got bored and wrote a wordle solver... Its pretty good though, just saying

Wordle Solver I got bored and wrote a wordle solver... Its pretty good though, just saying. Please go support Josh and have fun with Wordle on the off

Darrell Best 2 Jan 25, 2022
Tekken-python-ml - A project of playing tekken game using python

Tekken Python Description Hi this is new project of playing tekken game using py

Programminghut 13 Dec 30, 2022
Wordle is a word game reminiscent of mastermind

Wordle is a word game reminiscent of mastermind. The player tries to guess a five letter word within six attempts. After each attempt, hints are given. Green tiles show that the letter is in the righ

Sidharth Anand 1 Feb 09, 2022