Timeline for pset3: Help with Fifteen Move function
Current License: CC BY-SA 3.0
5 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jan 24, 2017 at 12:07 | comment | added | Blauelf |
The formula i=d*row+col can transform 2D coordinates to a linear index (here arbitrarily called i ), you'd transform back using row=i/d and col=i%d . You then have an integer array with one element per tile, and store the linearised coordinate of that tile.
|
|
Jan 24, 2017 at 12:01 | comment | added | xSimplified |
Hello, thanks for the help it was incredibly useful. Do you mind giving an example how to keep track of the position of all tiles using d*row+col ? That's the only part I don't understand from your answer
|
|
Jan 24, 2017 at 11:59 | vote | accept | xSimplified | ||
Jan 23, 2017 at 16:25 | history | edited | Blauelf | CC BY-SA 3.0 |
added 7 characters in body
|
Jan 23, 2017 at 15:07 | history | answered | Blauelf | CC BY-SA 3.0 |