Help designing the game either in java or C++

Please support our Java advertiser: Programming Forums - DaniWeb Sister Site
Thread Solved

Join Date: Apr 2007
Posts: 22
Reputation: princekool is an unknown quantity at this point 
Solved Threads: 0
princekool princekool is offline Offline
Newbie Poster

Help designing the game either in java or C++

 
0
  #1
Apr 16th, 2007
The Program.
You have been asked to solve a problem for an old gameplayer. She has purchased a new game. It is a sort of Solitaire. This suits the old gameplayer as she has no friends so a game played alone is ideal.
The game is played on a triangular grid. That is there are 7 rows of holes. The bottom row consists of just one hole and the top row of seven holes. Every hole has a red peg in it except the bottom hole.
A move in this game consists of a red peg jumping over one of its neighbours into an empty hole beyond, and then removing the peg jumped over (like taking in draughts). In this game a peg has up to six neighbours.
The diagram shows a stylised board with red squares indicating pegs. The black square indicates a missing peg. The six pegs which could jump into the vacant space (according to the rules) are marked with yellow circles.
The idea is to make move after move until there is just one peg left. Ideally it should be in one of the three corners and best yet it should be in the bottom corner.
However, as a good gameplayer she wants to generalise the game she's bought. She wants to know for which sizes of boards the game can be completed leaving just one peg standing. She also wants to know when the last remaining peg can be left in a corner, and when it can be left in the bottom corner.
You are to write the program which gives her these answers.

Your program should prompt for the size (number of rows, up to eight) of the board.
You should output one of the sentences:
  • This game cannot be completed.
  • This game can be completed but not with the last remaining peg in a corner.
  • This game can be completed leaving a peg in a corner, but not in the top corner
  • This game can be completed leaving the last peg in the bottom corner.
Reply With Quote Quick reply to this message  
Join Date: May 2006
Posts: 1,422
Reputation: stymiee is on a distinguished road 
Solved Threads: 35
Moderator
stymiee's Avatar
stymiee stymiee is offline Offline
He's No Good To Me Dead

Re: Help designing the game either in java or C++

 
0
  #2
Apr 16th, 2007
Have you done any work yourself? If so please post it with specific questions for help. Otherwise we do not allow members to ask other members to do their homework for them. Please show some effort before asking for help.
John Conde
Brainyminds | Merchant Account Services | I Love Code
IT'S HERE: Merchant Accounts 101 Everything you need to know about merchant accounts!
Reply With Quote Quick reply to this message  
Join Date: Apr 2007
Posts: 22
Reputation: princekool is an unknown quantity at this point 
Solved Threads: 0
princekool princekool is offline Offline
Newbie Poster

Re: Help designing the game either in java or C++

 
0
  #3
Apr 16th, 2007
Jus nid help wid sm few codings wich myt b of use to this game, aint askin ny1 to do it 4 me since it aint a homework bt jus a topic of interest i picked up frm smwea. Any help wil be appreciated. Thnx
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 5,273
Reputation: iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold 
Solved Threads: 378
Featured Poster
iamthwee's Avatar
iamthwee iamthwee is offline Offline
Posting Expert

Re: Help designing the game either in java or C++

 
0
  #4
Apr 16th, 2007
Nup this is homework. Read the rules.
*Voted best profile in the world*
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 4,267
Reputation: peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of 
Solved Threads: 493
Moderator
Featured Poster
peter_budo's Avatar
peter_budo peter_budo is offline Offline
Code tags enforcer

Re: Help designing the game either in java or C++

 
0
  #5
Apr 16th, 2007
Help will be provided when you give as problem to solve, but not whole homework
Learn to see in another's calamity the ills which you should avoid.
Publilius Syrus
(~100 BC)

LJC - London Java Community, Graduate & Undergraduate Software Development Community, JAVAWUG (Java Web User Group), The London Android Group
Reply With Quote Quick reply to this message  
Join Date: Mar 2004
Posts: 802
Reputation: Phaelax is on a distinguished road 
Solved Threads: 40
Phaelax Phaelax is offline Offline
Practically a Posting Shark

Re: Help designing the game either in java or C++

 
0
  #6
Apr 16th, 2007
Jus nid help wid sm few codings wich myt b of use to this game, aint askin ny1 to do it 4 me since it aint a homework bt jus a topic of interest i picked up frm smwea. Any help wil be appreciated. Thnx
Having a little trouble spelling words?

Obviously he hasn't done any code yet, otherwise he would already know what language he needs help in.
Pick a language to use, start working on the problem, then ask the forum if something 'specific' is troubling you.
Reply With Quote Quick reply to this message  
Join Date: Apr 2005
Posts: 16,273
Reputation: jbennet is a name known to all jbennet is a name known to all jbennet is a name known to all jbennet is a name known to all jbennet is a name known to all jbennet is a name known to all 
Solved Threads: 543
Moderator
Featured Poster
jbennet's Avatar
jbennet jbennet is offline Offline
Moderator

Re: Help designing the game either in java or C++

 
0
  #7
Apr 16th, 2007
Its Java. If i remember correctly, a tutorial for an app very similar to this is available (i think it may be from the netbeans site actually....)
Last edited by jbennet; Apr 16th, 2007 at 7:09 pm.
If i am helpful, please give me reputation points.
Reply With Quote Quick reply to this message  
Join Date: Apr 2007
Posts: 22
Reputation: princekool is an unknown quantity at this point 
Solved Threads: 0
princekool princekool is offline Offline
Newbie Poster

Re: Help designing the game either in java or C++

 
0
  #8
May 8th, 2007
Thanks jbennet for the direction....u rock
Reply With Quote Quick reply to this message  
Join Date: Oct 2006
Posts: 730
Reputation: hbk619 is an unknown quantity at this point 
Solved Threads: 7
hbk619's Avatar
hbk619 hbk619 is offline Offline
Master Poster

Re: Help designing the game either in java or C++

 
0
  #9
May 10th, 2007
Originally Posted by princekool View Post
Jus nid help wid sm few codings wich myt b of use to this game, aint askin ny1 to do it 4 me since it aint a homework bt jus a topic of interest i picked up frm smwea. Any help wil be appreciated. Thnx

come again?
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Java Forum


Views: 1906 | Replies: 8
Thread Tools Search this Thread



Tag cloud for Java
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC