{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Project 3 - Project 3 Peg Solitaire(a.k.a Brainvita This is...

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

View Full Document Right Arrow Icon
Project 3: Peg Solitaire (a.k.a. Brainvita) This is a team project to be done in groups of 3-4 Milestone Due Thursday, March 4th, 9:00 pm Final Project Due Thursday, March 11th, 9:00 pm TA: Mohammad Kazi For this project you will develop a simplified version of the Peg Solitaire game using your knowledge of arrays, loops and conditional statements. Background Course Material Setup Project Specification Divide and Conquer - Turning in a MileStone Final Project Implementation and Turnin Grading Criteria Background Peg Solitaire is a board game for one player involving movement of pegs on a board with holes.Some sets use marbles in a board with indentations. The game is known simply as Solitaire in the United Kingdom where the card games are called Patience. It is also referred to as Brainvita (especially in India), while one popular commercial version is also used generically, Hi-Q. The standard game fills the entire board with pegs except for the central hole. The objective is, making valid moves, to empty the entire board except for a solitary peg in the central hole. There are two traditional boards, graphically depicted as follows ('.' as an initial peg, 'o' as an initial hole): In this project, we would be focussing on an updated implementation of the English version of this game, which is displayed in the right hand side figure above.
Background image of page 1

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

View Full Document Right Arrow Icon
A valid move is to jump a peg horizontally or vertically over an adjacent peg into a hole two positions away and then to remove the jumped peg. In the diagrams which follow, a green * indicates the peg that is chosen to be moved and a green * indicates any other peg in a hole and a green o indicates an empty hole. A green ¤ is the hole the current peg moved from; a red * is the final position of that peg and a red o is the hole of the peg that was jumped and removed. Thus valid moves in each of the four orthogonal directions are: Move Board Configuration before the move Board Configuration after the move Jump to right * * o ¤ o * Jump to left o * * * o ¤ Jump down * * o ¤ o * Jump up o * * * o ¤ To get a feel of the game before you begin coding for this project, you are welcome to play the game online using the following link . Course Material Before you start this project, you must understand: Conditionals (section 1.3) Loops (section 1.3) 2-D Arrays (section 1.4) StdIn Library(section 1.5) CS 177 Java Coding Standards Setup 1. In your console or terminal window enter the cd command to ensure that you are in your home directory.
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}