2048: Difference between revisions
Content added Content deleted
(Cleaned up task description to make it more succinct, more accurate, and clearer. Also cleaned up html.) |
|||
Line 11: | Line 11: | ||
:* All tiles move as far as possible in that direction, some move more than others. |
:* All tiles move as far as possible in that direction, some move more than others. |
||
:* Two adjacent tiles (in that direction only) with matching numbers combine into one bearing the sum of those numbers. |
:* Two adjacent tiles (in that direction only) with matching numbers combine into one bearing the sum of those numbers. |
||
:* A move is valid when at least one tile can be moved, |
:* A move is valid when at least one tile can be moved, including by combination. |
||
:* A new tile is spawned at the end of each turn at a randomly chosen empty square (if there is one). |
:* A new tile is spawned at the end of each turn at a randomly chosen empty square (if there is one). |
||
:* Most of the time, |
:* Most of the time, a new '''2''' is to be added, but occasionally ('''10%''' of the time), a '''4'''. |
||
:* To win, |
:* To win, the player must create a tile with the number '''2048'''. |
||
:* The player loses if no valid moves are possible. |
:* The player loses if no valid moves are possible. |
||
Line 22: | Line 22: | ||
;Requirements: |
;Requirements: |
||
* "Non-greedy" movement. |
* "Non-greedy" movement.<br> The tiles that were created by combining other tiles should not be combined again during the same turn (move).<br> That is to say, that moving the tile row of: |
||
<big><big> [2][2][2][2] </big></big> |
<big><big> [2][2][2][2] </big></big> |
||
Line 34: | Line 34: | ||
<big><big> .........[8] </big></big> |
<big><big> .........[8] </big></big> |
||
* "Move direction priority". |
* "Move direction priority".<br> If more than one variant of combining is possible, move direction shall indicate which combination will take effect. <br> For example, moving the tile row of: |
||
<big><big> ...[2][2][2] </big></big> |
<big><big> ...[2][2][2] </big></big> |
||
Line 48: | Line 48: | ||
* Check for valid moves. |
* Check for valid moves. The player shouldn't be able to gain new tile by trying a move that doesn't change the board. |
||
* Check for a |
* Check for a win condition. |
||
* Check for a lose condition. |
* Check for a lose condition. |
||
<br><br> |
<br><br> |