Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

23
votes
3answers
2k 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 ...
0
votes
2answers
89 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 ...
1
vote
0answers
171 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,...
8
votes
3answers
209 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 ...
5
votes
2answers
85 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. ...
3
votes
2answers
113 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 ...
5
votes
1answer
409 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 ...
11
votes
1answer
2k 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....
6
votes
1answer
1k 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 ...
3
votes
1answer
1k 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 ...
10
votes
1answer
547 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 ...
7
votes
1answer
267 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 ...
4
votes
1answer
348 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 ...
4
votes
1answer
1k 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 ...
1
vote
1answer
72 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 ...
4
votes
2answers
323 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 ...
7
votes
1answer
164 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 ...