Apply selection, list arrays, file parsing, and iteration structures to design and code a custom text-based tournament simulation for your favorite sport.
Now that you have completed the 12-step World Cup Dream Manager unit, you are ready to design your own tournament manager script in Python. You can build a football simulator, or adapt the mechanics to model another sport with custom scoring rules, team configurations, and tactical choices.
Analyze how your chosen sport structures scoring, positions, and game logic. Review these examples for implementation ideas:
Features a dual-scoring system: placing the ball under the crossbar inside the net counts as a Goal (worth 3 points), while kicking it over the crossbar counts as a Point (worth 1 point).
Coding Challenge: Display scoreboards in the traditional Goals-Points format (e.g. 2-11) and compute total scores dynamically: (2 * 3) + 11 = 17 total points.
Features 7 strictly designated positional roles (GS, GA, WA, C, WD, GD, GK). Only the Goal Shooter (GS) and Goal Attack (GA) can score goals. Both positions are allowed inside the goal circle and must shoot from within it.
Coding Challenge: Create an array list of squad positions. Ensure your random match goal scorer generator restricts scoring outputs only to players assigned to GS or GA positions shooting from within the goal circle.
Note down how your game will calculate scores, validate positions or represent play configurations.
Your program must implement the following programming constructs aligned with the iGCSE Computer Science syllabus:
Prompt the user for their team choice, manager profile, and match difficulty. Validate their choices utilizing conditional selection structures.
Create a list storing player names. Use list methods to add and adjust squad selections. Validate roles based on positions (e.g. checking shooters in netball).
Program match simulation calculations. Combine team attributes (e.g. attack/defence strength) and random modifiers to calculate realistic scoring events.
Implement a 2D list representing the league or group table. Loop through match results, update points (e.g., 3 for a win, 1 for a draw), and recalculate score differences.
Load player statistics from an external CSV file. Loop through lines, split values by commas, and select team sheets based on ratings.
Read the previous high score from a file. If the current season's score exceeds it, prompt the user and write the new record back to the text file.
Use this space to outline your code structure, write pseudocode snippets, or track debugging notes.
Before submitting your code to your teacher, test the program for these criteria:
| Criteria Check | Validation Test Input | Expected Outcome | Verified |
|---|---|---|---|
| Presence check | Empty input (press enter) | Error message and loop prompt | |
| Data Type cast | Text string when expecting integer | Type check passes without crashing | |
| List boundary | Select invalid player index | Index out of bounds prevented | |
| File operations | Read/Write output file | File updates and persists after closing |