Introduction
Mug Drop game is a two-player text-based game in which strategic thinking is combined with the simplified rules of stacking objects. The central point is to have the continuous line of three pieces either in the horizontal, or in the vertical or in the diagonal keeping in mind the special ranking of the game pieces in size. The implementation of this project should have been done cautiously due to the specifications of the task as described in the assignment sheet. All the work was founded on the development of an independent component of a program, which would be integrated into a working interactive game in the future. The manner in which each of the thirteen tasks was carried out and the design choices, logical flow and functionality achieved in the final solution was detailed in this report.
Explore free academic study materials developed by dedicated subject experts at the Best Assignment Writing Service Australia.
Task 1
The first one involved the introduction of a function with the number of hours spent working on the assignment.
Figure 1: Task 1

The role only provides a floating figure, which is the number of the hours spent. This easy assignment was a lesson in being particular with the signatures of functions, and reinforced the rigor of the documentation policy such as the use of informative docstrings.
Task 2
The second exercise was directed towards the extraction of the size of a given piece. All the pieces are referred to by /X\ and (X) respectively as cups and mugs with X a whole number size of the pieces.
Figure 2: Task 2

The position removes the numerical part of the text and converts it into an integer before giving out an outcome. The reason lies in the slicing functionality offered by python to treat the initial and the terminal character of the string as nonexistent in order to enable the function to be cup- and mug-insensitive (Ngoenha, 2025). The same functionality would be used later to determine the game logic based on piece size; thus, this activity was to be undertaken with precision.
Task 3
The third operation was connected with designing the initial sets of pieces of both players. The function will produce a pair of lists that will contain 2 items, one containing cups, and the other mugs.
Figure 3: Task 3

Each list contains piece strings of size 1 to size of pieces which the user determines. These strings were made in a while loop, and were appended to appropriate lists (Zhang et al., 2024). The precise formatting instructions that the assignment demanded were met by the manner in which the strings were thoughtfully constructed so that cups take the shape of /X\ and mugs of (X).
Task 4
The fourth task exercised functionality to search by size a given piece in a specific list.
Figure 4: Task 4

The function passes each item in the list, and invokes the already implemented getsize method in which each size piece is compared to the size required. On a matching match, a matching piece is returned, and otherwise the function returns the value of none (Müller et al., 2023). This kind of operation plays a significant role in ensuring that a player can only use the pieces that remain with him when playing.
Task 5
Task five assembled a blank game board by building the list of lists into which the list of lists were generated.

Figure 5: Task 5

Each position will be initially set to none, and this indicates an empty position. The functionality ensures that the board is square, by completing the same number of rows and columns based on the size of the board that is being inputted into (Xiao & Zhang, 2024). The final result provides the platform in which all the other actions of the game are performed.
Task 6
Task six was to determine the possibility to drop a piece into a given column and do so legalistically.
Figure 6: Task 6

The first is to test the cell at the summit of the column thereby to be confident that it is incapable of already receiving a piece of the same size, or of a greater size. The true value will be returned by the function in case the placement is valid and a false value in case it is not (Tabben et al., 2025). This kind of reasoning belongs to one of the fundamental rules of the game and does not include any illegal actions that can be taken in the middle of the game.
Task 7
The seventh task was among the most difficult ones and concerned using the dropping logic of a piece.
Figure 7: Task 7

The purpose of this is the part played by the function, which simulates the falling of the piece down the column, row after row, until it either reaches the bottom or it encounters a piece of the same or larger size. Any smaller fragments that happen to occur along the way are swept, in effect being covered by the new piece (Zhu et al., 2024). Then is the piece buried in place. It is this operation that alters the board on the table and ensures the dynamic characteristic of stacking pieces is properly modeled.
Task 8
The eighth task was a graphical attractive depiction of the current state of the board.
Figure 8: Task 8

The functionality is used to print the board with grid lines, row numbers and column numbers according to the specification. Preliminary focus was given to ensure that the way the results are formatted is the same that could be anticipated in addition to, vertical separators are aligned and there are no trailing spaces (Hita et al., 2023). This was a significant task in the game that made it easy to use and follow in the course of the play.
Task 9
Task nine was also related to the use of user prompts to set the game.
Figure 9: Task 9

The role asks the user to fill the number of pieces that he/she wants to play with the board size in the range of four to nine times. In the event of invalid inputs, an error message and a re-prompt are shown hence valid game setup values (Postolache et al., 2021). This option offers the input validation option and improves the wellness of the starting condition of the game.
Task 10
The command parsing of a player input was adopted in the tenth activity.
Figure 10: Task 10

This extension will continue to remind the player to enter a valid command until he or she enters a correct format, valid column numbers, correct size of the piece, and valid conditions of moves. It takes the assistance, quits and drops and presents the initial legal command in the lower case. Error messages are displayed in a strict precedence sequence so as to provide meaningful feedback to the user without breaking the gameplay with invalid input.
Students learning computational theories and database management systems can also refer to Computer Science Assignment Help for subject-related academic guidance.
Task 11
In task eleven, a win-checking mechanism was implemented. This position balances the board to define the unbroken lines of three equal pieces in the horizontal, vertical and diagonal position.
Figure 11: Task 11

The function reads its way through each cell and compares successive sequences as needed by the connection given in the support file. When encountering a winning condition, the function will provide the user identifier that satisfies the winning condition (Cups or Mugs); otherwise it will provide None. This is among the core activities in deciding on the time, at the completion of the game.
Task 12
The twelfth job was a combination of all functions that had been implemented before to create a complete cycle of single game.
Figure 12: Task 12

It begins with an intro and a choice of game settings and then enters a loop in which the current state of the board is displayed, player turns are taken and win or draw conditions evaluated after each move. This position is ended at the completion of the game through victory, draw or resignation of one of the players. This is the key to the coordination of Mug Drop game experience.
Task 13
The final activity implements the main activity that offers the capability of replay.
Figure 13: Task 13

After all the games are finished, the player is asked about whether he/she would like to play again. In case they respond with y or Y then a new game is started and in other cases the program would end gracefully (Tchounga et al., 2024). This is vital in the provision of a smooth flow between the games and the user experience.
Output
The Mug Drop programme was tested with very numerous input processing, and endgames conditions in order to compute functionality. The test results have shown and demonstrated that the programme is following the rules of play successfully validating inputs and generating the correct endgame messages at all times.
Figure 14: Game Initialisation

The first trial of the programme was given in the cases which have returned to draws. They did such a thing in one game both players had to announce a draw because they had exhausted all their rights on a four-piece board on four sides using the full board and did so correctly. It was also true with 4 pieces on a larger board (9x9) where by all the possible moves were played and the programme again resulted with a draw 1. These findings confirmed the speculation that the programme can detect the point at which neither of the players is the winner.
Figure 15: Cups Victory

The programme was also capable of making and recording victories to Cups. On many occasions, cups have been able to win on most board sizes. Another example, a 6x6 board with eight pieces each will have eight pieces, Cups will win the game by good placement before the other player can even place him/herself. Play on board was repeated with Cups winning as Mugs managed to stack the pieces on its side when Mugs snorted to counter it. Such results were also consistent showing that the programme is sound to recognise and proclaim the wins of Cups provided the conditions are met.
Figure 16: Invalid Commands

User input validation too was subjected to test. Poor entries on the count of pieces that contain zero, negative numbers, outrageous figures and non numeric values were all duly accepted with clear error warning labels that provide instructions to count with the four to nine. Unexpected board sizes such as null digits or negative digits were also taken care of by the programme giving the user an option of keying in an acceptable non-negative digit. The tests helped to prove that the programme is rigorous concerning the limits of the inputs and the gameplay does not carry on with the mislead values.
Figure 17: Help and Quit Commands

Such cheques as help and quit were also validated. Where the command of help had been entered regardless of the dissimilarity of the characters entered, the programme could always give a clear direction of what the commands were capable of completing, and the correct movement needed to take. Also, variants of input used, like different variations of the capitalization, were also accepted as variants of input, which implies and demonstrates the point of flexibility of programme input of the user. Moreover, the replay option became activated when a real game was completed and as such did not necessitate the need to restart the entire programme but use different settings.
Figure 18: Mugs Victory

Overall, the tests allowed drawing a positive conclusion that Mug Drop is effective in a great diversity of situations. It is able to recognise right wins and draws containing bad input with informative message, response to support and exit and has a simplified option of replaying games. This has rendered the game to be reliable and easy to use and play.
Conclusion
The design of the Mug Drop game required a step-wise process of the functionality development working on the distinct clear tasks. The single tasks were critical in the final solution such as basic helper functions such as getsize and getpiece, and advanced ones such as droppiece and play-game. A finished program satisfies the requirements of the assignment, and produces output in the required format, is well-input-validated and error-handled. Among the key skills in the programming field, using algorithmic logic, working with user interaction and adherence to the principles of well-organized design, it is possible to show through those tasks successfully completed.
Reference List
- Hita, I. P. A. D., Dewi, K. A. K., Indrawan, I. K. A. P., Ariestika, E., & Pranata, D. (2023). Socialization of basketball game rules. Jurnal Pengabdian Dan Pemberdayaan Masyarakat Indonesia, 3(1), 20-27. Retrieved from: https://jppmi.ptti.web.id/index.php/jppmi/article/download/108/115 [Retrieved on: 03.09.2025]
- Müller, M., Gogishvili, D., Wolfe, S. D., Gaffney, C., Hug, M., & Leick, A. (2023). Peak event: the rise, crisis and potential decline of the Olympic Games and the World Cup. Tourism Management, 95, 104657. Retrieved from: https://www.sciencedirect.com/science/article/pii/S0261517722001704 [Retrieved on: 03.09.2025]
- Ngoenha, W. I. (2025). Carbon footprint reduction practices in the Olympic Games: a policy mobility approach. Current Issues in Sport Science (CISS), 10(2), 018-018. Retrieved from: https://ciss-journal.org/article/view/11991 [Retrieved on: 03.09.2025]
- Postolache, O., Monge, J., Alexandre, R., Geman, O., Jin, Y., & Postolache, G. (2021). Virtual reality and augmented reality technologies for smart physical rehabilitation. In Advanced Systems for Biomedical Applications (pp. 155-180). Cham: Springer International Publishing. Retrieved from: https://www.researchgate.net/profile/Khandaker-Haque-2/publication/353334042_Prospects_of_Internet_of_Things_IoT_and_Machine_Learning_to_Fight_Against_COVID-19/links/61b7840b63bbd932428e2295/Prospects-of-Internet-of-Things-IoT-and-Machine-Learning-to-Fight-Against-COVID-19.pdf#page=162 [Retrieved on: 03.09.2025]
- Tabben, M., Hassanmirzaei, B., Singh, G., Miladi, R., Chaabane, M., McCourt, P., ... & Bahr, R. (2025). Lessons Learned from Implementing Injury and Illness Surveillance in Professional Football: Introducing a New Implementation Framework. Sports Medicine, 1-11. Retrieved from: https://link.springer.com/content/pdf/10.1007/s40279-025-02276-5.pdf [Retrieved on: 03.09.2025]
- Tchounga, B. K., Youngui, B. T., Epée, E., Djikeussi, T., Fokam, J., Goura, A. P., ... & Gill, M. M. (2024). Implementing SARS-CoV-2 testing during a large-scale sporting event in Africa: Lessons learned from the Africa Football Cup of Nations Tournament in Cameroon. The American journal of tropical medicine and hygiene, 112(4 Suppl), 99. Retrieved from: https://pmc.ncbi.nlm.nih.gov/articles/PMC11965711/ [Retrieved on: 03.09.2025]
- Xiao, Z., & Zhang, H. (2024). More substitutions changed team substitution strategy? An analysis of the FIFA World Cup 2002–2022. BMC Sports Science, Medicine and Rehabilitation, 16(1), 165. Retrieved from: https://link.springer.com/content/pdf/10.1186/s13102-024-00956-9.pdf [Retrieved on: 03.09.2025]
- Zhang, Z., Cao, F., Mo, Y., Zhang, Y., Poon, J., & Han, C. (2024). Game-MUG: Multimodal oriented game situation understanding and commentary generation dataset. arXiv preprint arXiv:2404.19175. Retrieved from: https://arxiv.org/pdf/2404.19175? [Retrieved on: 03.09.2025]
- Zhu, Z., Cheng, X., Zhang, Y., Chen, Z., Long, Q., Li, H., ... & Zheng, Y. (2024, October). Multivariate cooperative game for image-report pairs: Hierarchical semantic alignment for medical report generation. In International Conference on Medical Image Computing and Computer-Assisted Intervention (pp. 303-313). Cham: Springer Nature Switzerland. Retrieved from: https://papers.miccai.org/miccai-2024/paper/1475_paper.pdf [Retrieved on: 03.09.2025]