Anyone else ever get to the 4096 tile in the game? :-)
Nick Howe says he's done it, and now he's working on 8192.
Tell him to take a screenshot if he gets it!
what should happen if in a row is [0 4 4 4] and the next move is 'left'? and if the next move is 'right'?
these cases does not appear in the problem, but it can be interesting to test... ;-)
Good point! That complicates things nicely. I added a new example and corresponding test case that reflects my understanding of the 2048 rules.
I think it would also help to explicitly state that a block cannot be merged twice in the same move.
There is no assertion in test 4.
Thanks Jan! Fixed it. That test has been firing blanks for more than a year.
You are welcome. I wouldn't probably notice it if I had not sent an incorrect submission.
6 players like this wonderful problem. But at the same time 6 players like a problem like Problem 43033. Create a constant offset.
This is very confusing ...
I would love to find a way to get people "liking" problems more often. Liking makes the author feel good about a job well done, but more importantly it points people to good problems. Sometimes we try to motivate people to like problems. This happened with the October triathlon contest (when the problem you reference was created). But it can have an unintended outcome of encouraging people to like problems that aren't that great. The results are very uneven. Bottom line: if you like a problem, please "like" it!
I too stole Tim's rotation code...
Using Tim's rotation code...
Replace NaNs with the number that appears to its left in the row.
Convert a numerical matrix into a cell array of strings
Put two time series onto the same time basis
Symmetry of vector
Find the biggest empty box
Find an inscribed square on a closed curve
MatCAT - Reconstruct X from Its X-rays
Balanced Ternary Numbers: Easy as |, |-, |o
Find the Final State of an Abelian Sandpile
Find the treasures in MATLAB Central and discover how the community can help you!
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Contact your local office