I: Neverland |
Neverland is compounded by many communities of lost kids. These communities can have one or more kids and/or a nested community (only 1) and that nested community can have one or more kids and/or a nested community (only 1), etc.
Peter Pan decided to celebrate a national championship of ``Rock-paper-scissors". Due the nation is really big he implemented a Web application to set the information. (Only to get the information) from all the kids.
The form requests the following information:
The Web application wills export all the information in a String with the following syntax:
[(Name-
Main Weapon-
Secondary Weapon)(Name-
Main Weapon-
Secondary Weapon)]
Example
[[(Michael-P-S)(John-P-R)[(Peter-P-R)(Campanita-S-P)]](Wendy-S-S)(Guillermo-R-R)]
Where
Example Explanation
Requirement
Develop a program that get the String generated by the Web Application and process the games (see rules) to provide a general Champion of Neverland.
Game Rules
*If all options were used and there is not a winner, P1 will be the winner
One case per line.
Each case is separated by a blank line.
[[(Michael-P-S)(John-P-R)[(Peter-P-R)(Campanita-S-P)]](Wendy-S-S)(Guillermo-R-R)]
Peter, Weapon: P VS Campanita, Weapon: S Won: Campanita Campanita, Weapon: S VS Michael, Weapon: P Won: Campanita Campanita, Weapon: S VS John, Weapon: P Won: Campanita Campanita, Weapon: P VS Wendy, Weapon: S Won: Wendy Wendy, Weapon: S VS Guillermo, Weapon: R Won: Guillermo Final Winner: (Guillermo-R-R)