943,688 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Unsolved
  • Views: 894
  • PHP RSS
Feb 24th, 2008
0

problem of rhyme game

Expand Post »
i want to solve thi assignment ....so if any one can help me with it i 'll really appreciate it.

Your group decided to play a game called rhyme. The game is simple; all of your friends must be in a circle and say the rhyme in clockwise turn. The person who says the last rhyme will be eliminated. Then start all over again at the next turn until one person is left.

For example, 6 friends with 4 words rhyme “eenie, meenie, mainee, mo”:

The first person leave is number 4, followed by 2 then 1, 3 and 6. Number 5 is left.

Your task is to write a program that input two numbers (between 1 and 100), the first being n, the number of friends and the second is the number of words in rhyme. The output should be the number of the last person left.
Similar Threads
Reputation Points: 10
Solved Threads: 1
Newbie Poster
joker40 is offline Offline
24 posts
since Sep 2007
Feb 24th, 2008
0

Re: problem of rhyme game

where are i am waiting .......
Reputation Points: 10
Solved Threads: 1
Newbie Poster
joker40 is offline Offline
24 posts
since Sep 2007
Feb 24th, 2008
0

Re: problem of rhyme game

Click to Expand / Collapse  Quote originally posted by joker40 ...
where are i am waiting .......
Well, if you're waiting for someone to do your homework for you... you'll probably keep waiting.

Here's a hint, though. Use a loop that will continue to execute until you get to the last person.

Find a data structure than can hold the 'n' number of friends, iterate through one person each time the loop goes around, and every x times (the # of words), remove someone from your data structure.

- Walkere
Reputation Points: 29
Solved Threads: 5
Junior Poster in Training
Walkere is offline Offline
57 posts
since Jan 2008
Feb 25th, 2008
0

Re: problem of rhyme game

i need more examples to understand more about that so plaese put some examples .
Reputation Points: 10
Solved Threads: 1
Newbie Poster
joker40 is offline Offline
24 posts
since Sep 2007
Feb 25th, 2008
0

Re: problem of rhyme game

just remember, Google is your friend for questions like yours, no one will give you code here to help with homework
Reputation Points: 16
Solved Threads: 16
Junior Poster
Auzzie is offline Offline
121 posts
since Nov 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: Populating Multiple Text Fields Based On A Dynamic Drop-Down List Selection
Next Thread in PHP Forum Timeline: search date





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC