reset password
Author Message
Amedrano
Posts: 80
Posted 17:30 May 04, 2016 |

So, let me see if I understand this question.
1. We are finding the null tile.

2. Getting its coordinates.

3. Checking how many move we can make into that "null" tile.  (If position of tile is, corner: 2 moves.  If side: 3 moves,  If center: 4 moves.)

.......

I guess my questions are
A.) How many puzzleBoards are going to end up in the Arraylist we return?? is the the number of correct moves we have?

B.) Do we make a copy of the Original Board we had when we called the function?

C.) What are we doing with that copy? And why?

msargent
Posts: 519
Posted 17:34 May 04, 2016 |

A: However many moves there are: each leads to a new puzzleboard.

B: No

C. Nothing. 

Amedrano
Posts: 80
Posted 18:14 May 04, 2016 |
msargent wrote:

A: However many moves there are: each leads to a new puzzleboard.

B: No

C. Nothing. 

So how does keeping track of 2,3, or 4 moves, "shuffle" the board?  How does this method help me with the shuffle function?  That's what I don't get.

msargent
Posts: 519
Posted 18:40 May 04, 2016 |

You put them in the animation arraylist. The animation takes each board and displays them in the order they occur in the animation list. You have to write code to go through the moves and display them, one at a time. Consider what you did with postDelayed in the dice app to have the boards appear one after the other. 

Last edited by msargent at 18:43 May 04, 2016.
rpuas
Posts: 29
Posted 20:58 May 04, 2016 |

Can you explain what is the strategy for getting the cordinates of the null tile?

Do we need to save the tiles array into a 2d array so we can use NEIGHBOUR_COORDS?

msargent
Posts: 519
Posted 10:23 May 05, 2016 |

1. We discussed it Saturday:

x = index % num_tiles

y = index / num_tiles

2. No. Make methods to do the conversions (one of them is already implemented for you in the class).

Last edited by msargent at 10:48 May 05, 2016.