Skip to main content

Questions tagged [2048]

2048 is an open source tile-based puzzle game. Questions with this tag should be either about implementing the game or implementing solving strategies.

Filter by
Sorted by
Tagged with
2 votes
2 answers
320 views

Minimal AlphaGo algorithm implementation for game 2048, connect4

I'm writing tutorial code to help high school students understand the MuZero algorithm. There are two main requirements for this code. The code needs to be simple and easy for any student to ...
user281935's user avatar
5 votes
2 answers
229 views

2048 game in Java

I am a beginner learning Java, and I coded a command line version of the game 2048 for practice. Any feedback, especially regarding best practices, object-oriented principles, and tidying up the code ...
smwt's user avatar
  • 187
3 votes
1 answer
117 views

"2048" game in JavaFX

I wrote my first code in Java and I need constructive criticism and code review. This is an implementation of the well-known "2048" sliding-blocks game. ...
hathor's user avatar
  • 31
6 votes
2 answers
1k views

2048 in Python Pygame

I built 2048 in Python with Pygame and it works as expected. I wanted to know where I could - Optimize the performance. Improve the UX. Or just improve the code readability. My file directory - <...
Random_Pythoneer59's user avatar
4 votes
2 answers
1k views

2048 Game Implementation with Excel VBA

I am trying to implement the game 2048 in Excel VBA. The each TRUE / FALSE Boolean value in row 2, 4, 6 and 8 are used for determining the data of each cell in row 1, 3, 5 and 7 is 0 or not. The ...
JimmyHu's user avatar
  • 5,184
10 votes
3 answers
742 views

JavaScript OOD: 2048

I wrote a 2048 game in JavaScript with an object-oriented paradigm. The game board is presented with a two-dimensional array and each tile holds an integer. Here is the implementation: ...
Joji's user avatar
  • 325
4 votes
2 answers
1k views

implement the merge functionality for 2048 with JavaScript

I am trying to implement the game 2048 using JavaScript. I am using a two-dimensional array to represent the board. For each row, it is represented using an array of integers. Here I am focused on ...
Joji's user avatar
  • 325
4 votes
0 answers
99 views

2048 in Matplotlib

I did an OOP to make 2048 using Matplotlib visualization. The color dictionary is for setting different colors to each number in the game. There are two classes ...
Redsbefall's user avatar
  • 1,132
2 votes
1 answer
240 views

AI In 2048 Game, Calculations so slow

Inspired by this answer on stackoverflow for AI implementation in 2048 game. I have been trying to make AI calculate best move by playing the game given specific times in memory preceding by one ...
Vicrobot's user avatar
  • 137
8 votes
3 answers
543 views

2048 graphic game

This game is made for JFrame. You can control using the arrows. The numbers in the cells are the degrees of the number 2. It is possible to change the initial position of the window, its size, and the ...
Miron's user avatar
  • 418
2 votes
1 answer
1k views

2048 game in Python 3

I wrote this 2048 game using Python 3 and pygame a few weeks ago. Since I'm getting into CS this summer, I would like to get some review on how I can improve my code in generel. Any tips and ...
Oliver Bak's user avatar
25 votes
3 answers
3k views

2048 with GUI in C

0x2048 This is my implementation of the classic game "2048" in C. The instruction to build/run the project (GitHub repo) can be found here. I started with the core game and then built a GUI ...
Gnik's user avatar
  • 882
0 votes
2 answers
554 views

2048 Webgame bot

So there is this game 2048. You can play it here I wrote a python script which "plays" the game on the website by clicking the arrow keys. I would like to know what can be improved. Is it a good ...
Sandro4912's user avatar
  • 3,076
6 votes
0 answers
1k views

2048 AI in Python 3

I am working on an 2048 AI and this is my code so far. In the game 2048 you have a 4x4 grid in that some random so named tiles spawn. Each tile has a number. The lowest number is 2. By using the left,...
codeglow's user avatar
8 votes
3 answers
2k views

2048 game: logic implementation

The following code implements the logic for moving tiles in the game 2048. The "move"(GameBoard::moveRight(), GameBoard::moveUp(), etc.) methods appear to be duplicating implementation. Any ideas for ...
pls's user avatar
  • 136
5 votes
2 answers
161 views

2048 style game

I have made a replica of the game 2048. It works exactly how the game should work. However I was just looking to know where I could've possibly cleaned up my code or make it more efficient. ...
J.Fitz's user avatar
  • 479
3 votes
2 answers
564 views

2048 movement calculation

So I programmed 2048 in python3 and a simple solver, which will just target a high numbers on the board (not the best tactic, I know), but I have the problem, that this move calculation is painfully ...
MegaIng's user avatar
  • 413
5 votes
1 answer
3k views

2048 console game (C#)

So about a week ago I decided to write a simple console version of 2048 game. Well, as you'll see, it came out not that simple... And took a lot more time and practice than expected (should've done it ...
Glitch's user avatar
  • 217
11 votes
1 answer
10k views

2048 game written in Python

This is the first time that my code is being reviewed after two years of learning of Python as autodidact. I've never took a course or a class, but I've only read books and seen some videos on youtube....
Matteo Secco's user avatar
6 votes
1 answer
4k views

2048 console game implementation

So I was asked to do a quick 2048 game with C++ but using only stuff like arrays, structures, functions, pointers without using vectors, lambda and so on. The restrictions are here because it's just a ...
Glitch's user avatar
  • 217
4 votes
1 answer
4k views

The 2048 game using C

I've decided to do something about my horrible coding and have thus made a test case for review. I'm not sure how this site works exactly, there are so many rules and they don't seem at all clear, not ...
Zacariaz's user avatar
  • 373
9 votes
1 answer
3k views

CodeFights: Game 2048

Description You are most likely familiar with the game 2048. 2048 is played on a gray 4 × 4 grid with numbered tiles that slide smoothly when a player moves them using one of the four arrow ...
Ludisposed's user avatar
  • 11.6k
7 votes
1 answer
368 views

2048 game - AI can't score more than 256 average

I'm trying to implement AI for 2048 with MiniMax and Alpha-Beta pruning, based on a snake strategy, which seems to be the best as a single heuristics. Unfortunately, AI makes 256 in most games, what ...
Keeper's user avatar
  • 211
4 votes
1 answer
630 views

2048 clone in libgdx, handling assets, and OOP overkill?

I have created a 2048 clone, I wanted to take on a simple project since I have never actually finished anything. Now I have, though I'm not a hundred percent happy with the result. Images so you know ...
The Coding Wombat's user avatar
4 votes
1 answer
3k views

Simplified version of 2048 game

I tried to get back into Java by implementing a simplified version of the 2048 game. What I am mainly looking for is ways to reduce code duplication, all of my move functions have a very similar but ...
MSB's user avatar
  • 141
1 vote
1 answer
100 views

Conditionally selecting random element from array

I'm building a clone of 2048 in C with SDL2, and I'm implementing the function that adds a number randomly to an empty cell on the board. The board is representd by a 2-Dim array ...
Bernardo Meurer's user avatar
4 votes
2 answers
518 views

C function to move and collapse cells in 2048 game

I'm implementing a clone of 2048 in C with SDL, and I have the following function for performing a movement on a column vector/array ...
Bernardo Meurer's user avatar
6 votes
1 answer
386 views

2048 game implementation in Clojure

This is my first Clojure program. If you want to run it locally please check out https://github.com/achikin/game2048-clj core.clj ...
Anton Chikin's user avatar
15 votes
2 answers
4k views

2048 (game) solver

The code contains an AI function, that searches breadth-first all possible moves and get the score of their grids, a depth of 6 is used which makes at most \$4+4^2+...+4^6\$ computed grids. The ...
caub's user avatar
  • 335