Challenge
No
Kaba-a-a-a-a-ddi is a fave game for goats. Two teams... well, it's hard to describe.
Download the start workbook. Write a program that works out who won a game.
The workbook starts like this:
Users fill in the top part, following the rules given:
- Goats must be a number, at least 5.
- Raw score must be a number, at least 0.
- Shirt color must be green, orange, or blue. Users are allowed to use any combination of upper- and lowercase, and spaces at the start and end of their input.
Make sure you:
- Show all errors at once.
- Clear all error messages and output each time the program runs.
Error sample:
The raw score is adjusted based on the number of players, and the color of their opponent's shirts.
- For each player above 10, the score is adjusted down by one. For example, if a team had 15 players, 5 points would be subtracted from their raw score.
- For each player below 10, the score is adjusted up by one. For example, if a team had 5 players, 5 points would be added to their raw score.
- If a team wears blue shirts, their opponent's score is adjusted up by 5.
- If a team wears orange shirts, their opponent's score is adjusted down by 5.
- There is no score adjustment for green shirts.
The winner cell should show "Team 1", "Team 2", or "Draw".
Here's some output:
Upload your solution. The usual standards apply.
If you were logged in as a student, you could submit a solution to this exercise.
Where referenced