本系列文章,使用Python3一步步记录Tetris游戏的编写全过程,游戏功能包括手动游戏、游戏回放(数据库操做)、自动游戏(AI机器人)、强化学习、优化AI机器人。已经完成C++版本,Qt5之QGraphicsItem编写Tetris俄罗斯方块游戏。python
该游戏尽可能不使用第三方库,主要注重算法,所以界面库选择python内置的tkinter。设计思想也采用传统的方式,用一个二维数组来控制游戏空间,相似迷宫的方式。选择这种方式有一个好处是,游戏的数据直观存在,容易获取。linux
https://gitee.com/zhoutk/ptetris 或 https://github.com/zhoutk/ptetris
1. install python3, git 2. git clone https://gitee.com/zhoutk/ptetris (or download and unzip source code) 3. cd ptetris 4. python3 tetris This project surpport windows, linux, macOs on linux, you must install tkinter first, use this command: sudo apt install python3-tk
已经实现了C++版,项目地址:git
https://gitee.com/zhoutk/qtetris