User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 391,961 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,992 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 333 | Replies: 4
Reply
Join Date: Sep 2007
Posts: 23
Reputation: joker40 is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 1
joker40 joker40 is offline Offline
Newbie Poster

problem of rhyme game

  #1  
Feb 24th, 2008
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.
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Sep 2007
Posts: 23
Reputation: joker40 is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 1
joker40 joker40 is offline Offline
Newbie Poster

Re: problem of rhyme game

  #2  
Feb 24th, 2008
where are i am waiting .......
Reply With Quote  
Join Date: Jan 2008
Posts: 55
Reputation: Walkere is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 5
Walkere Walkere is offline Offline
Junior Poster in Training

Re: problem of rhyme game

  #3  
Feb 24th, 2008
Originally Posted by joker40 View Post
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
Reply With Quote  
Join Date: Sep 2007
Posts: 23
Reputation: joker40 is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 1
joker40 joker40 is offline Offline
Newbie Poster

Re: problem of rhyme game

  #4  
Feb 25th, 2008
i need more examples to understand more about that so plaese put some examples .
Reply With Quote  
Join Date: Nov 2007
Location: Perth, Australia
Posts: 119
Reputation: Auzzie is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 16
Auzzie Auzzie is offline Offline
Junior Poster

Re: problem of rhyme game

  #5  
Feb 25th, 2008
just remember, Google is your friend for questions like yours, no one will give you code here to help with homework
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb PHP Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the PHP Forum

All times are GMT -4. The time now is 9:12 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC