blocksDoc - Mike Jones Alex Packard SlidingBlocks Design...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Mike Jones Alex Packard SlidingBlocks Design Document 1. Our block object will contain a “current position” field denoted by x and y coordinates. Each position in the 2D array representing our tray object will either be null, or point to the block object that occupies that space. Each block object will have its position determined by its coordinates. So even if the array indices points to the block object the coordinates, only apply to the block objects coordinates of the top left position. 2. Inside of our tray object will be three (but not only three) fields, one of which will be “current position”, possible paths, and current path. For all positions that we find that are possible, we will check if they are the solution, and if yes, stop. If they are not the solution, have we seen them before? If no, add them to the stack, if yes, ignore them. 3. Starting with our initial position, we will call our getPossibilities() method on the table, which will return multiple new possible positions. Starting with the last one
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 2

blocksDoc - Mike Jones Alex Packard SlidingBlocks Design...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online