Assignment 1: Triple Combo Game

Assignment 1: Triple Combo Game#

Problem Description#

In this assignment, you are tasked with developing a simple but engaging game using Python.

The game is called the “Triple Combo Game”, where players select numbers from a pool to build an array and earn points by forming consecutive triplets of the same number. The game will test your understanding of basic Python programming concepts such as loops, conditionals, user input, and list operations.

Background#

The Triple Combo Game is a straightforward yet challenging game where players need to strategically select numbers from a given pool to form sequences of three identical numbers in an array. Each time a triplet is formed, it is removed from the array, and the player earns a point. The game continues until the array reaches a predefined maximum length.

Objectives#

  1. Game Initialization:

    • Initialize a pool of random numbers that players can choose from.

    • Define an array where the chosen numbers will be stored.

    • Set up a scoring system to track the player’s points.

  2. Gameplay Mechanics:

    • Display the current state of the array and the available pool of numbers to the player.

    • Allow the player to select a number from the pool and add it to the array.

    • Check for any consecutive triplets of the same number in the array. If found, remove them and update the score.

    • Ensure the game continues until the array reaches its maximum length.

  3. User Interaction:

    • Prompt the player for input and validate the input to ensure it is a number from the pool.

    • Provide feedback to the player, including their current score, the state of the array, and the available pool of numbers.

    • End the game when the array reaches its maximum length and display the final score.

Deliverables#

  • A Python script that implements the Triple Combo Game with the above-described functionality.

  • Clear and concise comments in the code explaining the logic and flow of the game.

  • User-friendly prompts and messages to enhance the player’s experience.

Download assignment1.py script from here to review and complete game logic.

Example#

ass1

Good luck, and enjoy coding your Triple Combo Game!