Puzzle - 15-121: Introduction to Data StructuresFall

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

View Full Document Right Arrow Icon

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

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

Unformatted text preview: 15-121: Introduction to Data StructuresFall 2009Exercise10/15/2009PuzzleExtra CreditDue: Fri, Oct 238am Assignment: (worth up to 5 extra credit points) Use the files in Puzzle.zipas a start for this exercise. For this assignment, you will get the computer to solve a Hi-Q puzzle. [Hi-Q is a brand name of sorts. See a briefdescription at a commercial site.]The idea is to place pegs in a grid of holes, and then jump pegs over each other, eliminating the peg which was jumped over. The version of the puzzle you will be asked to solve is the one shown at the commercial site, and the Java graphics is:Rules:You can jump over a peg with another peg horizontally or vertically (not diagonally!). When you jump over a peg, you remove it. Goal:Do a series of jumps such that there is only one peg left on the board.Your program must compute a list of PuzzleMoves that will get to one peg OR display "NO SOLUTION" if there is no solution to the initial configuration. (HINT: use the backtracking model we've seen in class.)Note: your program does NOT have to have the final peg in the...
View Full Document

Page1 / 3

Puzzle - 15-121: Introduction to Data StructuresFall

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