As you know, the World Cup group stage is over, and from tomorrow the best 16 teams will commence the knockout stage:
- Brazil (BRA)
- Mexico (MEX)
- Netherlands (NED)
- Chile (CHI)
- Colombia (COL)
- Greece (GRE)
- Costa Rica (CRC)
- Uruguay (URU)
- France (FRA)
- Switzerland (SUI)
- Argentina (ARG)
- Nigeria (NGA)
- Germany (GER)
- United States (USA)
- Belgium (BEL)
- Algeria (ALG)
In the knockout stage, after each match the winner gets through to the next round, and the loser goes home (there are no draws). Click here to see more about the knockout stage.
You have been hired by golfbet.com, a new betting website because you are known to be good at both programming and sports betting. Your task is to write a program or function which can guess the winner of a match. Of course, everybody makes different guesses, it doesn't matter as long as your guesses are consistent.
If you don't want to guess, you can use the following guesses:
BRA BRA CHI BRA COL COL URU GER FRA FRA NGA GER GER GER ALG GER NED NED MEX NED CRC CRC GRE ARG ARG ARG SUI ARG BEL BEL USA
- The program has to output the same winner regardless the order of the to teams (the winner of the BRA-CHI match has to be the same as of the CHI-BRA match)
- If a team loses, it cannot play any more matches. This means for matches that don't take place, you have to indicate so. For example if your program guesses Brazil to win the BRA-CHI match, then CHI-GER has to return "no result", because Chile won't play against Germany. See the link above for schedule.
For the sake of simplicity you don't have to deal with the bronze match (but you can of course).
Your program or function takes two strings as input: the 3-letter country code of the two teams and returns the country code of the winning team (you can use standard input/output, or two function parameters/return value). If the given two teams will not play according to your guesses, you must return something else (this can be anything but the country codes, eg empty string, null, error message). You can assume the input is correct (two different country codes which are in the list).
This is primarily a code-golf, so shortest program in bytes wins. However, nice and tricky solutions are also valuable.
Example (of course, you can make your own guesses):
input: BRA CHI output: BRA
input: CHI BRA output: BRA
input: CHI GER output: no result