Java Program to program an old game we used to play during our childhood--"Eenee, Meenee, Mainee, Mo!".... This program determines the winner of the game.
PROGRAM--
A group of friends are standing in a circle, playing a game. They proceed around the circle, chanting a rhyme and pointing at the next person (clockwise) on each word. When the rhyme finishes whoever is being pointed at leaves the circle. They then start again, pointing where they left off, and the game continues until only one person is left.
For example, suppose there are six friends (numbered 1 to 6) standing around the circle and the rhyme is "Eenee, Meenee, Mainee, Mo!". The first person to leave the circle is number 4, followed by 2 then 1, 3 and 6.
Number 5 is left.
Write a program that inputs two numbers (each between 1 and 1000 inclusive), the first being n, the number of friends, and the second the number of words in the rhyme. The output should be the number of the last person left.
You should assume that the friends are numbered (clockwise) from 1 to n, and that the count begins at person 1.
Sample run
Number of friends: 7
Words in rhyme: 3
Number 4 is left
100 friends stand in a circle and play the game twice using the same rhyme. In the first game they count clockwise but for the second they count anticlockwise (in each game the count begins with person 1). The same person is left each time. What is the smallest number of words that might be in the rhyme? Write a program to find the smallest number of words that might be in the rhyme.