{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

# Puzzle - 15-121 Introduction to Data Structures Exercise...

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

15-121: Introduction to Data Structures Fall 2009 Exercise 10/15/2009 Puzzle Extra Credit Due: Fri, Oct 23 8am Assignment: (worth up to 5 extra credit points) Use the files in Puzzle.zip as 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 brief description 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

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 3

Puzzle - 15-121 Introduction to Data Structures Exercise...

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

View Full Document
Ask a homework question - tutors are online