Code Monkey home page Code Monkey logo

python-2048's Introduction

python-2048

2048小游戏的python简单实现。

最近这款小游戏非常火,想想算法也挺简单,忍不住用python实现了一个,目前还很简陋。

暂时只有终端界面,以后考虑用一种GUI美化(wxpython,qt,kivy...还没选好),或者flask,django的web框架,都简单

目前终端只支持按键回车操作,以后考虑直接终端捕获按键,无需按回车确认。

另外,规则也不完善,比如每次新插入的数字只有2,没有加入随机数4,以后加上。

目前已实现了无限撤消的功能。

文件说明

python-2048.py:在linux/mac下运行,支持无需回车确认操作,这个模块在windows下不能用。

python-2048-win.py:在windows下运行,每次指令需要回车确认。

ScreenShort

Alt img

Alt img

python-2048's People

Contributors

abcfy2 avatar codeskyblue avatar nukker avatar yytdfc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

python-2048's Issues

感觉在设置重复相加这块是不是有点问题。。。。

[0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 4, 0, 0, 0, 4]
假设初始数组是这样的。那么第一次向上划完,程序输出的是
[0, 0, 2, 4, 0, 0, 0, 4, 0, 0, 0, 4, 0, 0, 0, 0]
最下面的两个4并没有加,正常不应该是这样[0, 0, 2, 4, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0]吗?
刚来学习python,求大神轻喷

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.