Independent Study Program #1 - Spring 2004
The Restaurant Pacifier (A warm-up program)
Some restaurants provide each table with a small game that their customers can play while waiting (a long time?) for service. This game involves a board with 15 holes arranged as follows:
The game starts with all the holes but one filled with golf tees. A move consists of removing one tee from its hold, jumping over an adjacent tee, and landing in the open hole that is collinear and adjacent to the jumped tee. Jumps can be horizontal or diagonal. The jumped tee is removed from the board. Play continues until no more legal moves are available. The game is won if there is only one tee remaining on the board.
Write a C++ program to implement this game. Your program should ask the user which location is empty at the beginning. Use a two dimensional array to hold the data so that the top location is at [0][0] and the lower right location is at [4][4]. You should display the board in such a way that the user can see the current position. Be sure that your display is symmetric; that is, it looks like the diagram given above rather than the one given below:
Your messages to the user should be clear and concise; I will be running your program and should not have to hunt for the proper input in your code. This also means you have to determine what user input you need in order to be able to properly process the user’s desired move. An input of -1 from the user should terminate the game at any time. Your program should check for the legality of a submitted move and reject the move if it is not legal. Your program should also be able to detect if the game is won (or lost!)
Due date: midnight Feb. 2, 2004
## Deliverables
1) Complete and fully-functional working program(s) in executable form as well as complete source code of all work done.
2) Installation package that will install the software (in ready-to-run condition) on the platform(s) specified in this bid request.
3) Exclusive and complete copyrights to all work purchased. (No GPL, GNU, 3rd party components, etc. unless all copyright ramifications are explained AND AGREED TO by the buyer on the site per the coder's Seller Legal Agreement).
## Platform
microsoft visual c++ complier
windows 98