Live data from Hacker News

8402: 2048 from the other side

sphere.chronosempire.org.uk

41–50 of 55 posts

Re: 8402: 2048 from the other side

#42
post #22

Wow, this despresses me. It pushes my nose unto the fact that I really suck at 2048, because no matter how hard I make it, this AI solves every problem I throw at it. Yet, I haven't managed to surpass 6568 after days of playing.

You're clearly not using 4.

Re: 8402: 2048 from the other side

#43
The whole wave of 2048 and the related AI problems are fascinating. Has anyone else started thinking using those at the start of a Computer science class using those as initial examples to illustrate the power and simplicity of algorithms, and motivate even non-coding-inspired students to think systematically?

Re: 8402: 2048 from the other side

#44

The real challenge of course is to build an AI to beat the AI. Here's a random clicker: setInterval(function(){ var cells = document.getElementsByClassName("grid-cell"); var pos = Math.floor((Math.random()*cells.length)); if(Math.random() < 0.5){cells[pos].click();} else {var ev = document.createEvent('HTMLEvents'); ev.initEvent('contextmenu', true, false); cells[pos].dispatchEvent(ev);} },100);

I'm waiting for a mathematician to show up and prove if in certain cases a game (no matter how well played) it's unsolvable.

Re: 8402: 2048 from the other side

#45
post #35
post #32

Earlier quoted context omitted.

Same here, although I somehow wanted it to win, so I could finally at least see the mythical 2048 tile that everyone seems to be speaking of.

I took a screenshot of one for you: http://i.imgur.com/929HNgE.png I remember watching this AI play and thinking if I could write my own strategy into an AI. The AI's strategy suffers from the issues that my strategy tries to combat. Perhaps someone can tell from my screenshot what my strategy is.

Your strategy? Up and to the left. aka keep all the empty spaces next to the lowest number tiles.

The way I beat the AI was to try to give them isolated 2s on the opposite sides of the board and then flood the board with 4s. This prevented the AI from keeping all the low numbers together and blocked some tiles from use (the ones with the isolated 2s).

Re: 8402: 2048 from the other side

#46
post #37
post #14

As a computer scientist I can't help but now ask: what is the complexity of this problem? If it's in P then this game is not very interesting (in that I can't hope to fool the AI).

That's not a problem, because there are impossible games. Your task is just to form an impossible situation. This game is MUCH easier than the original, at least for me. I never managed to beat the original, but on the other hand I've yet to be beaten by the AI.

No, because the problem is deciding whether, for all possible moves you make, there is a move that the opponent can make, such that for all possible moves you make, there is a move the opponent can make, ... that will force a win or lose for one player.

This makes it smell like a PSPACE-hard problem (if you make the board size arbitrary).

[EDIT] Now I see what you mean, that you could start in a position where you can guarantee a win and so being in P doesn't matter (the computer would just be able to tell quickly that it cannot win if you play optimally). But this also isn't satisfying because it seems unlikely that a random starting position would put you in such a state (since it's so early in the game!).

Re: 8402: 2048 from the other side

#47
post #25
post #14

As a computer scientist I can't help but now ask: what is the complexity of this problem? If it's in P then this game is not very interesting (in that I can't hope to fool the AI).

... Much higher than P pretty obviously. 16 possible drop points and 4 possible moves each turn maximum, let's say only half of each is available on average. That gives ((2)(8))^N for N amount of turns.

Why is there no better algorithm than exhaustive search of the game tree?

Re: 8402: 2048 from the other side

#48
post #32
post #3

Earlier quoted context omitted.

I had the opposite feeling, I actually felt accomplished after beating it, even though I have not completed a single 2048 variant.

Same here, although I somehow wanted it to win, so I could finally at least see the mythical 2048 tile that everyone seems to be speaking of.

The strategy is to get the largest tile in a lower corner, with the next biggest tile next to it, and then the next, across the bottom. Once you have the bottom row filled, concentrate on putting tiles into the next row which will match the ones on the bottom row. Initially, when the tiles on the bottom row aren't that big, you should concentrate on matching the biggest tile. But as that becomes too large, concentrate on matching the next biggest, then the next, and so on. Of course as soon as you do match a tile on the bottom, merge with it so the bottom row always contains the biggest possible value. This strategy ought to get you to 2048 within 3 tries if you don't make too many mistakes.

Re: 8402: 2048 from the other side

#49
post #46
post #37

Earlier quoted context omitted.

That's not a problem, because there are impossible games. Your task is just to form an impossible situation. This game is MUCH easier than the original, at least for me. I never managed to beat the original, but on the other hand I've yet to be beaten by the AI.

No, because the problem is deciding whether, for all possible moves you make, there is a move that the opponent can make, such that for all possible moves you make, there is a move the opponent can make, ... that will force a win or lose for one player. This makes it smell like a PSPACE-hard problem (if you make the board size arbitrary). [EDIT] Now I see what you mean, that you could start in a position where you ca…

What I meant is that no matter how the computer plays, you can always serve it a sequence of 2s and 4s that will never reach 2048. Easiest is to make sure there's exactly one 2 on the board, then spawn 4s in the corners, always picking the corner farthest away from the other tiles. From time to time spawn a 2 if you can guarantee it won't align with the other 2 in a couple of moves. Near the endgame it is trivial to have three 2 tiles which you keep always separate with careful placement of 4s. At that point the game becomes literally impossible to win.

Edit: Try to play it the other way, too. Try dropping tiles in the best most convenient pattern for the AI. Notice the amount of clutter that inevitably results when reaching higher numbers. An interesting question would be, if you control both the tile placement and movement, what is the highest number you can reach? With the constraint you can place only 2s.

Re: 8402: 2048 from the other side

#50
post #22

Wow, this despresses me. It pushes my nose unto the fact that I really suck at 2048, because no matter how hard I make it, this AI solves every problem I throw at it. Yet, I haven't managed to surpass 6568 after days of playing.

Ya I didn't think it was actually possible to win 2048 except through sheer luck. And then this AI just mocks me as I futilely try to keep it from winning.
Post reply on HN