Skip to content

Use Python-List only to implement the 'New 2048' game!

Notifications You must be signed in to change notification settings

AsajuHuishi/New2048Game

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 

Repository files navigation

New 2048 Game

Our New 2048 Game is mainly implemented by Python List. It is based on Python 利用列表就可以实现新2048游戏(代码可以直接运行)

  • '2048' is a classic game, but the constant change of the graphics in the matrix makes it difficult.

  • The New 2048 takes a card-like approach, with each column descending as the number of CARDS increases, which can be done with a list.

  • Suppose there are 5 columns in total where CARDS can be played. As the new CARDS arrive, they need to be placed below the lowest card in any column. When the new CARDS are equal to the original lowest card:

  1. Two CARDS disappear
  2. Add the two values to create a new card value
  3. If it is consistent with the original penultimate sheet, continue step 1.2.
  • Every time a new card appears, it's any one of the 2,4,8,16,32,64,bombs, every time it's eliminated, you get a score.
  • You get points for each elimination; For each 2048 created, gain extra points and clear all CARDS in the column; Every time you get a bomb, all the CARDS in that column disappear.
  • When all the columns reach the maximum length, the player judges negative. When all card values have been issued and the player still has room to properly enter the card, the player wins.

Requirements

  • Python
  • Numpy

How to Play

You can run it directly:

python new2048.py

You can change the total number of cards and the max length of each column.

demo = New2048(card_num=100demo = New2048(card_num=100,max_len=6)

Results

Enjoy it now!

Reference

About

Use Python-List only to implement the 'New 2048' game!

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages